Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

API: bump minimum supported version of Python and numpy #29904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions 13 .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
name: Install Python
with:
python-version: '3.10'
python-version: '3.11'

# Something changed somewhere that prevents the downloaded-at-build-time
# licenses from being included in built wheels, so pre-download them so
Expand Down Expand Up @@ -163,22 +163,17 @@ jobs:
CIBW_BUILD: "cp311-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for CPython 3.10
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp310-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for PyPy
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "pp310-*"
CIBW_BUILD: "pp311-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_ENABLE: pypy
# No wheels available for Pillow with pp311 yet.
CIBW_TEST_SKIP: "pp311*"
if: matrix.cibw_archs != 'aarch64' && matrix.os != 'windows-latest'

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
4 changes: 2 additions & 2 deletions 4 .github/workflows/mypy-stubtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.10'
python-version: '3.11'

- name: Set up reviewdog
uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v1.3.9
Expand All @@ -33,7 +33,7 @@ jobs:
run: |
set -o pipefail
tox -e stubtest | \
sed -e "s!.tox/stubtest/lib/python3.10/site-packages!lib!g" | \
sed -e "s!.tox/stubtest/lib/python3.11/site-packages!lib!g" | \
reviewdog \
-efm '%Eerror: %m' \
-efm '%CStub: in file %f:%l' \
Expand Down
4 changes: 2 additions & 2 deletions 4 .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.10'
python-version: '3.11'

- name: Install ruff
run: pip3 install ruff
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.10'
python-version: '3.11'

- name: Install mypy
run: pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt
Expand Down
2 changes: 1 addition & 1 deletion 2 .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
python-version: '3.12'
- os: macos-13 # This runner is on Intel chips.
# merge numpy and pandas install in nighties test when this runner is dropped
python-version: '3.10'
python-version: '3.11'
- os: macos-14 # This runner is on M1 (arm64) chips.
python-version: '3.12'
# https://github.com/matplotlib/matplotlib/issues/29732
Expand Down
5 changes: 1 addition & 4 deletions 5 azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ stages:
- job: Pytest
strategy:
matrix:
Windows_py310:
vmImage: 'windows-2019' # keep one job pinned to the oldest image
python.version: '3.10'
Windows_py311:
vmImage: 'windows-latest'
vmImage: 'windows-2019' # keep one job pinned to the oldest image
python.version: '3.11'
Windows_py312:
vmImage: 'windows-latest'
Expand Down
16 changes: 16 additions & 0 deletions 16 doc/api/next_api_changes/deprecations/29904-tac.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Increase to minimum supported versions of dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For Matplotlib 3.11, the :ref:`minimum supported versions <dependencies>` are
being bumped:

+------------+-----------------+----------------+
| Dependency | min in mpl3.10 | min in mpl3.11 |
+============+=================+================+
| Python | 3.10 | 3.11 |
| NumPy | 1.23 | 1.25 |
+------------+-----------------+----------------+

This is consistent with our :ref:`min_deps_policy` and `SPEC0
<https://scientific-python.org/specs/spec-0000/>`__
48 changes: 48 additions & 0 deletions 48 doc/devel/min_dep_policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ specification of the dependencies.
========== ======== ======
Matplotlib Python NumPy
========== ======== ======
3.11 3.11 1.25.0
`3.10`_ 3.10 1.23.0
`3.9`_ 3.9 1.23.0
`3.8`_ 3.9 1.21.0
Expand Down Expand Up @@ -154,3 +155,50 @@ Matplotlib Python NumPy
.. _`1.5`: https://matplotlib.org/1.5.0/users/installing.html#required-dependencies
.. _`1.4`: https://matplotlib.org/1.4.0/users/installing.html#required-dependencies
.. _`1.3`: https://matplotlib.org/1.3.0/users/installing.html#build-requirements


Updating Python and NumPy versions
==================================

To update the minimum versions of Python we need to update:

- ``pyproject.toml`` (classifiers, requires-python, ``[tool.ruff]`` target-version)
- ``environment.yml``
QuLogic marked this conversation as resolved.
Show resolved Hide resolved
- ``doc/install/dependencies.rst``
- ``doc/devel/min_dep_policy.rst`` (this file)
- CI configuration files (circle, GHA, azure)
- ``tox.ini``

To update the minimum NumPy we need to update:

