Skip to content

Commit 545faf2

Browse files
committed
Merge branch 'main' into feature/asinh-scale
2 parents 555bac1 + 989659a commit 545faf2

File tree

447 files changed

+14616
-13426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

447 files changed

+14616
-13426
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ environment:
1818
PYTHONIOENCODING: UTF-8
1919
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
2020
--cov-report= --cov=lib --log-level=DEBUG
21-
PINNEDVERS: "pyzmq!=21.0.0 pyzmq!=22.0.0"
21+
PINNEDVERS: "pyzmq!=21.0.0,!=22.0.0"
2222

2323
matrix:
2424
# In theory we could use a single CONDA_INSTALL_LOCN because we construct
@@ -55,7 +55,7 @@ install:
5555
- conda config --prepend channels conda-forge
5656

5757
# For building, use a new environment
58-
- conda create -q -n test-environment python=%PYTHON_VERSION% tk
58+
- conda create -q -n test-environment python=%PYTHON_VERSION% tk "pip<22.0"
5959
- activate test-environment
6060
# pull pywin32 from conda because on py38 there is something wrong with finding
6161
# the dlls when insalled from pip

.circleci/config.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ commands:
2828
name: Merge with upstream
2929
command: |
3030
if ! git remote -v | grep upstream; then
31-
git remote add upstream git://github.com/matplotlib/matplotlib.git
31+
git remote add upstream https://github.com/matplotlib/matplotlib.git
3232
fi
3333
git fetch upstream
3434
if [[ "$CIRCLE_BRANCH" != "main" ]] && \
@@ -85,7 +85,7 @@ commands:
8585
command: |
8686
python -m pip install --upgrade --user pip
8787
python -m pip install --upgrade --user wheel
88-
python -m pip install --upgrade --user setuptools
88+
python -m pip install --upgrade --user 'setuptools!=60.6.0'
8989
9090
deps-install:
9191
parameters:
@@ -104,7 +104,15 @@ commands:
104104
steps:
105105
- run:
106106
name: Install Matplotlib
107-
command: python -m pip install --user -ve .
107+
command: |
108+
if [[ "$CIRCLE_BRANCH" == v*-doc ]]; then
109+
# The v*-doc branches must build against the specified release.
110+
version=${CIRCLE_BRANCH%-doc}
111+
version=${version#v}
112+
python -m pip install matplotlib==${version}
113+
else
114+
python -m pip install --user -ve .
115+
fi
108116
- save_cache:
109117
key: build-deps-1
110118
paths:

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ per-file-ignores =
9494
tutorials/colors/colormap-manipulation.py: E402
9595
tutorials/intermediate/artists.py: E402
9696
tutorials/intermediate/constrainedlayout_guide.py: E402
97-
tutorials/intermediate/gridspec.py: E402
9897
tutorials/intermediate/legend_guide.py: E402
9998
tutorials/intermediate/tight_layout_guide.py: E402
10099
tutorials/introductory/customizing.py: E501
101100
tutorials/introductory/images.py: E402, E501
102101
tutorials/introductory/pyplot.py: E402, E501
103102
tutorials/introductory/sample_plots.py: E501
104-
tutorials/introductory/usage.py: E501
103+
tutorials/introductory/quick_start.py: E703
105104
tutorials/text/annotations.py: E402, E501
106105
tutorials/text/text_intro.py: E402
107106
tutorials/text/text_props.py: E501
@@ -121,6 +120,7 @@ per-file-ignores =
121120
examples/subplots_axes_and_figures/demo_constrained_layout.py: E402
122121
examples/text_labels_and_annotations/custom_legends.py: E402
123122
examples/ticks/date_concise_formatter.py: E402
123+
examples/ticks/date_formatters_locators.py: F401
124124
examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py: E402
125125
examples/user_interfaces/embedding_in_gtk3_sgskip.py: E402
126126
examples/user_interfaces/embedding_in_gtk4_panzoom_sgskip.py: E402

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* text=auto
2+
*.m diff=objc
23
*.ppm binary
34
*.svg binary
45
*.svg linguist-language=true

.github/workflows/cibuildwheel.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
name: Build CI wheels
22

33
on:
4+
# Save CI by only running this on release branches or tags.
45
push:
56
branches:
67
- main
78
- v[0-9]+.[0-9]+.x
89
tags:
910
- v*
11+
# Also allow running this action on PRs if requested by applying the
12+
# "Run cibuildwheel" label.
13+
pull_request:
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
18+
- labeled
1019

1120
jobs:
1221
build_wheels:
22+
if: |
23+
(
24+
github.event.action == 'labeled' &&
25+
github.event.label.name == 'Run cibuildwheel'
26+
) ||
27+
contains(github.event.pull_request.labels.*.name, 'Run cibuildwheel')
1328
name: Build wheels on ${{ matrix.os }}
1429
runs-on: ${{ matrix.os }}
1530
env:

.github/workflows/clean_pr.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ jobs:
2525
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
2626
am="$(git log "$base..HEAD^2" --pretty=tformat: --name-status --diff-filter=AM |
2727
cut --fields 2 | sort | uniq --repeated |
28-
grep -E '.(png|pdf|ps|eps|svg)' || true)"
28+
grep -E '\.(png|pdf|ps|eps|svg)' || true)"
2929
if [[ -n "$am" ]]; then
3030
printf 'The following images were both added and modified in this PR:\n%s\n' "$am"
3131
exit 1
3232
fi
33+
- name: Check for invalid backports to -doc branches
34+
if: endsWith(github.base_ref, '-doc')
35+
run: |
36+
git fetch --quiet origin "$GITHUB_BASE_REF"
37+
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
38+
lib="$(git log "$base..HEAD^2" --pretty=tformat: --name-status -- lib src |
39+
cut --fields 2 | sort || true)"
40+
if [[ -n "$lib" ]]; then
41+
printf 'Changes to the following files have no effect and should not be backported:\n%s\n' "$lib"
42+
exit 1
43+
fi

