Skip to content

Commit efcb43f

Browse files
authored
Merge branch 'Impaler343:main' into path-simplify
2 parents 2491647 + d347c32 commit efcb43f

File tree

91 files changed

+2638
-440
lines changed

Some content is hidden

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

91 files changed

+2638
-440
lines changed

.github/workflows/cibuildwheel.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -135,39 +135,39 @@ jobs:
135135
path: dist/
136136

137137
- name: Build wheels for CPython 3.12
138-
uses: pypa/cibuildwheel@711a3d017d0729f3edde18545fee967f03d65f65 # v2.18.0
138+
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
139139
with:
140140
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
141141
env:
142142
CIBW_BUILD: "cp312-*"
143143
CIBW_ARCHS: ${{ matrix.cibw_archs }}
144144

145145
- name: Build wheels for CPython 3.11
146-
uses: pypa/cibuildwheel@711a3d017d0729f3edde18545fee967f03d65f65 # v2.18.0
146+
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
147147
with:
148148
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
149149
env:
150150
CIBW_BUILD: "cp311-*"
151151
CIBW_ARCHS: ${{ matrix.cibw_archs }}
152152

153153
- name: Build wheels for CPython 3.10
154-
uses: pypa/cibuildwheel@711a3d017d0729f3edde18545fee967f03d65f65 # v2.18.0
154+
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
155155
with:
156156
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
157157
env:
158158
CIBW_BUILD: "cp310-*"
159159
CIBW_ARCHS: ${{ matrix.cibw_archs }}
160160

161161
- name: Build wheels for CPython 3.9
162-
uses: pypa/cibuildwheel@711a3d017d0729f3edde18545fee967f03d65f65 # v2.18.0
162+
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
163163
with:
164164
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
165165
env:
166166
CIBW_BUILD: "cp39-*"
167167
CIBW_ARCHS: ${{ matrix.cibw_archs }}
168168

169169
- name: Build wheels for PyPy
170-
uses: pypa/cibuildwheel@711a3d017d0729f3edde18545fee967f03d65f65 # v2.18.0
170+
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
171171
with:
172172
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
173173
env:
@@ -189,6 +189,8 @@ jobs:
189189
environment: release
190190
permissions:
191191
id-token: write
192+
attestations: write
193+
contents: read
192194
steps:
193195
- name: Download packages
194196
uses: actions/download-artifact@v4
@@ -200,5 +202,10 @@ jobs:
200202
- name: Print out packages
201203
run: ls dist
202204

205+
- name: Generate artifact attestation for sdist and wheel
206+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
207+
with:
208+
subject-path: dist/matplotlib-*
209+
203210
- name: Publish package distributions to PyPI
204-
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
211+
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0

.github/workflows/circleci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
name: Run CircleCI artifacts redirector
1111
steps:
1212
- name: GitHub Action step
13-
uses: larsoner/circleci-artifacts-redirector-action@master
13+
uses:
14+
scientific-python/circleci-artifacts-redirector-action@4e13a10d89177f4bfc8007a7064bdbeda848d8d1 # v1.0.0
1415
with:
1516
repo-token: ${{ secrets.GITHUB_TOKEN }}
1617
api-token: ${{ secrets.CIRCLECI_TOKEN }}

.github/workflows/conflictcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check if PRs have merge conflicts
20-
uses: eps1lon/actions-label-merge-conflict@6d74047dcef155976a15e4a124dde2c7fe0c5522 # v3.0.1
20+
uses: eps1lon/actions-label-merge-conflict@1b1b1fcde06a9b3d089f3464c96417961dde1168 # v3.0.2
2121
with:
2222
dirtyLabel: "status: needs rebase"
2323
repoToken: "${{ secrets.GITHUB_TOKEN }}"

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ repos:
7979
- id: yamllint
8080
args: ["--strict", "--config-file=.yamllint.yml"]
8181
- repo: https://github.com/python-jsonschema/check-jsonschema
82-
rev: 0.28.1
82+
rev: 0.28.4
8383
hooks:
8484
# TODO: Re-enable this when https://github.com/microsoft/azure-pipelines-vscode/issues/567 is fixed.
8585
# - id: check-azure-pipelines

.yamllint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extends: default
33

44
rules:
55
line-length:
6-
max: 111
6+
max: 120
77
allow-non-breakable-words: true
88
truthy:
99
check-keys: false

