From 905aab313ca66d716ab1bad3c7d4b061ef489ffb Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 10 Apr 2025 22:53:53 -0400 Subject: [PATCH 1/5] API: bump minimum supported version of Python In accordance with our policy, the minimum supported Python for the next release will be Python 3.11. Co-authored-by: David Stansby --- .github/workflows/cibuildwheel.yml | 13 ++++--------- .github/workflows/mypy-stubtest.yml | 4 ++-- .github/workflows/reviewdog.yml | 4 ++-- .github/workflows/tests.yml | 2 +- azure-pipelines.yml | 5 +---- doc/devel/min_dep_policy.rst | 1 + doc/install/dependencies.rst | 2 +- environment.yml | 2 +- pyproject.toml | 5 ++--- requirements/testing/extra.txt | 2 +- tox.ini | 2 +- 11 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 275807830d45..85ee8685cd66 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -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 @@ -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 diff --git a/.github/workflows/mypy-stubtest.yml b/.github/workflows/mypy-stubtest.yml index 51ea712f0176..43c444a405f5 100644 --- a/.github/workflows/mypy-stubtest.yml +++ b/.github/workflows/mypy-stubtest.yml @@ -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 @@ -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' \ diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index d8b30822966d..8a1300e26f6b 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c033d69b126..c144f335f3a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fff14a1819d6..cc0fbce11377 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index e9e18ed391dc..bd6de8212531 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -115,6 +115,7 @@ specification of the dependencies. ========== ======== ====== Matplotlib Python NumPy ========== ======== ====== +3.11 3.11 1.23.0 `3.10`_ 3.10 1.23.0 `3.9`_ 3.9 1.23.0 `3.8`_ 3.9 1.21.0 diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index e327a0b9c536..81aac78b5a40 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -20,7 +20,7 @@ When installing through a package manager like ``pip`` or ``conda``, the mandatory dependencies are automatically installed. This list is mainly for reference. -* `Python `_ (>= 3.10) +* `Python `_ (>= 3.11) * `contourpy `_ (>= 1.0.1) * `cycler `_ (>= 0.10.0) * `dateutil `_ (>= 2.7) diff --git a/environment.yml b/environment.yml index 0548793472e4..568ae604d144 100644 --- a/environment.yml +++ b/environment.yml @@ -26,7 +26,7 @@ dependencies: - pygobject - pyparsing>=3 - pyqt - - python>=3.10 + - python>=3.11 - python-dateutil>=2.1 - setuptools_scm - wxpython diff --git a/pyproject.toml b/pyproject.toml index 3e82040baf80..30d296d03e54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -41,7 +40,7 @@ dependencies = [ "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. @@ -105,7 +104,7 @@ exclude = [ "*.ipynb" ] line-length = 88 -target-version = "py310" +target-version = "py311" [tool.ruff.lint] ignore = [ diff --git a/requirements/testing/extra.txt b/requirements/testing/extra.txt index a5c1bef5f03a..5cc850d547f5 100644 --- a/requirements/testing/extra.txt +++ b/requirements/testing/extra.txt @@ -1,4 +1,4 @@ -# Extra pip requirements for the Python 3.10+ builds +# Extra pip requirements for the Python 3.11+ builds --prefer-binary ipykernel diff --git a/tox.ini b/tox.ini index 3e19b48b6ba7..1d527a19ff52 100644 --- a/tox.ini +++ b/tox.ini @@ -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 From 1d8d29efc4f85ac70e70b205029ff8ac3550f6c5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 11 Apr 2025 10:38:10 -0400 Subject: [PATCH 2/5] API: bump minimum numpy to 1.25 Co-authored-by: David Stansby --- doc/devel/min_dep_policy.rst | 2 +- doc/install/dependencies.rst | 2 +- environment.yml | 2 +- lib/matplotlib/__init__.py | 2 +- pyproject.toml | 2 +- requirements/testing/extra.txt | 2 +- requirements/testing/minver.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index bd6de8212531..d3d79911a969 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -115,7 +115,7 @@ specification of the dependencies. ========== ======== ====== Matplotlib Python NumPy ========== ======== ====== -3.11 3.11 1.23.0 +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 diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index 81aac78b5a40..2a68672a3be0 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -26,7 +26,7 @@ reference. * `dateutil `_ (>= 2.7) * `fontTools `_ (>= 4.22.0) * `kiwisolver `_ (>= 1.3.1) -* `NumPy `_ (>= 1.23) +* `NumPy `_ (>= 1.25) * `packaging `_ (>= 20.0) * `Pillow `_ (>= 9.0) * `pyparsing `_ (>= 3) diff --git a/environment.yml b/environment.yml index 568ae604d144..eaa6ed6386b6 100644 --- a/environment.yml +++ b/environment.yml @@ -20,7 +20,7 @@ dependencies: - kiwisolver>=1.3.1 - pybind11>=2.13.2 - meson-python>=0.13.1 - - numpy + - numpy>=1.25 - pillow>=9 - pkg-config - pygobject diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 20f93e05f6fd..ac71070e690a 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 30d296d03e54..59c3d2156184 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ 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", diff --git a/requirements/testing/extra.txt b/requirements/testing/extra.txt index 5cc850d547f5..e0d84d71c781 100644 --- a/requirements/testing/extra.txt +++ b/requirements/testing/extra.txt @@ -1,4 +1,4 @@ -# Extra pip requirements for the Python 3.11+ builds +# Extra pip requirements --prefer-binary ipykernel diff --git a/requirements/testing/minver.txt b/requirements/testing/minver.txt index 5f9a52afcee9..ee55f6c7b1bf 100644 --- a/requirements/testing/minver.txt +++ b/requirements/testing/minver.txt @@ -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 From dc4535451c122614475ff39d5e0613c7762f6312 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 17 Apr 2025 14:48:16 -0400 Subject: [PATCH 3/5] DOC: add API note for NumPy + Python version bumps --- .../next_api_changes/deprecations/29904-tac.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/api/next_api_changes/deprecations/29904-tac.rst diff --git a/doc/api/next_api_changes/deprecations/29904-tac.rst b/doc/api/next_api_changes/deprecations/29904-tac.rst new file mode 100644 index 000000000000..8e4f986ffa77 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/29904-tac.rst @@ -0,0 +1,16 @@ + +Increase to minimum supported versions of dependencies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For Matplotlib 3.11, the :ref:`minimum supported versions ` 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 +`__ From 4c435a69160d76adabe473f5c98dcc73b9c4a3a4 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 11 Apr 2025 10:58:59 -0400 Subject: [PATCH 4/5] DOC: document where to touch to bump numpy/Python version Co-authored-by: David Stansby Co-authored-by: Elliott Sales de Andrade --- doc/devel/min_dep_policy.rst | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index d3d79911a969..531654bce32a 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -155,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, ``[ruff.tool]`` target-version) +- ``environment.yml`` +- ``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`` +- ``lib/matplotlib/__init__.py`` (matplotlib._check_versions()) + + +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 ` 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 + `__ From d64596998b3f3279196077ce47f3b8b43d26a6c7 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 18 Apr 2025 10:40:18 -0400 Subject: [PATCH 5/5] DOC: typo in docs Co-authored-by: Elliott Sales de Andrade --- doc/devel/min_dep_policy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index 531654bce32a..81a84491bc4a 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -162,7 +162,7 @@ Updating Python and NumPy versions To update the minimum versions of Python we need to update: -- ``pyproject.toml`` (classifiers, requires-python, ``[ruff.tool]`` target-version) +- ``pyproject.toml`` (classifiers, requires-python, ``[tool.ruff]`` target-version) - ``environment.yml`` - ``doc/install/dependencies.rst`` - ``doc/devel/min_dep_policy.rst`` (this file)