Skip to content
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

Drop support for running with Python 3.7 #15566

Merged
merged 24 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 20 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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'
- name: Install tox
run: pip install --upgrade 'setuptools!=50' tox==4.4.4
- name: Setup tox environment
Expand Down
49 changes: 21 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,27 @@ jobs:
fail-fast: false
matrix:
include:
- name: Test suite with py37-windows-64
python: '3.7'
arch: x64
os: windows-latest
toxenv: py37
- name: Test suite with py38-ubuntu
# Make sure to run mypyc compiled unit tests for both
# the oldest and newest supported Python versions
- name: Test suite with py38-ubuntu, mypyc-compiled
python: '3.8'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
- name: Test suite with py39-ubuntu
python: '3.9'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
- name: Test suite with py37-ubuntu, mypyc-compiled
python: '3.7'
test_mypyc: true
- name: Test suite with py38-windows-64
python: '3.8'
arch: x64
os: ubuntu-latest
toxenv: py
os: windows-latest
toxenv: py38
hauntsaninja marked this conversation as resolved.
Show resolved Hide resolved
tox_extra_args: "-n 2"
Copy link
Member

@AlexWaygood AlexWaygood Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if my previous suggestion might have been bad; maybe this might be the thing that's breaking things? Maybe there's a reason that the windows py37 job was the only job that didn't have -n 2 passed to it...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't work :-/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i saw :(

test_mypyc: true
- name: Test suite with py310-ubuntu, mypyc-compiled
python: '3.10'
- name: Test suite with py39-ubuntu
python: '3.9'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
test_mypyc: true
- name: Test suite with py310-ubuntu
python: '3.10'
arch: x64
Expand All @@ -70,29 +60,32 @@ jobs:
toxenv: py
tox_extra_args: "-n 2"
test_mypyc: true
- name: mypyc runtime tests with py37-macos
python: '3.7'

- name: mypyc runtime tests with py38-macos
python: '3.8.17'
arch: x64
os: macos-latest
toxenv: py
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
- name: mypyc runtime tests with py37-debug-build-ubuntu
python: '3.7.13'
- name: mypyc runtime tests with py38-debug-build-ubuntu
python: '3.8.17'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
debug_build: true
- name: Type check our own code (py37-ubuntu)
python: '3.7'

- name: Type check our own code (py38-ubuntu)
python: '3.8'
arch: x64
os: ubuntu-latest
toxenv: type
- name: Type check our own code (py37-windows-64)
python: '3.7'
- name: Type check our own code (py38-windows-64)
python: '3.8'
arch: x64
os: windows-latest
toxenv: type

# We also run these checks with pre-commit in CI,
# but it's useful to run them with tox too,
# to ensure the tox env works as expected
Expand Down
1 change: 0 additions & 1 deletion build-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
-r mypy-requirements.txt
types-psutil
types-setuptools
types-typed-ast>=1.5.8.5,<1.6.0
7 changes: 3 additions & 4 deletions docs/source/additional_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ of the previous sections.
Dataclasses
***********

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

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ may not make much sense otherwise.
Installing and running mypy
***************************

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

.. code-block:: shell

Expand Down
2 changes: 1 addition & 1 deletion misc/build-debug-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi
curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
tar zxf Python-$VERSION.tgz
cd Python-$VERSION
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix=$PREFIX
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix=$PREFIX --with-trace-refs
make -j4
make install
$PREFIX/bin/python3 -m pip install virtualenv
Expand Down
4 changes: 1 addition & 3 deletions mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# NOTE: this needs to be kept in sync with the "requires" list in pyproject.toml
typing_extensions>=4.1.0; python_version >= '3.8'
typing_extensions>=4.7.0; python_version < '3.8'
typing_extensions>=4.1.0
mypy_extensions>=1.0.0
typed_ast>=1.4.0,<2; python_version<'3.8'
tomli>=1.1.0; python_version<'3.11'
2 changes: 1 addition & 1 deletion mypy/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Earliest fully supported Python 3.x version. Used as the default Python
# version in tests. Mypy wheels should be built starting with this version,
# and CI tests should be run on this version (and later versions).
PYTHON3_VERSION: Final = (3, 7)
PYTHON3_VERSION: Final = (3, 8)

# Earliest Python 3.x version supported via --python-version 3.x. To run
# mypy, at least version PYTHON3_VERSION is needed.
Expand Down
2 changes: 0 additions & 2 deletions mypy/dmypy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,6 @@ def cmd_inspect(
force_reload: bool = False,
) -> dict[str, object]:
"""Locate and inspect expression(s)."""
if sys.version_info < (3, 8):
return {"error": 'Python 3.8 required for "inspect" command'}
if not self.fine_grained_manager:
return {
"error": 'Command "inspect" is only valid after a "check" command'
Expand Down
Loading