Skip to content

Commit 937575c

Browse files
authored
Merge pull request matplotlib#31740 from rcomer/bump-python
MNT: bump minimum python to 3.12 and minimum numpy to 2.0
2 parents f4cf125 + a0a92b1 commit 937575c

37 files changed

Lines changed: 102 additions & 220 deletions

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ environment:
2828
--cov-report= --cov=lib --log-level=DEBUG
2929

3030
matrix:
31-
- PYTHON_VERSION: "3.11"
31+
- PYTHON_VERSION: "3.12"
3232

3333
# We always use a 64-bit machine, but can build x86 distributions
3434
# with the PYTHON_ARCH variable

.github/workflows/cibuildwheel.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5151
name: Install Python
5252
with:
53-
python-version: '3.11'
53+
python-version: '3.12'
5454

5555
# Something changed somewhere that prevents the downloaded-at-build-time
5656
# licenses from being included in built wheels, so pre-download them so
@@ -176,24 +176,6 @@ jobs:
176176
CIBW_BUILD: "cp312-*"
177177
CIBW_ARCHS: ${{ matrix.cibw_archs }}
178178

179-
- name: Build wheels for CPython 3.11
180-
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
181-
with:
182-
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
183-
env:
184-
CIBW_BUILD: "cp311-*"
185-
CIBW_ARCHS: ${{ matrix.cibw_archs }}
186-
187-
- name: Build wheels for PyPy
188-
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
189-
with:
190-
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
191-
env:
192-
CIBW_BUILD: "pp311-*"
193-
CIBW_ARCHS: ${{ matrix.cibw_archs }}
194-
CIBW_ENABLE: pypy
195-
if: matrix.cibw_archs != 'aarch64' && matrix.os != 'windows-latest' && matrix.os != 'windows-11-arm'
196-
197179
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
198180
with:
199181
name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }}

.github/workflows/cygwin.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,6 @@ jobs:
186186
python -c 'import PyQt5.QtCore' &&
187187
echo 'PyQt5 is available' ||
188188
echo 'PyQt5 is not available'
189-
python -mpip install --upgrade pyside2 &&
190-
python -c 'import PySide2.QtCore' &&
191-
echo 'PySide2 is available' ||
192-
echo 'PySide2 is not available'
193189
python -m pip uninstall --yes wxpython || echo 'wxPython already uninstalled'
194190
195191
- name: Install Matplotlib

.github/workflows/linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Python 3
3737
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3838
with:
39-
python-version: '3.11'
39+
python-version: '3.12'
4040

4141
- name: Install ruff
4242
run: pip3 install ruff
@@ -66,7 +66,7 @@ jobs:
6666
- name: Set up Python 3
6767
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
6868
with:
69-
python-version: '3.11'
69+
python-version: '3.12'
7070

7171
- name: Install mypy
7272
run: pip3 install --group build --group typing

.github/workflows/mypy-stubtest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python 3
2020
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2121
with:
22-
python-version: '3.11'
22+
python-version: '3.12'
2323

2424
- name: Set up reviewdog
2525
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
set -o pipefail
3535
tox -e stubtest | \
36-
sed -e "s!.tox/stubtest/lib/python3.11/site-packages!lib!g" | \
36+
sed -e "s!.tox/stubtest/lib/python3.12/site-packages!lib!g" | \
3737
reviewdog \
3838
-efm '%Eerror: %m' \
3939
-efm '%CStub: in file %f:%l' \

.github/workflows/tests.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151
include:
5252
- name-suffix: "(Minimum Versions)"
5353
os: ubuntu-22.04
54-
python-version: '3.11'
54+
python-version: '3.12'
5555
extra-requirements: '-c ci/minver-requirements.txt'
5656
delete-font-cache: true
5757
# https://github.com/matplotlib/matplotlib/issues/29844
5858
pygobject-ver: '<3.52.0'
5959
- os: ubuntu-22.04
60-
python-version: '3.11'
60+
python-version: '3.12'
6161
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
6262
extra-requirements: '--group test-extra'
6363
# https://github.com/matplotlib/matplotlib/issues/29844
@@ -73,16 +73,10 @@ jobs:
7373
python-version: '3.13t'
7474
# https://github.com/matplotlib/matplotlib/issues/29844
7575
pygobject-ver: '<3.52.0'
76-
- os: ubuntu-24.04
77-
python-version: '3.12'
7876
- os: ubuntu-24.04
7977
python-version: '3.14'
8078
- os: ubuntu-24.04-arm
8179
python-version: '3.12'
82-
- os: macos-14 # This runner is on M1 (arm64) chips.
83-
python-version: '3.11'
84-
# https://github.com/matplotlib/matplotlib/issues/29732
85-
pygobject-ver: '<3.52.0'
8680
- os: macos-14 # This runner is on M1 (arm64) chips.
8781
python-version: '3.12'
8882
# https://github.com/matplotlib/matplotlib/issues/29732
@@ -267,16 +261,6 @@ jobs:
267261
echo 'PyQt5 is available' ||
268262
echo 'PyQt5 is not available'
269263
fi
270-
# Even though PySide2 wheels can be installed on Python 3.12+, they are broken and since PySide2 is
271-
# deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels
272-
# on M1 macOS, so don't bother there either.
273-
if [[ "${{ matrix.os }}" != 'macos-14' && "${{ matrix.python-version }}" == '3.11'
274-
]]; then
275-
python -mpip install --upgrade pyside2 &&
276-
python -c 'import PySide2.QtCore' &&
277-
echo 'PySide2 is available' ||
278-
echo 'PySide2 is not available'
279-
fi
280264
python -mpip install --upgrade --only-binary :all: pyqt6 &&
281265
python -c 'import PyQt6.QtCore' &&
282266
echo 'PyQt6 is available' ||