.github/workflows/pr_welcome.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,29 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/first-interaction@v1
11-
with:
12-
add-labels: "status: needs workflow approval"
13-
repo-token: ${{ secrets.GITHUB_TOKEN }}
14-
pr-message: >+
15-
Thank you for opening your first PR into Matplotlib!
10+
- uses: actions/first-interaction@v1
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
pr-message: >+
14+
Thank you for opening your first PR into Matplotlib!
1615
1716
18-
If you have not heard from us in a while, please feel free to
19-
ping `@matplotlib/developers` or anyone who has commented on the
20-
PR. Most of our reviewers are volunteers and sometimes
21-
things fall through the cracks.
17+
If you have not heard from us in a while, please feel free to ping
18+
`@matplotlib/developers` or anyone who has commented on the PR.
19+
Most of our reviewers are volunteers and sometimes things fall
20+
through the cracks.
2221
2322
24-
You can also join us [on
25-
gitter](https://gitter.im/matplotlib/matplotlib) for real-time
26-
discussion.
23+
You can also join us [on
24+
gitter](https://gitter.im/matplotlib/matplotlib) for real-time
25+
discussion.
2726
2827
29-
For details on testing, writing docs, and our review process,
30-
please see [the developer
31-
guide](https://matplotlib.org/devdocs/devel/index.html)
28+
For details on testing, writing docs, and our review process,
29+
please see [the developer
30+
guide](https://matplotlib.org/devdocs/devel/index.html)
3231
3332
34-
We strive to be a welcoming and open project. Please follow our
35-
[Code of
36-
Conduct](https://github.com/matplotlib/matplotlib/blob/main/CODE_OF_CONDUCT.md).
33+
We strive to be a welcoming and open project. Please follow our
34+
[Code of
35+
Conduct](https://github.com/matplotlib/matplotlib/blob/main/CODE_OF_CONDUCT.md).

.github/workflows/tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- auto-backport-of-pr-[0-9]+
77
- v[0-9]+.[0-9]+.[0-9x]+-doc
88
pull_request:
9+
branches-ignore:
10+
- v[0-9]+.[0-9]+.[0-9x]+-doc
911

1012
env:
1113
NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test.
@@ -14,6 +16,7 @@ env:
1416

1517
jobs:
1618
test:
19+
if: "github.repository == 'matplotlib/matplotlib' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
1720
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
1821
runs-on: ${{ matrix.os }}
1922

@@ -42,7 +45,7 @@ jobs:
4245
extra-requirements: '-r requirements/testing/extra.txt'
4346
XVFB_RUN: xvfb-run -a
4447
- os: ubuntu-20.04
45-
python-version: '3.10-dev'
48+
python-version: '3.10'
4649
# Re-add this when extra dependencies have wheels.
4750
# extra-requirements: '-r requirements/testing/extra.txt'
4851
XVFB_RUN: xvfb-run -a
@@ -234,7 +237,7 @@ jobs:
234237
235238
# All dependencies must have been pre-installed, so that the minver
236239
# constraints are held.
237-
python -m pip install --no-deps -e .
240+
python -m pip install --no-deps -ve .
238241
239242
if [[ "${{ runner.os }}" != 'macOS' ]]; then
240243
unset CPPFLAGS
@@ -249,7 +252,7 @@ jobs:
249252
run: |
250253
${{ matrix.XVFB_RUN }} python -mpytest -raR -n auto \
251254
--maxfail=50 --timeout=300 --durations=25 \
252-
--cov-report=xml --cov=lib --log-level=DEBUG
255+
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
253256
254257
- name: Filter C coverage
255258
run: |

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ci:
2+
autofix_prs: false
3+
autoupdate_schedule: 'quarterly'
4+
exclude: |
5+
(?x)^(
6+
extern|
7+
lib/matplotlib/mpl-data|
8+
doc/devel/gitwash|
9+
doc/users/prev|
10+
doc/api/prev|
11+
lib/matplotlib/tests/tinypages
12+
)
13+
repos:
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.0.1
16+
hooks:
17+
- id: check-added-large-files
18+
- id: check-docstring-first
19+
- id: end-of-file-fixer
20+
exclude_types: [svg]
21+
- id: mixed-line-ending
22+
- id: trailing-whitespace
23+
exclude_types: [svg]
24+
- repo: https://github.com/pycqa/flake8
25+
rev: 3.9.2
26+
hooks:
27+
- id: flake8
28+
additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0]
29+
args: ["--docstring-convention=all"]

INSTALL.rst

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1 @@
1-
############
2-
Installation
3-
############
4-
5-
==============================
6-
Installing an official release
7-
==============================
8-
9-
Matplotlib releases are available as wheel packages for macOS, Windows and
10-
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
11-
``pip``:
12-
13-
.. code-block:: sh
14-
15-
python -m pip install -U pip
16-
python -m pip install -U matplotlib
17-
18-
If this command results in Matplotlib being compiled from source and
19-
there's trouble with the compilation, you can add ``--prefer-binary`` to
20-
select the newest version of Matplotlib for which there is a
21-
precompiled wheel for your OS and Python.
22-
23-
.. note::
24-
25-
The following backends work out of the box: Agg, ps, pdf, svg
26-
27-
Python is typically shipped with tk bindings which are used by
28-
TkAgg.
29-
30-
For support of other GUI frameworks, LaTeX rendering, saving
31-
animations and a larger selection of file formats, you can
32-
install :ref:`optional_dependencies`.
33-
34-
=========================
35-
Third-party distributions
36-
=========================
37-
38-
Various third-parties provide Matplotlib for their environments.
39-
40-
Conda packages
41-
==============
42-
Matplotlib is available both via the *anaconda main channel*
43-
44-
.. code-block:: sh
45-
46-
conda install matplotlib
47-
48-
as well as via the *conda-forge community channel*
49-
50-
.. code-block:: sh
51-
52-
conda install -c conda-forge matplotlib
53-
54-
Python distributions
55-
====================
56-
57-
Matplotlib is part of major Python distributions:
58-
59-
- `Anaconda <https://www.anaconda.com/>`_
60-
61-
- `ActiveState ActivePython
62-
<https://www.activestate.com/products/python/downloads/>`_
63-
64-
- `WinPython <https://winpython.github.io/>`_
65-
66-
Linux package manager
67-
=====================
68-
69-
If you are using the Python version that comes with your Linux distribution,
70-
you can install Matplotlib via your package manager, e.g.:
71-
72-
* Debian / Ubuntu: ``sudo apt-get install python3-matplotlib``
73-
* Fedora: ``sudo dnf install python3-matplotlib``
74-
* Red Hat: ``sudo yum install python3-matplotlib``
75-
* Arch: ``sudo pacman -S python-matplotlib``
76-
77-
======================
78-
Installing from source
79-
======================
80-
See :ref:`install_from_source`.
81-
82-
==========================
83-
Installing for development
84-
==========================
85-
See :ref:`installing_for_devs`.
86-
87-
==============
88-
Installing FAQ
89-
==============
90-
91-
See :ref:`installing-faq`.
1+
See doc/users/installing/index.rst

0 commit comments

Comments
 (0)