From 7f0ffea7bcc6fa10bad5b0bb92b517d749213c58 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:05:47 +0300 Subject: [PATCH 1/3] Add support for Python 3.15 --- .github/workflows/test.yml | 19 +++++++++++++++++++ ci/templates/.github/workflows/test.yml | 1 + pyproject.toml | 1 + tox.ini | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e12f6de..0cbf7acf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,6 +150,24 @@ jobs: python_arch: 'arm64' tox_env: 'py314-pytest90-xdist38-coverage713' os: 'macos-latest' + - name: 'py315-pytest90-xdist38-coverage713 (ubuntu)' + python: '3.15' + toxpython: 'python3.15' + python_arch: 'x64' + tox_env: 'py315-pytest90-xdist38-coverage713' + os: 'ubuntu-latest' + - name: 'py315-pytest90-xdist38-coverage713 (windows)' + python: '3.15' + toxpython: 'python3.15' + python_arch: 'x64' + tox_env: 'py315-pytest90-xdist38-coverage713' + os: 'windows-latest' + - name: 'py315-pytest90-xdist38-coverage713 (macos)' + python: '3.15' + toxpython: 'python3.15' + python_arch: 'arm64' + tox_env: 'py315-pytest90-xdist38-coverage713' + os: 'macos-latest' - name: 'pypy310-pytest90-xdist38-coverage713 (ubuntu)' python: 'pypy-3.10' toxpython: 'pypy3.10' @@ -230,6 +248,7 @@ jobs: with: python-version: ${{ matrix.python }} architecture: ${{ matrix.python_arch }} + allow-prereleases: true - name: install dependencies run: | python -mpip install --progress-bar=off -r ci/requirements.txt diff --git a/ci/templates/.github/workflows/test.yml b/ci/templates/.github/workflows/test.yml index 08f90d1b..2374ed02 100644 --- a/ci/templates/.github/workflows/test.yml +++ b/ci/templates/.github/workflows/test.yml @@ -95,6 +95,7 @@ jobs: with: python-version: {{ '${{ matrix.python }}' }} architecture: {{ '${{ matrix.python_arch }}' }} + allow-prereleases: true - name: install dependencies run: | python -mpip install --progress-bar=off -r ci/requirements.txt diff --git a/pyproject.toml b/pyproject.toml index c1641b10..0e5e7407 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing", diff --git a/tox.ini b/tox.ini index 07548537..5e920ce5 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ envlist = clean, check, docs, - {py310,py311,py312,py313,py314,pypy310,pypy311}-{pytest90}-{xdist38}-{coverage713}, + {py310,py311,py312,py313,py314,py315,pypy310,pypy311}-{pytest90}-{xdist38}-{coverage713}, {py39,pypy39}-{pytest80}-{xdist38}-{coverage710}, report ignore_basepython_conflict = true From fbd01a385fc91808c99efcf826b102aa174f23fd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:26:38 +0300 Subject: [PATCH 2/3] Drop support for EOL Python 3.9 --- .github/workflows/test.yml | 36 ------------------------------------ pyproject.toml | 5 ++--- src/pytest_cov/engine.py | 3 +-- tox.ini | 1 - 4 files changed, 3 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cbf7acf..32b59e49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -204,42 +204,6 @@ jobs: python_arch: 'arm64' tox_env: 'pypy311-pytest90-xdist38-coverage713' os: 'macos-latest' - - name: 'py39-pytest80-xdist38-coverage710 (ubuntu)' - python: '3.9' - toxpython: 'python3.9' - python_arch: 'x64' - tox_env: 'py39-pytest80-xdist38-coverage710' - os: 'ubuntu-latest' - - name: 'py39-pytest80-xdist38-coverage710 (windows)' - python: '3.9' - toxpython: 'python3.9' - python_arch: 'x64' - tox_env: 'py39-pytest80-xdist38-coverage710' - os: 'windows-latest' - - name: 'py39-pytest80-xdist38-coverage710 (macos)' - python: '3.9' - toxpython: 'python3.9' - python_arch: 'arm64' - tox_env: 'py39-pytest80-xdist38-coverage710' - os: 'macos-latest' - - name: 'pypy39-pytest80-xdist38-coverage710 (ubuntu)' - python: 'pypy-3.9' - toxpython: 'pypy3.9' - python_arch: 'x64' - tox_env: 'pypy39-pytest80-xdist38-coverage710' - os: 'ubuntu-latest' - - name: 'pypy39-pytest80-xdist38-coverage710 (windows)' - python: 'pypy-3.9' - toxpython: 'pypy3.9' - python_arch: 'x64' - tox_env: 'pypy39-pytest80-xdist38-coverage710' - os: 'windows-latest' - - name: 'pypy39-pytest80-xdist38-coverage710 (macos)' - python: 'pypy-3.9' - toxpython: 'pypy3.9' - python_arch: 'arm64' - tox_env: 'pypy39-pytest80-xdist38-coverage710' - os: 'macos-latest' steps: - uses: actions/checkout@v6 with: diff --git a/pyproject.toml b/pyproject.toml index 0e5e7407..b1a5326a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["readme"] version = "7.1.0" description = "Pytest plugin for measuring coverage." license = "MIT" -requires-python = ">=3.9" +requires-python = ">=3.10" authors = [ { name = "Marc Schlaich", email = "marc.schlaich@gmail.com" }, ] @@ -34,7 +34,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -79,7 +78,7 @@ fragments = [ extend-exclude = ["static", "ci/templates"] line-length = 140 src = ["src", "tests"] -target-version = "py39" +target-version = "py310" [tool.ruff.lint.per-file-ignores] "ci/*" = ["S"] diff --git a/src/pytest_cov/engine.py b/src/pytest_cov/engine.py index a6a465fa..7187d070 100644 --- a/src/pytest_cov/engine.py +++ b/src/pytest_cov/engine.py @@ -10,7 +10,6 @@ import sys import warnings from pathlib import Path -from typing import Union import coverage from coverage.data import CoverageData @@ -52,7 +51,7 @@ def ensure_topdir_wrapper(self, *args, **kwargs): class CovController: """Base class for different plugin implementations.""" - def __init__(self, options: argparse.Namespace, config: Union[None, object], nodeid: Union[None, str]): + def __init__(self, options: argparse.Namespace, config: object | None, nodeid: str | None): """Get some common config used by multiple derived classes.""" self.cov_source = options.cov_source self.cov_report = options.cov_report diff --git a/tox.ini b/tox.ini index 5e920ce5..82038b92 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,6 @@ envlist = check, docs, {py310,py311,py312,py313,py314,py315,pypy310,pypy311}-{pytest90}-{xdist38}-{coverage713}, - {py39,pypy39}-{pytest80}-{xdist38}-{coverage710}, report ignore_basepython_conflict = true From 0be12962077762585fadbe394efe80b189617e45 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:55:59 +0300 Subject: [PATCH 3/3] Remove unused tox vars --- tox.ini | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/tox.ini b/tox.ini index 82038b92..10774601 100644 --- a/tox.ini +++ b/tox.ini @@ -26,34 +26,11 @@ setenv = PYTHONUNBUFFERED=yes # Use env vars for (optional) pinning of deps. - pytest62: _DEP_PYTEST=pytest==6.2.5 - pytest80: _DEP_PYTEST=pytest==8.0.2 - pytest81: _DEP_PYTEST=pytest==8.1.1 - pytest82: _DEP_PYTEST=pytest==8.2.2 - pytest83: _DEP_PYTEST=pytest==8.3.5 - pytest84: _DEP_PYTEST=pytest==8.4.2 pytest90: _DEP_PYTEST=pytest==9.0.2 - xdist32: _DEP_PYTESTXDIST=pytest-xdist==3.2.0 - xdist33: _DEP_PYTESTXDIST=pytest-xdist==3.3.1 - xdist34: _DEP_PYTESTXDIST=pytest-xdist==3.4.0 - xdist35: _DEP_PYTESTXDIST=pytest-xdist==3.5.0 - xdist36: _DEP_PYTESTXDIST=pytest-xdist==3.6.1 - xdist37: _DEP_PYTESTXDIST=pytest-xdist==3.7.0 xdist38: _DEP_PYTESTXDIST=pytest-xdist==3.8.0 xdistdev: _DEP_PYTESTXDIST=git+https://github.com/pytest-dev/pytest-xdist.git#egg=pytest-xdist - coverage72: _DEP_COVERAGE=coverage==7.2.7 - coverage73: _DEP_COVERAGE=coverage==7.3.4 - coverage74: _DEP_COVERAGE=coverage==7.4.4 - coverage75: _DEP_COVERAGE=coverage==7.5.4 - coverage76: _DEP_COVERAGE=coverage==7.6.12 - coverage77: _DEP_COVERAGE=coverage==7.7.1 - coverage78: _DEP_COVERAGE=coverage==7.8.2 - coverage79: _DEP_COVERAGE=coverage==7.9.2 - coverage710: _DEP_COVERAGE=coverage==7.10.7 - coverage711: _DEP_COVERAGE=coverage==7.11.3 - coverage712: _DEP_COVERAGE=coverage==7.12.0 coverage713: _DEP_COVERAGE=coverage==7.13.5 # For testing against a coverage.py working tree.