Skip to content

Drop support for Python 3.7 #22194

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 4 commits into from
Feb 11, 2022
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
11 changes: 4 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ environment:
PINNEDVERS: "pyzmq!=21.0.0,!=22.0.0"

matrix:
# In theory we could use a single CONDA_INSTALL_LOCN because we construct
# the envs anyway. But using one for the right python version hopefully
# making things faster due to package caching.
- PYTHON_VERSION: "3.7"
CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64"
- PYTHON_VERSION: "3.8"
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
TEST_ALL: "no"
EXTRAREQS: "-r requirements/testing/extra.txt"
- PYTHON_VERSION: "3.8"
CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64"
- PYTHON_VERSION: "3.9"
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
TEST_ALL: "no"
EXTRAREQS: "-r requirements/testing/extra.txt"

Expand Down
37 changes: 9 additions & 28 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
min-numpy-version: "1.17.3"
min-numpy-hash: "b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe"
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
strategy:
matrix:
Expand All @@ -53,37 +51,20 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- uses: actions/cache@v2
id: numpy-cache
with:
path: numpy-aarch64-cache/
key: numpy-${{ matrix.cibw_archs }}-cache-${{ env.min-numpy-version }}
python-version: '3.8'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.1.1

- name: Build minimum NumPy for aarch64
if: matrix.cibw_archs == 'aarch64' && steps.numpy-cache.outputs.cache-hit != 'true'
run: |
wget https://files.pythonhosted.org/packages/${{ env.min-numpy-hash }}/numpy-${{ env.min-numpy-version }}.zip
unzip numpy-${{ env.min-numpy-version }}.zip
cd numpy-${{ env.min-numpy-version }}
python -m cibuildwheel --output-dir ../numpy-aarch64-cache
env:
CIBW_BUILD: "cp37-* cp38-*"
CIBW_ARCHS: aarch64

- name: Build wheels for CPython 3.10
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_BEFORE_BUILD: pip install certifi numpy==1.21.3
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

Expand All @@ -94,30 +75,30 @@ jobs:
CIBW_BUILD: "cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for CPython
- name: Build wheels for CPython 3.8
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp37-* cp38-*"
CIBW_BUILD: "cp38-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install certifi; pip install --find-links=numpy-aarch64-cache/ numpy==${{ env.min-numpy-version }}
CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.2
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for PyPy
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "pp37-*"
CIBW_BEFORE_BUILD: pip install certifi numpy==${{ env.min-numpy-version }}
CIBW_BUILD: "pp38-*"
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
CIBW_ARCHS: ${{ matrix.cibw_archs }}
PIP_USE_FEATURE: in-tree-build
if: matrix.cibw_archs != 'aarch64'
if: false && matrix.cibw_archs != 'aarch64'

- name: Validate that LICENSE files are included in wheels
run: |
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,16 @@ jobs:
include:
- name-suffix: "(Minimum Versions)"
os: ubuntu-18.04
python-version: 3.7
python-version: 3.8
extra-requirements: '-c requirements/testing/minver.txt'
pyqt5-ver: '==5.8 sip==4.19.7' # oldest versions with a Py3.7 wheel.
pyqt5-ver: '==5.11.2 sip==5.0.0' # oldest versions with a Py3.8 wheel.
delete-font-cache: true
XVFB_RUN: xvfb-run -a
- os: ubuntu-18.04
python-version: 3.7
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
- os: ubuntu-18.04
python-version: 3.8
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
- os: ubuntu-20.04
python-version: 3.9
extra-requirements: '-r requirements/testing/extra.txt'
Expand Down
18 changes: 9 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,33 @@ stages:
- job: Pytest
strategy:
matrix:
Linux_py37:
vmImage: 'ubuntu-18.04'
python.version: '3.7'
Linux_py38:
vmImage: 'ubuntu-18.04'
python.version: '3.8'
Linux_py39:
vmImage: 'ubuntu-18.04'
python.version: '3.9'
macOS_py37:
vmImage: 'macOS-10.15'
python.version: '3.7'
Linux_py310:
vmImage: 'ubuntu-18.04'
python.version: '3.10'
macOS_py38:
vmImage: 'macOS-latest'
python.version: '3.8'
macOS_py39:
vmImage: 'macOS-latest'
python.version: '3.9'
Windows_py37:
vmImage: 'vs2017-win2016'
python.version: '3.7'
macOS_py310:
vmImage: 'macOS-latest'
python.version: '3.10'
Windows_py38:
vmImage: 'windows-latest'
python.version: '3.8'
Windows_py39:
vmImage: 'windows-latest'
python.version: '3.9'
Windows_py310:
vmImage: 'vs2017-win2016'
python.version: '3.10'
maxParallel: 4
pool:
vmImage: '$(vmImage)'
Expand Down
1 change: 1 addition & 0 deletions doc/api/next_api_changes/development/22205-ES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ being bumped:
+------------+-----------------+---------------+
| Dependency | min in mpl3.5 | min in mpl3.6 |
+============+=================+===============+
| Python | 3.7 | 3.8 |
| NumPy | 1.17 | 1.19 |
+------------+-----------------+---------------+