doc/_static/switcher.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
{
33
"name": "3.9 (stable)",
44
"version": "stable",
5-
"url": "https://matplotlib.org/stable/"
5+
"url": "https://matplotlib.org/stable/",
6+
"preferred": true
67
},
78
{
89
"name": "3.10 (dev)",

doc/api/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Alphabetical list of modules:
126126
sphinxext_mathmpl_api.rst
127127
sphinxext_plot_directive_api.rst
128128
sphinxext_figmpl_directive_api.rst
129+
sphinxext_roles.rst
129130
spines_api.rst
130131
style_api.rst
131132
table_api.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Subfigures
2+
~~~~~~~~~~
3+
4+
`.Figure.subfigures` are now added in row-major order to be consistent with
5+
`.Figure.subplots`. The return value of `~.Figure.subfigures` is not changed,
6+
but the order of ``fig.subfigs`` is.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Documentation-specific custom Sphinx roles are now semi-public
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
For third-party packages that derive types from Matplotlib, our use of custom roles may
5+
prevent Sphinx from building their docs. These custom Sphinx roles are now public solely
6+
for the purposes of use within projects that derive from Matplotlib types. See
7+
:mod:`matplotlib.sphinxext.roles` for details.

doc/api/sphinxext_roles.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
==============================
2+
``matplotlib.sphinxext.roles``
3+
==============================
4+
5+
.. automodule:: matplotlib.sphinxext.roles
6+
:no-undoc-members:
7+
:private-members: _rcparam_role, _mpltype_role

doc/api/toolkits/mplot3d/axes3d.rst

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Plotting
3030
plot_surface
3131
plot_wireframe
3232
plot_trisurf
33+
fill_between
3334

3435
clabel
3536
contour

doc/api/toolkits/mplot3d/view_angles.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ The position of the viewport "camera" in a 3D plot is defined by three angles:
1212
points towards the center of the plot box volume. The angle direction is a
1313
common convention, and is shared with
1414
`PyVista <https://docs.pyvista.org/api/core/camera.html>`_ and
15-
`MATLAB <https://www.mathworks.com/help/matlab/ref/view.html>`_
16-
(though MATLAB lacks a roll angle). Note that a positive roll angle rotates the
15+
`MATLAB <https://www.mathworks.com/help/matlab/ref/view.html>`_.
16+
Note that a positive roll angle rotates the
1717
viewing plane clockwise, so the 3d axes will appear to rotate
1818
counter-clockwise.
1919

2020
.. image:: /_static/mplot3d_view_angles.png
2121
:align: center
2222
:scale: 50
2323

24-
Rotating the plot using the mouse will control only the azimuth and elevation,
25-
but all three angles can be set programmatically::
24+
Rotating the plot using the mouse will control azimuth, elevation,
25+
as well as roll, and all three angles can be set programmatically::
2626

2727
import matplotlib.pyplot as plt
2828
ax = plt.figure().add_subplot(projection='3d')

doc/conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def _parse_skip_subdirs_file():
116116
'sphinx_gallery.gen_gallery',
117117
'matplotlib.sphinxext.mathmpl',
118118
'matplotlib.sphinxext.plot_directive',
119+
'matplotlib.sphinxext.roles',
119120
'matplotlib.sphinxext.figmpl_directive',
120121
'sphinxcontrib.inkscapeconverter',
121-
'sphinxext.custom_roles',
122122
'sphinxext.github',
123123
'sphinxext.math_symbol_table',
124124
'sphinxext.missing_references',
@@ -236,7 +236,8 @@ def _check_dependencies():
236236
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
237237
'tornado': ('https://www.tornadoweb.org/en/stable/', None),
238238
'xarray': ('https://docs.xarray.dev/en/stable/', None),
239-
'meson-python': ('https://meson-python.readthedocs.io/en/stable/', None)
239+
'meson-python': ('https://meson-python.readthedocs.io/en/stable/', None),
240+
'pip': ('https://pip.pypa.io/en/stable/', None),
240241
}
241242

242243

@@ -508,6 +509,7 @@ def js_tag_with_cache_busting(js):
508509
# this special value indicates the use of the unreleased banner. If we need
509510
# an actual announcement, then just place the text here as usual.
510511
"announcement": "unreleased" if not is_release_build else "",
512+
"show_version_warning_banner": True,
511513
}
512514
include_analytics = is_release_build
513515
if include_analytics:

doc/devel/coding_guide.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ We generally use `stub files
8989
the type information for ``colors.py``. A notable exception is ``pyplot.py``,
9090
which is type hinted inline.
9191

92-
Type hints are checked by the mypy :ref:`pre-commit hook <pre-commit-hooks>`,
93-
can often be verified by running ``tox -e stubtest``.
92+
Type hints can be validated by the `stubtest
93+
<https://mypy.readthedocs.io/en/stable/stubtest.html>`_ tool, which can be run
94+
locally using ``tox -e stubtest`` and is a part of the :ref:`automated-tests`
95+
suite. Type hints for existing functions are also checked by the mypy
96+
:ref:`pre-commit hook <pre-commit-hooks>`.
97+
9498

