Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28d28bb

Browse files
committed
Bump minimum Python to 3.10
1 parent 651e910 commit 28d28bb

File tree

25 files changed

+54
-120
lines changed

25 files changed

+54
-120
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ commands:
216216
#
217217

218218
jobs:
219-
docs-python39:
219+
docs-python310:
220220
docker:
221-
- image: cimg/python:3.9
221+
- image: cimg/python:3.10
222222
resource_class: large
223223
steps:
224224
- checkout
@@ -259,4 +259,4 @@ workflows:
259259
jobs:
260260
# NOTE: If you rename this job, then you must update the `if` condition
261261
# and `circleci-jobs` option in `.github/workflows/circleci.yml`.
262-
- docs-python39
262+
- docs-python310

.github/workflows/cibuildwheel.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- uses: actions/setup-python@v5
4747
name: Install Python
4848
with:
49-
python-version: 3.9
49+
python-version: '3.10'
5050

5151
# Something changed somewhere that prevents the downloaded-at-build-time
5252
# licenses from being included in built wheels, so pre-download them so
@@ -158,14 +158,6 @@ jobs:
158158
CIBW_BUILD: "cp310-*"
159159
CIBW_ARCHS: ${{ matrix.cibw_archs }}
160160

161-
- name: Build wheels for CPython 3.9
162-
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
163-
with:
164-
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
165-
env:
166-
CIBW_BUILD: "cp39-*"
167-
CIBW_ARCHS: ${{ matrix.cibw_archs }}
168-
169161
- name: Build wheels for PyPy
170162
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
171163
with:

.github/workflows/circleci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "CircleCI artifact handling"
33
on: [status]
44
jobs:
55
circleci_artifacts_redirector_job:
6-
if: "${{ github.event.context == 'ci/circleci: docs-python39' }}"
6+
if: "${{ github.event.context == 'ci/circleci: docs-python310' }}"
77
permissions:
88
statuses: write
99
runs-on: ubuntu-latest
@@ -16,11 +16,11 @@ jobs:
1616
repo-token: ${{ secrets.GITHUB_TOKEN }}
1717
api-token: ${{ secrets.CIRCLECI_TOKEN }}
1818
artifact-path: 0/doc/build/html/index.html
19-
circleci-jobs: docs-python39
19+
circleci-jobs: docs-python310
2020
job-title: View the built docs
2121

2222
post_warnings_as_review:
23-
if: "${{ github.event.context == 'ci/circleci: docs-python39' }}"
23+
if: "${{ github.event.context == 'ci/circleci: docs-python310' }}"
2424
permissions:
2525
contents: read
2626
checks: write

.github/workflows/mypy-stubtest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python 3
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: 3.9
19+
python-version: '3.10'
2020

2121
- name: Set up reviewdog
2222
uses: reviewdog/action-setup@v1
@@ -30,7 +30,7 @@ jobs:
3030
run: |
3131
set -o pipefail
3232
tox -e stubtest | \
33-
sed -e "s!.tox/stubtest/lib/python3.9/site-packages!lib!g" | \
33+
sed -e "s!.tox/stubtest/lib/python3.10/site-packages!lib!g" | \
3434
reviewdog \
3535
-efm '%Eerror: %m' \
3636
-efm '%CStub: in file %f:%l' \

.github/workflows/reviewdog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python 3
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.9
20+
python-version: '3.10'
2121

2222
- name: Install flake8
2323
run: pip3 install -r requirements/testing/flake8.txt
@@ -42,7 +42,7 @@ jobs:
4242
- name: Set up Python 3
4343
uses: actions/setup-python@v5
4444
with:
45-
python-version: 3.9
45+
python-version: '3.10'
4646

4747
- name: Install mypy
4848
run: pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt

