Skip to content

Commit 8540c9e

Browse files
committed
MNT: bump minimum python to 3.12
1 parent 39c556c commit 8540c9e

14 files changed

Lines changed: 29 additions & 95 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: 2 additions & 10 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,20 +176,12 @@ 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-
187179
- name: Build wheels for PyPy
188180
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
189181
with:
190182
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
191183
env:
192-
CIBW_BUILD: "pp311-*"
184+
CIBW_BUILD: "pp312-*"
193185
CIBW_ARCHS: ${{ matrix.cibw_archs }}
194186
CIBW_ENABLE: pypy
195187
if: matrix.cibw_archs != 'aarch64' && matrix.os != 'windows-latest' && matrix.os != 'windows-11-arm'

‎.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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ 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'
6057
python.version: '3.13'
58+
Windows_py314:
59+
vmImage: 'windows-latest'
60+
python.version: '3.14'
6161
maxParallel: 4
6262
pool:
6363
vmImage: '$(vmImage)'

‎doc/devel/min_dep_policy.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ specification of the dependencies.
115115
========== ======== ======
116116
Matplotlib Python NumPy
117117
========== ======== ======
118+
3.12 3.12 1.25.0
118119
3.11 3.11 1.25.0
119120
`3.10`_ 3.10 1.23.0
120121
`3.9`_ 3.9 1.23.0

‎doc/install/dependencies.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ When installing through a package manager like ``pip`` or ``conda``, the
2020
mandatory dependencies are automatically installed. This list is mainly for
2121
reference.
2222

23-
* `Python <https://www.python.org/downloads/>`_ (>= 3.11)
23+
* `Python <https://www.python.org/downloads/>`_ (>= 3.12)
2424
* `contourpy <https://pypi.org/project/contourpy/>`_ (>= 1.0.1)
2525
* `cycler <https://matplotlib.org/cycler/>`_ (>= 0.10.0)
2626
* `dateutil <https://pypi.org/project/python-dateutil/>`_ (>= 2.7)

‎environment.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- pygobject
2727
- pyparsing>=3
2828
- pyqt
29-
- python>=3.11
29+
- python>=3.12
3030
- python-dateutil>=2.1
3131
- setuptools_scm<10
3232
- wxpython

‎lib/matplotlib/_api/__init__.py‎

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import functools
1515
import itertools
1616
import pathlib
17-
import re
18-
import sys
1917
import warnings
2018

2119
from .deprecation import ( # noqa: F401
@@ -470,25 +468,9 @@ def warn_external(message, category=None):
470468
warnings.warn`` (or ``functools.partial(warnings.warn, stacklevel=2)``,
471469
etc.).
472470
"""
473-
kwargs = {}
474-
if sys.version_info[:2] >= (3, 12):
475-
# Go to Python's `site-packages` or `lib` from an editable install.
476-
basedir = pathlib.Path(__file__).parents[2]
477-
kwargs['skip_file_prefixes'] = (str(basedir / 'matplotlib'),
478-
str(basedir / 'mpl_toolkits'))
479-
else:
480-
frame = sys._getframe()
481-
for stacklevel in itertools.count(1):
482-
if frame is None:
483-
# when called in embedded context may hit frame is None
484-
kwargs['stacklevel'] = stacklevel
485-
break
486-
if not re.match(r"\A(matplotlib|mpl_toolkits)(\Z|\.(?!tests\.))",
487-
# Work around sphinx-gallery not setting __name__.
488-
frame.f_globals.get("__name__", "")):
489-
kwargs['stacklevel'] = stacklevel
490-
break
491-
frame = frame.f_back
492-
# preemptively break reference cycle between locals and the frame
493-
del frame
494-
warnings.warn(message, category, **kwargs)
471+
# Go to Python's `site-packages` or `lib` from an editable install.
472+
basedir = pathlib.Path(__file__).parents[2]
473+
skip_file_prefixes = (str(basedir / 'matplotlib'),
474+
str(basedir / 'mpl_toolkits'))
475+
476+
warnings.warn(message, category, skip_file_prefixes=skip_file_prefixes)

‎lib/matplotlib/tests/test_backends_interactive.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,6 @@ def _test_thread_impl():
326326
reason='PyPy does not support Tkinter threading: '
327327
'https://foss.heptapod.net/pypy/pypy/-/issues/1929',
328328
strict=True))
329-
elif (backend == 'tkagg' and
330-
('TF_BUILD' in os.environ or 'GITHUB_ACTION' in os.environ) and
331-
sys.platform == 'darwin' and sys.version_info[:2] < (3, 11)):
332-
param.marks.append( # https://github.com/actions/setup-python/issues/649
333-
pytest.mark.xfail('Tk version mismatch on Azure macOS CI'))
334329

335330

336331
@pytest.mark.parametrize("env", _thread_safe_backends)
@@ -610,14 +605,6 @@ def _test_number_of_draws_script():
610605
elif backend == "wx":
611606
param.marks.append(
612607
pytest.mark.skip("wx does not support blitting"))
613-
elif (backend == 'tkagg' and
614-
('TF_BUILD' in os.environ or 'GITHUB_ACTION' in os.environ) and
615-
sys.platform == 'darwin' and
616-
sys.version_info[:2] < (3, 11)
617-
):
618-
param.marks.append( # https://github.com/actions/setup-python/issues/649
619-
pytest.mark.xfail('Tk version mismatch on Azure macOS CI')
620-
)
621608

622609

623610
@pytest.mark.parametrize("env", _blit_backends)

0 commit comments

Comments
 (0)