From 72dcc7d0c168a9ef7b07dc3a3ef5093033b35c9b Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 10 Oct 2024 17:58:10 +0200 Subject: [PATCH] Work in progress drop python 3.8 (need to be squashed after review) Refs #12874 --- .github/workflows/prepare-release-pr.yml | 2 +- .github/workflows/test.yml | 65 +++++++++++------------- .pre-commit-config.yaml | 2 +- CONTRIBUTING.rst | 2 +- README.rst | 2 +- changelog/12874.breaking.rst | 1 + doc/en/backwards-compatibility.rst | 1 + pyproject.toml | 7 ++- testing/code/test_excinfo.py | 2 +- tox.ini | 9 ++-- 10 files changed, 43 insertions(+), 50 deletions(-) create mode 100644 changelog/12874.breaking.rst diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 1bb23fab844..f46b5cecda5 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.x" - name: Install dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52faca6ddef..79b3e5a2dd3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,17 +54,16 @@ jobs: fail-fast: false matrix: name: [ - "windows-py38", - "windows-py38-pluggy", + "windows-py39-pluggy", "windows-py39", "windows-py310", "windows-py311", "windows-py312", "windows-py313", - "ubuntu-py38", - "ubuntu-py38-pluggy", - "ubuntu-py38-freeze", + "ubuntu-py39-lsof-numpy-pexpect", + "ubuntu-py39-pluggy", + "ubuntu-py39-freeze", "ubuntu-py39", "ubuntu-py310", "ubuntu-py311", @@ -72,7 +71,6 @@ jobs: "ubuntu-py313", "ubuntu-pypy3", - "macos-py38", "macos-py39", "macos-py310", "macos-py312", @@ -83,15 +81,15 @@ jobs: ] include: - - name: "windows-py38" - python: "3.8" + - name: "windows-py39-unittestextras" + python: "3.9" os: windows-latest - tox_env: "py38-unittestextras" + tox_env: "py39-unittestextras" use_coverage: true - - name: "windows-py38-pluggy" - python: "3.8" + - name: "windows-py39-pluggy" + python: "3.9" os: windows-latest - tox_env: "py38-pluggymain-pylib-xdist" + tox_env: "py39-pluggymain-pylib-xdist" - name: "windows-py39" python: "3.9" os: windows-latest @@ -109,28 +107,27 @@ jobs: os: windows-latest tox_env: "py312" - name: "windows-py313" - python: "3.13-dev" + python: "3.13" os: windows-latest tox_env: "py313" - - name: "ubuntu-py38" - python: "3.8" + - name: "ubuntu-py39-lsof-numpy-pexpect" + python: "3.9" os: ubuntu-latest - tox_env: "py38-lsof-numpy-pexpect" - use_coverage: true - - name: "ubuntu-py38-pluggy" - python: "3.8" + tox_env: "py39-lsof-numpy-pexpect" + - name: "ubuntu-py39-pluggy" + python: "3.9" os: ubuntu-latest - tox_env: "py38-pluggymain-pylib-xdist" - - name: "ubuntu-py38-freeze" - python: "3.8" + tox_env: "py39-pluggymain-pylib-xdist" + - name: "ubuntu-py39-freeze" + python: "3.9" os: ubuntu-latest - tox_env: "py38-freeze" - - name: "ubuntu-py39" + tox_env: "py39-freeze" + - name: "ubuntu-py39-xdist" python: "3.9" os: ubuntu-latest tox_env: "py39-xdist" - - name: "ubuntu-py310" + - name: "ubuntu-py310-xdist" python: "3.10" os: ubuntu-latest tox_env: "py310-xdist" @@ -145,7 +142,7 @@ jobs: tox_env: "py312" use_coverage: true - name: "ubuntu-py313" - python: "3.13-dev" + python: "3.13" os: ubuntu-latest tox_env: "py313-pexpect" use_coverage: true @@ -154,10 +151,6 @@ jobs: os: ubuntu-latest tox_env: "pypy3-xdist" - - name: "macos-py38" - python: "3.8" - os: macos-latest - tox_env: "py38-xdist" - name: "macos-py39" python: "3.9" os: macos-latest @@ -172,7 +165,7 @@ jobs: os: macos-latest tox_env: "py312-xdist" - name: "macos-py313" - python: "3.13-dev" + python: "3.13" os: macos-latest tox_env: "py313-xdist" @@ -182,7 +175,7 @@ jobs: tox_env: "plugins" - name: "doctesting" - python: "3.8" + python: "3.9" os: ubuntu-latest tox_env: "doctesting" use_coverage: true @@ -192,12 +185,12 @@ jobs: contains( fromJSON( '[ - "windows-py38-pluggy", + "windows-py39-pluggy", "windows-py313", - "ubuntu-py38-pluggy", - "ubuntu-py38-freeze", + "ubuntu-py39-pluggy", + "ubuntu-py39-freeze", "ubuntu-py313", - "macos-py38", + "macos-py39", "macos-py313" ]' ), diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8e7053e1c8..218a69e2cbc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.2" + rev: "v0.7.3" hooks: - id: ruff args: ["--fix"] diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d615e5fb113..56824a43ff4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -270,7 +270,7 @@ Here is a simple overview, with pytest-specific bits: #. Run all the tests - You need to have Python 3.8 or later available in your system. Now + You need to have Python 3.9 or later available in your system. Now running tests is as simple as issuing this command:: $ tox -e linting,py39 diff --git a/README.rst b/README.rst index a81e082cdd7..091afc363da 100644 --- a/README.rst +++ b/README.rst @@ -97,7 +97,7 @@ Features - Can run `unittest `_ (or trial) test suites out of the box -- Python 3.8+ or PyPy3 +- Python 3.9+ or PyPy3 - Rich plugin architecture, with over 1300+ `external plugins `_ and thriving community diff --git a/changelog/12874.breaking.rst b/changelog/12874.breaking.rst new file mode 100644 index 00000000000..82466d22aaf --- /dev/null +++ b/changelog/12874.breaking.rst @@ -0,0 +1 @@ +We dropped support for python 3.8 following its end of life (2024-10-07) diff --git a/doc/en/backwards-compatibility.rst b/doc/en/backwards-compatibility.rst index c0feb833ce1..82f678b4dea 100644 --- a/doc/en/backwards-compatibility.rst +++ b/doc/en/backwards-compatibility.rst @@ -83,6 +83,7 @@ Released pytest versions support all Python versions that are actively maintaine ============== =================== pytest version min. Python version ============== =================== +8.4+ 3.9+ 8.0+ 3.8+ 7.1+ 3.7+ 6.2 - 7.0 3.6+ diff --git a/pyproject.toml b/pyproject.toml index ad0bca4374b..c461223fd43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ authors = [ { name = "Florian Bruhin" }, { name = "Others (See AUTHORS)" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 6 - Mature", "Intended Audience :: Developers", @@ -33,7 +33,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -85,7 +84,7 @@ write_to = "src/_pytest/_version.py" [tool.black] target-version = [ - 'py38', + 'py39', ] [tool.ruff] @@ -509,7 +508,7 @@ files = [ mypy_path = [ "src", ] -python_version = "3.8" +python_version = "3.9" check_untyped_defs = true disallow_any_generics = true disallow_untyped_defs = true diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index fc60ae9ac99..6fc76d13958 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -965,7 +965,7 @@ def raiseos(): assert upframe is not None if upframe.f_code.co_name == "_makepath": # Only raise with expected calls, but not via e.g. inspect for - # py38-windows. + # py38-windows. (?) raised += 1 raise OSError(2, "custom_oserror") return orig_path_cwd() diff --git a/tox.ini b/tox.ini index 61563ca2c5f..80fae513142 100644 --- a/tox.ini +++ b/tox.ini @@ -4,18 +4,17 @@ minversion = 3.20.0 distshare = {homedir}/.tox/distshare envlist = linting - py38 py39 py310 py311 py312 py313 pypy3 - py38-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} + py39-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} doctesting doctesting-coverage plugins - py38-freeze + py39-freeze docs docs-checklinks @@ -58,7 +57,7 @@ setenv = PYTHONWARNDEFAULTENCODING=1 # Configuration to run with coverage similar to CI, e.g. - # "tox -e py38-coverage". + # "tox -e py39-coverage". coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess coverage: COVERAGE_FILE={toxinidir}/.coverage @@ -178,7 +177,7 @@ commands = pytest pytest_twisted_integration.py pytest simple_integration.py --force-sugar --flakes -[testenv:py38-freeze] +[testenv:py39-freeze] description = test pytest frozen with `pyinstaller` under `{basepython}` changedir = testing/freeze