Expand Down
4 changes: 2 additions & 2 deletions doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ The current active branches are

*main*
The current development version. Future minor releases (*v3.N.0*) will be
branched from this. Supports Python 3.7+.
branched from this.

*v3.N.x*
Maintenance branch for Matplotlib 3.N. Future patch releases will be
branched from this. Supports Python 3.6+.
branched from this.

*v3.N.M-doc*
Documentation for the current release. On a patch release, this will be
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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.7)
* `Python <https://www.python.org/downloads/>`_ (>= 3.8)
* `NumPy <https://numpy.org>`_ (>= 1.19)
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
* `cycler <https://matplotlib.org/cycler/>`_ (>= 0.10.0)
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/min_dep_policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ specification of the dependencies.
========== ======== ======
Matplotlib Python NumPy
========== ======== ======
`3.6`_ 3.7 1.19.0
`3.6`_ 3.8 1.19.0
`3.5`_ 3.7 1.17.0
`3.4`_ 3.7 1.16.0
`3.3`_ 3.6 1.15.0
Expand Down
4 changes: 2 additions & 2 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Using tox

`Tox <https://tox.readthedocs.io/en/latest/>`_ is a tool for running tests
against multiple Python environments, including multiple versions of Python
(e.g., 3.6, 3.7) and even different Python implementations altogether
(e.g., 3.7, 3.8) and even different Python implementations altogether
(e.g., CPython, PyPy, Jython, etc.), as long as all these versions are
available on your system's $PATH (consider using your system package manager,
e.g. apt-get, yum, or Homebrew, to install them).
Expand All @@ -186,7 +186,7 @@ You can also run tox on a subset of environments:

.. code-block:: bash

$ tox -e py37,py38
$ tox -e py38,py39

Tox processes everything serially so it can take a long time to test
several environments. To speed it up, you might try using a new,
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,13 +908,12 @@ def logit_deformatter(string):
float 1.41e-4, as '0.5' or as r'$\mathdefault{\frac{1}{2}}$' in float
0.5,
"""
# Can inline the Unicode escapes to the raw strings in Python 3.8+
match = re.match(
r"[^\d]*"
r"(?P<comp>1" "[-\N{Minus Sign}]" r")?"
r"(?P<comp>1[-\N{Minus Sign}])?"
r"(?P<mant>\d*\.?\d*)?"
r"(?:\\cdot)?"
r"(?:10\^\{(?P<expo>" "[-\N{Minus Sign}]" r"?\d*)})?"
r"(?:10\^\{(?P<expo>[-\N{Minus Sign}]?\d*)})?"
r"[^\d]*$",
string,
)
Expand Down
2 changes: 1 addition & 1 deletion 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.7+ builds
# Extra pip requirements for the Python 3.8+ builds

ipykernel
nbconvert[execute]!=6.0.0,!=6.0.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/testing/minver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cycler==0.10
kiwisolver==1.0.1
numpy==1.19.0
packaging==20.0
pillow==6.2.0
pillow==6.2.1
pyparsing==2.2.1
python-dateutil==2.7
fonttools==4.22.0
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# and/or pip.
import sys

py_min_version = (3, 7) # minimal supported python version
since_mpl_version = (3, 4) # py_min_version is required since this mpl version
py_min_version = (3, 8) # minimal supported python version
since_mpl_version = (3, 6) # py_min_version is required since this mpl version

if sys.version_info < py_min_version:
error = """
Expand Down Expand Up @@ -160,12 +160,6 @@ def prepare_flags(name, enable_lto):
return env

def build_extensions(self):
# Remove the -Wstrict-prototypes option, it's not valid for C++. Fixed
# in Py3.7 as bpo-5755.
try:
self.compiler.compiler_so.remove('-Wstrict-prototypes')
except (ValueError, AttributeError):
pass
if (self.compiler.compiler_type == 'msvc' and
os.environ.get('MPL_DISABLE_FH4')):
# Disable FH4 Exception Handling implementation so that we don't
Expand Down Expand Up @@ -289,7 +283,6 @@ def make_release_tree(self, base_dir, files):
'License :: OSI Approved :: Python Software Foundation License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down
2 changes: 1 addition & 1 deletion 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 = py37, py38
envlist = py38, py39, py310

[testenv]
changedir = /tmp
Expand Down