- ``pyproject.toml``
- ``environment.yml``
- ``doc/install/dependencies.rst``
- ``doc/devel/min_dep_policy.rst`` (this file)
- ``requirements/testing/minver.txt``
QuLogic marked this conversation as resolved.
Show resolved Hide resolved
- ``lib/matplotlib/__init__.py`` (matplotlib._check_versions())

tacaswell marked this conversation as resolved.
Show resolved Hide resolved

The work to leverage new features or remove workarounds for no-longer supported
versions should be done in a follow-on PRs to keep the version bump PRs well
scoped.

In both cases add an api_changes/development with the following template:

.. code-block:: rst

Increase to minimum supported versions of dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For Matplotlib 3.ZZ, the :ref:`minimum supported versions <dependencies>` are
being bumped:

+------------+-----------------+----------------+
| Dependency | min in mpl3.N | min in mpl3.M |
+============+=================+================+
| Python | 3.XX | 3.AA |
| NumPy | 1.YY | 1.BB |
+------------+-----------------+----------------+

This is consistent with our :ref:`min_deps_policy` and `SPEC0
<https://scientific-python.org/specs/spec-0000/>`__
4 changes: 2 additions & 2 deletions 4 doc/install/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ When installing through a package manager like ``pip`` or ``conda``, the
mandatory dependencies are automatically installed. This list is mainly for
reference.

* `Python <https://www.python.org/downloads/>`_ (>= 3.10)
* `Python <https://www.python.org/downloads/>`_ (>= 3.11)
* `contourpy <https://pypi.org/project/contourpy/>`_ (>= 1.0.1)
* `cycler <https://matplotlib.org/cycler/>`_ (>= 0.10.0)
* `dateutil <https://pypi.org/project/python-dateutil/>`_ (>= 2.7)
* `fontTools <https://fonttools.readthedocs.io/en/latest/>`_ (>= 4.22.0)
* `kiwisolver <https://github.com/nucleic/kiwi>`_ (>= 1.3.1)
* `NumPy <https://numpy.org>`_ (>= 1.23)
* `NumPy <https://numpy.org>`_ (>= 1.25)
* `packaging <https://pypi.org/project/packaging/>`_ (>= 20.0)
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 9.0)
* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 3)
Expand Down
4 changes: 2 additions & 2 deletions 4 environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ dependencies:
- kiwisolver>=1.3.1
- pybind11>=2.13.2
- meson-python>=0.13.1
- numpy
- numpy>=1.25
- pillow>=9
- pkg-config
- pygobject
- pyparsing>=3
- pyqt
- python>=3.10
- python>=3.11
- python-dateutil>=2.1
- setuptools_scm
- wxpython
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _check_versions():
("cycler", "0.10"),
("dateutil", "2.7"),
("kiwisolver", "1.3.1"),
("numpy", "1.23"),
("numpy", "1.25"),
("pyparsing", "2.3.1"),
]:
module = importlib.import_module(modname)
Expand Down
7 changes: 3 additions & 4 deletions 7 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers=[
"License :: OSI Approved :: Python Software Foundation License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand All @@ -35,13 +34,13 @@ dependencies = [
"cycler >= 0.10",
"fonttools >= 4.22.0",
"kiwisolver >= 1.3.1",
"numpy >= 1.23",
"numpy >= 1.25",
"packaging >= 20.0",
"pillow >= 9",
"pyparsing >= 3",
"python-dateutil >= 2.7",
]
requires-python = ">=3.10"
requires-python = ">=3.11"

[project.optional-dependencies]
# Should be a copy of the build dependencies below.
Expand Down Expand Up @@ -105,7 +104,7 @@ exclude = [
"*.ipynb"
]
line-length = 88
target-version = "py310"
target-version = "py311"

[tool.ruff.lint]
ignore = [
Expand Down
2 changes: 1 addition & 1 deletion 2 requirements/testing/extra.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Extra pip requirements for the Python 3.10+ builds
# Extra pip requirements

--prefer-binary
ipykernel
Expand Down
2 changes: 1 addition & 1 deletion 2 requirements/testing/minver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ importlib-resources==3.2.0
kiwisolver==1.3.2
meson-python==0.13.1
meson==1.1.0
numpy==1.23.0
numpy==1.25.0
packaging==20.0
pillow==9.0.1
pyparsing==3.0.0
Expand Down
2 changes: 1 addition & 1 deletion 2 tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py310, py311, py312, stubtest
envlist = py311, py312, py313, stubtest

[testenv]
changedir = /tmp
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.