.github/workflows/tests.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ jobs:
5050
include:
5151
- name-suffix: "(Minimum Versions)"
5252
os: ubuntu-20.04
53-
python-version: 3.9
53+
python-version: '3.10'
5454
extra-requirements: '-c requirements/testing/minver.txt'
55-
pyqt5-ver: '==5.12.2 sip==5.0.0' # oldest versions with a Py3.9 wheel.
56-
pyqt6-ver: '==6.1.0 PyQt6-Qt6==6.1.0'
57-
pyside2-ver: '==5.15.1' # oldest version with working Py3.9 wheel.
55+
pyqt5-ver: '==5.15.5 sip==6.3.0' # oldest versions with a Py3.10 wheel.
56+
pyqt6-ver: '==6.2.0 PyQt6-Qt6==6.2.0'
57+
pyside2-ver: '==5.15.2.1' # oldest version with working Py3.10 wheel.
5858
pyside6-ver: '==6.0.0'
5959
delete-font-cache: true
6060
- os: ubuntu-20.04
61-
python-version: 3.9
61+
python-version: '3.10'
6262
# One CI run tests ipython/matplotlib-inline before backend mapping moved to mpl
6363
extra-requirements: '-r requirements/testing/extra.txt "ipython==7.19" "matplotlib-inline<0.1.7"'
6464
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
@@ -67,14 +67,6 @@ jobs:
6767
pyqt6-ver: '!=6.5.1,!=6.6.0'
6868
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
6969
pyside6-ver: '!=6.5.1'
70-
- os: ubuntu-20.04
71-
python-version: '3.10'
72-
extra-requirements: '-r requirements/testing/extra.txt'
73-
# https://github.com/matplotlib/matplotlib/pull/26052#issuecomment-1574595954
74-
# https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html
75-
pyqt6-ver: '!=6.5.1,!=6.6.0'
76-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
77-
pyside6-ver: '!=6.5.1'
7870
- os: ubuntu-22.04
7971
python-version: '3.11'
8072
# https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html
@@ -88,8 +80,8 @@ jobs:
8880
pyqt6-ver: '!=6.6.0'
8981
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
9082
pyside6-ver: '!=6.5.1'
91-
- os: macos-12 # This runnre is on Intel chips.
92-
python-version: 3.9
83+
- os: macos-12 # This runner is on Intel chips.
84+
python-version: '3.10'
9385
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
9486
pyside6-ver: '!=6.5.1'
9587
- os: macos-14 # This runner is on M1 (arm64) chips.

azure-pipelines.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,20 @@ stages:
4949
- job: Pytest
5050
strategy:
5151
matrix:
52-
Linux_py39:
53-
vmImage: 'ubuntu-20.04' # keep one job pinned to the oldest image
54-
python.version: '3.9'
5552
Linux_py310:
56-
vmImage: 'ubuntu-latest'
53+
vmImage: 'ubuntu-20.04' # keep one job pinned to the oldest image
5754
python.version: '3.10'
5855
Linux_py311:
5956
vmImage: 'ubuntu-latest'
6057
python.version: '3.11'
61-
macOS_py39:
62-
vmImage: 'macOS-latest'
63-
python.version: '3.9'
6458
macOS_py310:
6559
vmImage: 'macOS-latest'
6660
python.version: '3.10'
6761
macOS_py311:
6862
vmImage: 'macOS-latest'
6963
python.version: '3.11'
70-
Windows_py39:
71-
vmImage: 'windows-2019' # keep one job pinned to the oldest image
72-
python.version: '3.9'
7364
Windows_py310:
74-
vmImage: 'windows-latest'
65+
vmImage: 'windows-2019' # keep one job pinned to the oldest image
7566
python.version: '3.10'
7667
Windows_py311:
7768
vmImage: 'windows-latest'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Increase to minimum supported versions of dependencies
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
For Matplotlib 3.10, the :ref:`minimum supported versions <dependencies>` are
5+
being bumped:
6+
7+
+------------+-----------------+----------------+
8+
| Dependency | min in mpl3.9 | min in mpl3.10 |
9+
+============+=================+================+
10+
| Python | 3.9 | 3.10 |
11+
+------------+-----------------+----------------+
12+
13+
This is consistent with our :ref:`min_deps_policy` and `SPEC0
14+
<https://scientific-python.org/specs/spec-0000/>`__

doc/install/dependencies.rst