9599
New modules and files: installation
96100
===================================

doc/devel/communication_guide.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Our approach to community engagement is foremost guided by our :ref:`mission-sta
2121
who may no longer be active on GitHub, build relationships with potential
2222
contributors, and connect with other projects and communities who use
2323
Matplotlib.
24-
* In prioritizing understandability and extensiblity, we recognize that people
24+
* In prioritizing understandability and extensibility, we recognize that people
2525
using Matplotlib, in whatever capacity, are part of our community. Doing so
2626
empowers our community members to build community with each other, for example
2727
by creating educational resources, building third party tools, and building

doc/devel/development_setup.rst

+6
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,9 @@ listed in ``.pre-commit-config.yaml``, against the full codebase with ::
254254
To run a particular hook manually, run ``pre-commit run`` with the hook id ::
255255

256256
pre-commit run <hook id> --all-files
257+
258+
259+
Please note that the ``mypy`` pre-commit hook cannot check the :ref:`type-hints`
260+
for new functions; instead the stubs for new functions are checked using the
261+
``stubtest`` :ref:`CI check <automated-tests>` and can be checked locally using
262+
``tox -e stubtest``.

doc/devel/testing.rst

+17-6
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,28 @@ circle: plotting a circle using a `matplotlib.patches.Circle` patch
182182
vs plotting the circle using the parametric equation of a circle ::
183183

184184
from matplotlib.testing.decorators import check_figures_equal
185-
import matplotib.patches as mpatches
185+
import matplotlib.patches as mpatches
186186
import matplotlib.pyplot as plt
187187
import numpy as np
188188

189-
@check_figures_equal(extensions=['png'], tol=100)
189+
@check_figures_equal()
190190
def test_parametric_circle_plot(fig_test, fig_ref):
191-
red_circle_ref = mpatches.Circle((0, 0), 0.2, color='r', clip_on=False)
192-
fig_ref.add_artist(red_circle_ref)
193-
theta = np.linspace(0, 2 * np.pi, 150)
191+
192+
xo, yo= (.5, .5)
194193
radius = 0.4
195-
fig_test.plot(radius * np.cos(theta), radius * np.sin(theta), color='r')
194+
195+
ax_test = fig_test.subplots()
196+
theta = np.linspace(0, 2 * np.pi, 150)
197+
l, = ax_test.plot(xo + (radius * np.cos(theta)),
198+
yo + (radius * np.sin(theta)), c='r')
199+
200+
ax_ref = fig_ref.subplots()
201+
red_circle_ref = mpatches.Circle((xo, yo), radius, ec='r', fc='none',
202+
lw=l.get_linewidth())
203+
ax_ref.add_artist(red_circle_ref)
204+
205+
for ax in [ax_ref, ax_test]:
206+
ax.set(xlim=(0,1), ylim=(0,1), aspect='equal')
196207

197208
Both comparison decorators have a tolerance argument ``tol`` that is used to specify the
198209
tolerance for difference in color value between the two images, where 255 is the maximal

doc/install/dependencies.rst

+7-8
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,13 @@ Build dependencies
222222
Python
223223
------
224224

225-
By default, ``pip`` will build packages using build isolation, meaning that these
226-
build dependencies are temporally installed by pip for the duration of the
227-
Matplotlib build process. However, build isolation is disabled when :ref:`installing Matplotlib for development <development-install>`;
228-
therefore we recommend using one of our :ref:`virtual environment configurations <dev-environment>` to
229-
create a development environment in which these packages are automatically installed.
230-
231-
If you are developing Matplotlib and unable to use our environment configurations,
232-
then you must manually install the following packages into your development environment:
225+
``pip`` normally builds packages using :external+pip:doc:`build isolation <reference/build-system/pyproject-toml>`,
226+
which means that ``pip`` installs the dependencies listed here for the
227+
duration of the build process. However, build isolation is disabled via the the
228+
:external+pip:ref:`--no-build-isolation <install_--no-build-isolation>` flag
229+
when :ref:`installing Matplotlib for development <development-install>`, which
230+
means that the dependencies must be explicitly installed, either by :ref:`creating a virtual environment <dev-environment>`
231+
(recommended) or by manually installing the following packages:
233232

234233
- `meson-python <https://meson-python.readthedocs.io/>`_ (>= 0.13.1).
235234
- `ninja <https://ninja-build.org/>`_ (>= 1.8.2). This may be available in your package

doc/sphinxext/custom_roles.py

-89
This file was deleted.

0 commit comments

Comments
 (0)