azure-pipelines.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ stages:
4949
- job: Pytest
5050
strategy:
5151
matrix:
52-
Windows_py311:
53-
vmImage: 'windows-2022' # Keep one job pinned to the oldest image
54-
python.version: '3.11'
5552
Windows_py312:
56-
vmImage: 'windows-latest'
53+
vmImage: 'windows-2022' # Keep one job pinned to the oldest image
5754
python.version: '3.12'
5855
Windows_py313:
5956
vmImage: 'windows-latest'

ci/minver-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Extra pip requirements for the minimum-version CI run
22

3-
contourpy==1.0.1
3+
contourpy==1.2.1
44
cycler==0.10
55
fonttools==4.22.0
66
importlib-resources==3.2.0
77
kiwisolver==1.3.2
88
meson-python==0.13.2
99
meson==1.1.0
10-
numpy==1.25.0
10+
numpy==2.0.0
1111
packaging==20.0
1212
pillow==9.0.1
1313
pyparsing==3.0.0

doc/api/backend_qt_api.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ a dependency to building the docs.
2222
Qt Bindings
2323
-----------
2424

25-
There are currently 2 actively supported Qt versions, Qt5 and Qt6, and two
26-
supported Python bindings per version -- `PyQt5
27-
<https://www.riverbankcomputing.com/static/Docs/PyQt5/>`_ and `PySide2
28-
<https://doc.qt.io/qtforpython-5/contents.html>`_ for Qt5 and `PyQt6
25+
There are currently 2 actively supported Qt versions, Qt5 and Qt6. `PyQt5
26+
<https://www.riverbankcomputing.com/static/Docs/PyQt5/>`_ is the supported
27+
Python binding for Qt5 and there are both `PyQt6
2928
<https://www.riverbankcomputing.com/static/Docs/PyQt6/>`_ and `PySide6
3029
<https://doc.qt.io/qtforpython/contents.html>`_ for Qt6 [#]_. Matplotlib's
3130
qtagg and qtcairo backends (``matplotlib.backends.backend_qtagg`` and
@@ -35,13 +34,12 @@ parts factored out in the ``matplotlib.backends.backend_qt`` module.
3534
At runtime, these backends select the actual binding used as follows:
3635

3736
1. If a binding's ``QtCore`` subpackage is already imported, that binding is
38-
selected (the order for the check is ``PyQt6``, ``PySide6``, ``PyQt5``,
39-
``PySide2``).
37+
selected (the order for the check is ``PyQt6``, ``PySide6``, ``PyQt5``).
4038
2. If the :envvar:`QT_API` environment variable is set to one of "PyQt6",
41-
"PySide6", "PyQt5", "PySide2" (case-insensitive), that binding is selected.
39+
"PySide6", "PyQt5" (case-insensitive), that binding is selected.
4240
(See also the documentation on :ref:`environment-variables`.)
4341
3. Otherwise, the first available backend in the order ``PyQt6``, ``PySide6``,
44-
``PyQt5``, ``PySide2`` is selected.
42+
``PyQt5`` is selected.
4543

4644
In the past, Matplotlib used to have separate backends for each version of Qt
4745
(e.g. qt4agg/``matplotlib.backends.backend_qt4agg`` and
@@ -62,8 +60,9 @@ change without warning [#]_.
6260

6361
.. [#] There is also `PyQt4
6462
<https://www.riverbankcomputing.com/static/Docs/PyQt4/>`_ and `PySide
65-
<https://srinikom.github.io/pyside-docs/>`_ for Qt4 but these are no
66-
longer supported by Matplotlib and upstream support for Qt4 ended
63+
<https://srinikom.github.io/pyside-docs/>`_ for Qt4 and `PySide2
64+
<https://doc.qt.io/qtforpython-5/contents.html>`_ for Qt5 but these are
65+
no longer supported by Matplotlib. Upstream support for Qt4 ended
6766
in 2015.
6867
.. [#] Despite the slight API differences, the more important distinction
6968
between the PyQt and Qt for Python series of bindings is licensing.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Increase to minimum supported versions of dependencies
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
For Matplotlib 3.12, the :ref:`minimum supported versions <dependencies>` are being
5+
bumped:
6+
7+
+-------------+-----------------+----------------+
8+
| Dependency | min in mpl3.11 | min in mpl3.12 |
9+
+=============+=================+================+
10+
| Python | 3.11 | 3.12 |
11+
+-------------+-----------------+----------------+
12+
| NumPy | 1.25 | 2.0.0 |
13+
+-------------+-----------------+----------------+
14+
| Contourpy | 1.0.1 | 1.2.1 |
15+
+-------------+-----------------+----------------+
16+
17+
This is consistent with our :ref:`min_deps_policy` and `SPEC0
18+
<https://scientific-python.org/specs/spec-0000/>`__
19+
20+
21+
PySide2 support
22+
~~~~~~~~~~~~~~~
23+
24+
Support for the `PySide2 <https://doc.qt.io/qtforpython-5/contents.html>`_ Qt5 Python
25+
binding has been dropped because PySide2 does not support Python 3.12+.

0 commit comments

Comments
 (0)