Lines changed: 1 addition & 3 deletions
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.9)
23+
* `Python <https://www.python.org/downloads/>`_ (>= 3.10)
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)
@@ -30,8 +30,6 @@ reference.
3030
* `packaging <https://pypi.org/project/packaging/>`_ (>= 20.0)
3131
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 8.0)
3232
* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)
33-
* `importlib-resources <https://pypi.org/project/importlib-resources/>`_
34-
(>= 3.2.0; only required on Python < 3.10)
3533

3634

3735
.. _optional_dependencies:

doc/install/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ at the Terminal.app command line::
267267

268268
You should see something like ::
269269

270-
3.6.0 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/__init__.py
270+
3.10.0 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/__init__.py
271271

272-
where ``3.6.0`` is the Matplotlib version you just installed, and the path
272+
where ``3.10.0`` is the Matplotlib version you just installed, and the path
273273
following depends on whether you are using Python.org Python, Homebrew or
274274
Macports. If you see another version, or you get an error like ::
275275

galleries/users_explain/customizing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def plotting_function():
234234
#
235235
# 4. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where
236236
# :file:`{INSTALL}` is something like
237-
# :file:`/usr/lib/python3.9/site-packages` on Linux, and maybe
238-
# :file:`C:\\Python39\\Lib\\site-packages` on Windows. Every time you
237+
# :file:`/usr/lib/python3.10/site-packages` on Linux, and maybe
238+
# :file:`C:\\Python310\\Lib\\site-packages` on Windows. Every time you
239239
# install matplotlib, this file will be overwritten, so if you want
240240
# your customizations to be saved, please move this file to your
241241
# user-specific matplotlib directory.

lib/matplotlib/_api/__init__.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ class classproperty(Any):
2525
fdel: None = ...,
2626
doc: str | None = None,
2727
): ...
28-
# Replace return with Self when py3.9 is dropped
2928
@overload
30-
def __get__(self, instance: None, owner: None) -> classproperty: ...
29+
def __get__(self, instance: None, owner: None) -> Self: ...
3130
@overload
3231
def __get__(self, instance: object, owner: type[object]) -> Any: ...
3332
@property

lib/matplotlib/_api/deprecation.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from collections.abc import Callable
22
import contextlib
3-
from typing import Any, TypedDict, TypeVar, overload
3+
from typing import Any, ParamSpec, TypedDict, TypeVar, overload
44
from typing_extensions import (
5-
ParamSpec, # < Py 3.10
65
Unpack, # < Py 3.11
76
)
87

lib/matplotlib/axis.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ class Ticker:
9393

9494
class _LazyTickList:
9595
def __init__(self, major: bool) -> None: ...
96-
# Replace return with Self when py3.9 is dropped
9796
@overload
98-
def __get__(self, instance: None, owner: None) -> _LazyTickList: ...
97+
def __get__(self, instance: None, owner: None) -> Self: ...
9998
@overload
10099
def __get__(self, instance: Axis, owner: type[Axis]) -> list[Tick]: ...
101100

lib/matplotlib/backends/registry.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,8 @@ def _read_entry_points(self):
132132
# [project.entry-points."matplotlib.backend"]
133133
# inline = "matplotlib_inline.backend_inline"
134134
import importlib.metadata as im
135-
import sys
136-
137-
# entry_points group keyword not available before Python 3.10
138-
group = "matplotlib.backend"
139-
if sys.version_info >= (3, 10):
140-
entry_points = im.entry_points(group=group)
141-
else:
142-
entry_points = im.entry_points().get(group, ())
135+
136+
entry_points = im.entry_points(group="matplotlib.backend")
143137
entries = [(entry.name, entry.value) for entry in entry_points]
144138

145139
# For backward compatibility, if matplotlib-inline and/or ipympl are installed

