Skip to content

Commit 2edaf35

Browse files
authored
Drop support for running with Python 3.7 (#15566)
1 parent 19c5d5f commit 2edaf35

36 files changed

+163
-446
lines changed

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v3
2626
- uses: actions/setup-python@v4
2727
with:
28-
python-version: '3.7'
28+
python-version: '3.8'
2929
- name: Install tox
3030
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
3131
- name: Setup tox environment

.github/workflows/test.yml

+21-28
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,27 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
include:
29-
- name: Test suite with py37-windows-64
30-
python: '3.7'
31-
arch: x64
32-
os: windows-latest
33-
toxenv: py37
34-
- name: Test suite with py38-ubuntu
29+
# Make sure to run mypyc compiled unit tests for both
30+
# the oldest and newest supported Python versions
31+
- name: Test suite with py38-ubuntu, mypyc-compiled
3532
python: '3.8'
3633
arch: x64
3734
os: ubuntu-latest
3835
toxenv: py
3936
tox_extra_args: "-n 2"
40-
- name: Test suite with py39-ubuntu
41-
python: '3.9'
42-
arch: x64
43-
os: ubuntu-latest
44-
toxenv: py
45-
tox_extra_args: "-n 2"
46-
- name: Test suite with py37-ubuntu, mypyc-compiled
47-
python: '3.7'
37+
test_mypyc: true
38+
- name: Test suite with py38-windows-64
39+
python: '3.8'
4840
arch: x64
49-
os: ubuntu-latest
50-
toxenv: py
41+
os: windows-latest
42+
toxenv: py38
5143
tox_extra_args: "-n 2"
52-
test_mypyc: true
53-
- name: Test suite with py310-ubuntu, mypyc-compiled
54-
python: '3.10'
44+
- name: Test suite with py39-ubuntu
45+
python: '3.9'
5546
arch: x64
5647
os: ubuntu-latest
5748
toxenv: py
5849
tox_extra_args: "-n 2"
59-
test_mypyc: true
6050
- name: Test suite with py310-ubuntu
6151
python: '3.10'
6252
arch: x64
@@ -70,29 +60,32 @@ jobs:
7060
toxenv: py
7161
tox_extra_args: "-n 2"
7262
test_mypyc: true
73-
- name: mypyc runtime tests with py37-macos
74-
python: '3.7'
63+
64+
- name: mypyc runtime tests with py38-macos
65+
python: '3.8.17'
7566
arch: x64
7667
os: macos-latest
7768
toxenv: py
7869
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
79-
- name: mypyc runtime tests with py37-debug-build-ubuntu
80-
python: '3.7.13'
70+
- name: mypyc runtime tests with py38-debug-build-ubuntu
71+
python: '3.8.17'
8172
arch: x64
8273
os: ubuntu-latest
8374
toxenv: py
8475
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
8576
debug_build: true
86-
- name: Type check our own code (py37-ubuntu)
87-
python: '3.7'
77+
78+
- name: Type check our own code (py38-ubuntu)
79+
python: '3.8'
8880
arch: x64
8981
os: ubuntu-latest
9082
toxenv: type
91-
- name: Type check our own code (py37-windows-64)
92-
python: '3.7'
83+
- name: Type check our own code (py38-windows-64)
84+
python: '3.8'
9385
arch: x64
9486
os: windows-latest
9587
toxenv: type
88+
9689
# We also run these checks with pre-commit in CI,
9790
# but it's useful to run them with tox too,
9891
# to ensure the tox env works as expected

build-requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
-r mypy-requirements.txt
33
types-psutil
44
types-setuptools
5-
types-typed-ast>=1.5.8.5,<1.6.0

docs/source/additional_features.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ of the previous sections.
99
Dataclasses
1010
***********
1111

12-
In Python 3.7, a new :py:mod:`dataclasses` module has been added to the standard library.
13-
This module allows defining and customizing simple boilerplate-free classes.
14-
They can be defined using the :py:func:`@dataclasses.dataclass
15-
<python:dataclasses.dataclass>` decorator:
12+
The :py:mod:`dataclasses` module allows defining and customizing simple
13+
boilerplate-free classes. They can be defined using the
14+
:py:func:`@dataclasses.dataclass <python:dataclasses.dataclass>` decorator:
1615

1716
.. code-block:: python
1817

docs/source/getting_started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ may not make much sense otherwise.
1616
Installing and running mypy
1717
***************************
1818

19-
Mypy requires Python 3.7 or later to run. You can install mypy using pip:
19+
Mypy requires Python 3.8 or later to run. You can install mypy using pip:
2020

2121
.. code-block:: shell
2222

misc/build-debug-python.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
2727
tar zxf Python-$VERSION.tgz
2828
cd Python-$VERSION
29-
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix=$PREFIX
29+
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix=$PREFIX --with-trace-refs
3030
make -j4
3131
make install
3232
$PREFIX/bin/python3 -m pip install virtualenv

mypy-requirements.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# NOTE: this needs to be kept in sync with the "requires" list in pyproject.toml
2-
typing_extensions>=4.1.0; python_version >= '3.8'
3-
typing_extensions>=4.7.0; python_version < '3.8'
2+
typing_extensions>=4.1.0
43
mypy_extensions>=1.0.0
5-
typed_ast>=1.4.0,<2; python_version<'3.8'
64
tomli>=1.1.0; python_version<'3.11'

mypy/defaults.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Earliest fully supported Python 3.x version. Used as the default Python
99
# version in tests. Mypy wheels should be built starting with this version,
1010
# and CI tests should be run on this version (and later versions).
11-
PYTHON3_VERSION: Final = (3, 7)
11+
PYTHON3_VERSION: Final = (3, 8)
1212

1313
# Earliest Python 3.x version supported via --python-version 3.x. To run
1414
# mypy, at least version PYTHON3_VERSION is needed.

mypy/dmypy_server.py

-2
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,6 @@ def cmd_inspect(
896896
force_reload: bool = False,
897897
) -> dict[str, object]:
898898
"""Locate and inspect expression(s)."""
899-
if sys.version_info < (3, 8):
900-
return {"error": 'Python 3.8 required for "inspect" command'}
901899
if not self.fine_grained_manager:
902900
return {
903901
"error": 'Command "inspect" is only valid after a "check" command'

0 commit comments

Comments
 (0)