From 1a7b400e7ad1aca7842be4e78e3b3402ad2d9b80 Mon Sep 17 00:00:00 2001 From: David Fritzsche Date: Mon, 26 Jan 2026 17:34:35 +0100 Subject: [PATCH] Remove support for Python 3.7, 3.8 and 3.9 (#63) PR: https://github.com/davidfritzsche/pytest-mypy-testing/pull/63 --- .github/workflows/pythonpackage.yml | 28 +-------------- README.md | 14 +++++--- constraints.in | 6 ---- mypy37.ini | 53 ----------------------------- mypy38.ini | 53 ----------------------------- mypy39.ini | 53 ----------------------------- pyproject.toml | 7 ++-- tox.ini | 7 ---- 8 files changed, 13 insertions(+), 208 deletions(-) delete mode 100644 mypy37.ini delete mode 100644 mypy38.ini delete mode 100644 mypy39.ini diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b448a33..f039764 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -5,39 +5,13 @@ name: Python package on: [push] jobs: - test-py37: - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 4 - matrix: - os: [ubuntu-22.04, macos-15-intel, windows-2022] - - steps: - - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: | - 3.7 - 3.14 - - name: Install dependencies - run: | - python -m pip install -c constraints.txt pip - python -m pip install -c constraints.txt invoke tox - - name: Run tox - env: - TOX_PARALLEL_NO_SPINNER: "1" - run: | - inv mkdir build/coverage-data - inv tox -e "py37-*" - test-py: runs-on: ${{ matrix.os }} strategy: max-parallel: 8 matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v6 diff --git a/README.md b/README.md index 05b644a..918654b 100644 --- a/README.md +++ b/README.md @@ -131,18 +131,23 @@ decorators are extracted from the ast. -U -r requirements.txt`. * Start developing. * To run all tests with [tox](https://tox.readthedocs.io/en/latest/), - Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 must be + Python 3.10, 3.11, 3.12, 3.13 and 3.14 must be available. You might want to look into using [pyenv](https://github.com/pyenv/pyenv). # Changelog +## upcoming + +* Remove support for Python 3.7, 3.8 and 3.9. + Require at least Python 3.10 ([#63][p63]) + ## v0.1.4 (2026-01-26) -* Remove upper limit of supported pytest version ([#61][i61], [#62][p62]). -* Add support for Python 3.13 and Python 3.14 ([#60][p60]). -* Switch to original `flit` build backend ([#58][p58]). +* Remove upper limit of supported pytest version ([#61][i61], [#62][p62]) +* Add support for Python 3.13 and Python 3.14 ([#60][p60]) +* Switch to original `flit` build backend ([#58][p58]) ## v0.1.3 (2024-03-05) @@ -263,3 +268,4 @@ decorators are extracted from the ast. [p58]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/58 [p60]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/60 [p62]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/62 +[p63]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/63 diff --git a/constraints.in b/constraints.in index c0824ca..4482e0f 100644 --- a/constraints.in +++ b/constraints.in @@ -1,9 +1,3 @@ # SPDX-FileCopyrightText: David Fritzsche # SPDX-License-Identifier: CC0-1.0 atomicwrites==1.4.0 -filelock <3.12.3; python_version < "3.8" -importlib-metadata <6.8; python_version < "3.8" -platformdirs <4.1; python_version < "3.8" -pluggy <1.3; python_version < "3.8" -typing-extensions <4.8; python_version < "3.8" -zipp <3.16; python_version < "3.8" diff --git a/mypy37.ini b/mypy37.ini deleted file mode 100644 index 7dbb797..0000000 --- a/mypy37.ini +++ /dev/null @@ -1,53 +0,0 @@ -# SPDX-FileCopyrightText: David Fritzsche -# SPDX-License-Identifier: CC0-1.0 -[mypy] - -python_version = 3.7 - -mypy_path = src - -verbosity = 0 - -# Show some context in the error message -show_error_context = True - -# Unfortunately, outputting the column number confuses Visual Studio Code -show_column_numbers = True - -# follow_imports = (normal|silent|skip|error) -# cf. https://mypy.readthedocs.io/en/latest/running_mypy.html#follow-imports -# silent = Follow all imports and type check, but suppress any error messages -# in imported modules -follow_imports = silent - -# Do not complain about missing imports -ignore_missing_imports = False - -# Enables PEP 420 style namespace packages. (default False) -namespace_packages = False - -# explicit_package_bases = True - -# Type-checks the interior of functions without type annotations (default False) -check_untyped_defs = True - -# Warn about unused per-module sections (default False) -warn_unused_configs = True - -# Warns about casting an expression to its inferred type (default False) -warn_redundant_casts = True - -# Warn about unused `# type: ignore` comments (default False) -warn_unused_ignores = True - -# Shows a warning when returning a value with type Any from a function declared -# with a non-Any return type (default False) -warn_return_any = True - -# Strict Optional checks. -# If False, mypy treats None as compatible with every type. (default True) -strict_optional = True - - -[mypy-py.*] -ignore_missing_imports = True diff --git a/mypy38.ini b/mypy38.ini deleted file mode 100644 index 0ddd5a5..0000000 --- a/mypy38.ini +++ /dev/null @@ -1,53 +0,0 @@ -# SPDX-FileCopyrightText: David Fritzsche -# SPDX-License-Identifier: CC0-1.0 -[mypy] - -python_version = 3.8 - -mypy_path = src - -verbosity = 0 - -# Show some context in the error message -show_error_context = True - -# Unfortunately, outputting the column number confuses Visual Studio Code -show_column_numbers = True - -# follow_imports = (normal|silent|skip|error) -# cf. https://mypy.readthedocs.io/en/latest/running_mypy.html#follow-imports -# silent = Follow all imports and type check, but suppress any error messages -# in imported modules -follow_imports = silent - -# Do not complain about missing imports -ignore_missing_imports = False - -# Enables PEP 420 style namespace packages. (default False) -namespace_packages = False - -# explicit_package_bases = True - -# Type-checks the interior of functions without type annotations (default False) -check_untyped_defs = True - -# Warn about unused per-module sections (default False) -warn_unused_configs = True - -# Warns about casting an expression to its inferred type (default False) -warn_redundant_casts = True - -# Warn about unused `# type: ignore` comments (default False) -warn_unused_ignores = True - -# Shows a warning when returning a value with type Any from a function declared -# with a non-Any return type (default False) -warn_return_any = True - -# Strict Optional checks. -# If False, mypy treats None as compatible with every type. (default True) -strict_optional = True - - -[mypy-py.*] -ignore_missing_imports = True diff --git a/mypy39.ini b/mypy39.ini deleted file mode 100644 index ab879ee..0000000 --- a/mypy39.ini +++ /dev/null @@ -1,53 +0,0 @@ -# SPDX-FileCopyrightText: David Fritzsche -# SPDX-License-Identifier: CC0-1.0 -[mypy] - -python_version = 3.9 - -mypy_path = src - -verbosity = 0 - -# Show some context in the error message -show_error_context = True - -# Unfortunately, outputting the column number confuses Visual Studio Code -show_column_numbers = True - -# follow_imports = (normal|silent|skip|error) -# cf. https://mypy.readthedocs.io/en/latest/running_mypy.html#follow-imports -# silent = Follow all imports and type check, but suppress any error messages -# in imported modules -follow_imports = silent - -# Do not complain about missing imports -ignore_missing_imports = False - -# Enables PEP 420 style namespace packages. (default False) -namespace_packages = False - -# explicit_package_bases = True - -# Type-checks the interior of functions without type annotations (default False) -check_untyped_defs = True - -# Warn about unused per-module sections (default False) -warn_unused_configs = True - -# Warns about casting an expression to its inferred type (default False) -warn_redundant_casts = True - -# Warn about unused `# type: ignore` comments (default False) -warn_unused_ignores = True - -# Shows a warning when returning a value with type Any from a function declared -# with a non-Any return type (default False) -warn_return_any = True - -# Strict Optional checks. -# If False, mypy treats None as compatible with every type. (default True) -strict_optional = True - - -[mypy-py.*] -ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index d276334..d89749b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ authors = [ {name = "David Fritzsche", email = "david.fritzsche@mvua.de"}, ] readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.10" license = "Apache-2.0 OR MIT" license-files = ["LICENSES/*"] keywords = ["pytest", "mypy"] @@ -23,9 +23,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -54,7 +51,7 @@ include = ["src/pytest_mypy_testing/_version.py"] [tool.black] line-length = 88 -target-version = ['py37', 'py38', 'py39', 'py310', 'py311', 'py312'] +target-version = ['py310', 'py311', 'py312'] include = '\.pyi?$' extend-exclude = ''' ( diff --git a/tox.ini b/tox.ini index 2989eeb..8ac4f8b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,9 +4,6 @@ [tox] isolated_build = True envlist = - py37-pytest{70,74}-mypy{10,14} - py38-pytest{74,83}-mypy{18,114} - py39-pytest{74,84}-mypy{18,119} {py310,py311,py312}-pytest{84,90}-mypy{119} {py313,py314}-pytest{84,90}-mypy{119} py-pytest{84,90}-mypy{119} @@ -23,7 +20,6 @@ deps = pytest72: pytest~=7.2.2 pytest74: pytest~=7.4.4 # last version to support Python 3.7 / noble pytest80: pytest~=8.0.2 - pytest80: pytest~=8.0.2 pytest81: pytest~=8.1.2 pytest83: pytest~=8.3.5 # last version to support Python 3.8 / trixie pytest84: pytest~=8.4.2 # last version to support Python 3.9 @@ -37,9 +33,6 @@ deps = mypy119: mypy==1.19.0 # last version to support Python 3.9 setenv = COVERAGE_FILE={toxinidir}/build/{envname}/coverage - py37: PYTEST_MYPY_CONFIG_FILE={toxinidir}/mypy37.ini - py38: PYTEST_MYPY_CONFIG_FILE={toxinidir}/mypy38.ini - py39: PYTEST_MYPY_CONFIG_FILE={toxinidir}/mypy39.ini commands = python -m coverage run --context "{envname}" -m pytest {posargs} --junitxml={toxinidir}/build/{envname}/junit.xml