lib/matplotlib/dviread.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ class Dvi:
4747
fonts: dict[int, DviFont]
4848
state: _dvistate
4949
def __init__(self, filename: str | os.PathLike, dpi: float | None) -> None: ...
50-
# Replace return with Self when py3.9 is dropped
51-
def __enter__(self) -> Dvi: ...
50+
def __enter__(self) -> Self: ...
5251
def __exit__(self, etype, evalue, etrace) -> None: ...
5352
def __iter__(self) -> Generator[Page, None, None]: ...
5453
def close(self) -> None: ...
@@ -83,8 +82,7 @@ class PsFont(NamedTuple):
8382
filename: str
8483

8584
class PsfontsMap:
86-
# Replace return with Self when py3.9 is dropped
87-
def __new__(cls, filename: str | os.PathLike) -> PsfontsMap: ...
85+
def __new__(cls, filename: str | os.PathLike) -> Self: ...
8886
def __getitem__(self, texname: bytes) -> PsFont: ...
8987

9088
def find_tex_file(filename: str | os.PathLike) -> str: ...

lib/matplotlib/sankey.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,5 @@ class Sankey:
5656
connect: tuple[int, int] = ...,
5757
rotation: float = ...,
5858
**kwargs
59-
# Replace return with Self when py3.9 is dropped
60-
) -> Sankey: ...
59+
) -> Self: ...
6160
def finish(self) -> list[Any]: ...

lib/matplotlib/style/core.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,12 @@
1212
"""
1313

1414
import contextlib
15+
import importlib.resources
1516
import logging
1617
import os
1718
from pathlib import Path
18-
import sys
1919
import warnings
2020

21-
if sys.version_info >= (3, 10):
22-
import importlib.resources as importlib_resources
23-
else:
24-
# Even though Py3.9 has importlib.resources, it doesn't properly handle
25-
# modules added in sys.path.
26-
import importlib_resources
27-
2821
import matplotlib as mpl
2922
from matplotlib import _api, _docstring, _rc_params_in_file, rcParamsDefault
3023

@@ -121,8 +114,7 @@ def use(style):
121114
elif "." in style:
122115
pkg, _, name = style.rpartition(".")
123116
try:
124-
path = (importlib_resources.files(pkg)
125-
/ f"{name}.{STYLE_EXTENSION}")
117+
path = importlib.resources.files(pkg) / f"{name}.{STYLE_EXTENSION}"
126118
style = _rc_params_in_file(path)
127119
except (ModuleNotFoundError, OSError, TypeError) as exc:
128120
# There is an ambiguity whether a dotted name refers to a

lib/matplotlib/tests/test_backend_inline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
from pathlib import Path
33
from tempfile import TemporaryDirectory
4-
import sys
54

65
import pytest
76

@@ -13,7 +12,6 @@
1312
pytest.importorskip('matplotlib_inline')
1413

1514

16-
@pytest.mark.skipif(sys.version_info[:2] <= (3, 9), reason="Requires Python 3.10+")
1715
def test_ipynb():
1816
nb_path = Path(__file__).parent / 'test_inline_01.ipynb'
1917

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
import pytest
1111

1212

13-
pytest.importorskip('sphinx',
14-
minversion=None if sys.version_info < (3, 10) else '4.1.3')
13+
pytest.importorskip('sphinx', minversion='4.1.3')
1514

1615

1716
def build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ classifiers=[
1616
"License :: OSI Approved :: Python Software Foundation License",
1717
"Programming Language :: Python",
1818
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.9",
2019
"Programming Language :: Python :: 3.10",
2120
"Programming Language :: Python :: 3.11",
2221
"Programming Language :: Python :: 3.12",
@@ -40,9 +39,8 @@ dependencies = [
4039
"pillow >= 8",
4140
"pyparsing >= 2.3.1",
4241
"python-dateutil >= 2.7",
43-
"importlib-resources >= 3.2.0; python_version < '3.10'",
4442
]
45-
requires-python = ">=3.9"
43+
requires-python = ">=3.10"
4644

4745
[project.optional-dependencies]
4846
# Should be a copy of the build dependencies below.
@@ -160,7 +158,7 @@ external = [
160158
"E703",
161159
]
162160

163-
target-version = "py39"
161+
target-version = "py310"
164162

165163
[tool.ruff.pydocstyle]
166164
convention = "numpy"

0 commit comments

Comments
 (0)