From 94b2c4fbe40c36627a180881a842df11ba985553 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Sat, 8 Nov 2025 20:37:09 -0800 Subject: [PATCH 1/3] Add a Python 3.14 test environment to the default list in tox I had to set the minimum pytest version for Python 3.14 to pytest 7.3.2, because older versions of pytest use ast.Str, which was removed in 3.14. --- tox.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 3899f28..ad784e8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39,310,311,312,313,py3}{,-smtp},lint +envlist = py{37,38,39,310,311,312,313,314,py3}{,-smtp},lint recreate = True isolated_build = True @@ -22,8 +22,9 @@ deps = # works with your code. Don't forget to modify the corresponding entries in # the Github workflows configuration file if you do change these lower # bounds. - pytest >=4.6, <9; python_version<'3.10' - pytest >=6.2.4, <9; python_version>='3.10' + pytest >=4.6, <9; python_version <'3.10' + pytest >=6.2.4, <9; python_version >='3.10' and python_version <'3.14' + pytest >=7.3.2, <9; python_version >='3.14' pytest-cov !=6.2.0 requests extras = From fa331309d5eaf1b4a597e64bfbc77a30da1b91f3 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Sat, 8 Nov 2025 20:29:06 -0800 Subject: [PATCH 2/3] Add Python 3.14 testing to CI and refactor version matrix The main purpose of this commit is to enable testing on Python 3.14 in CI. But Python 3.14 requires a different minimum version of pytest from any earlier version, meaning that we now have three different minimum pytest versions that need to be tested depending on the Python version, and that's very complicated to express by including and excluding specific configurations as we were doing before. So I refactored the matrix of versions to take advantage of the ability to have objects as matrix values, meaning that each Python version can be accompanied by the specific minimum pytest version it requires in the matrix. This is much easier to understand and maintain, and it should also have us running fewer CI jobs overall (since we're no longer going to run combinations like pytest 6.2.4 on Python 3.7-3.9, which served no purpose). --- .github/workflows/tests.yml | 52 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b3b118..ed8ccb4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: '${{ matrix.os }}' + runs-on: '${{ matrix.versions.os || matrix.os }}' # https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/ if: > github.event_name != 'pull_request' @@ -16,36 +16,46 @@ jobs: # Not all Python versions are available for linux AND x64 # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json os: ['ubuntu-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9'] - extra: ['', '-smtp'] # The forced pytest versions correspond with the lower bounds in tox.ini - pytest-version: ['', '--force-dep pytest==4.6', '--force-dep pytest==6.2.4'] - include: - - os: 'ubuntu-22.04' - python-version: '3.7' - - os: 'ubuntu-22.04' - python-version: 'pypy-3.7' - exclude: - - python-version: '3.10' - pytest-version: '--force-dep pytest==4.6' - - python-version: '3.11' - pytest-version: '--force-dep pytest==4.6' - - python-version: '3.12' - pytest-version: '--force-dep pytest==4.6' - - python-version: '3.13' - pytest-version: '--force-dep pytest==4.6' + versions: + - python: '3.7' + min-deps: '--force-dep pytest==4.6' + os: 'ubuntu-22.04' + - python: '3.8' + min-deps: '--force-dep pytest==4.6' + - python: '3.9' + min-deps: '--force-dep pytest==4.6' + - python: '3.10' + min-deps: '--force-dep pytest==6.2.4' + - python: '3.11' + min-deps: '--force-dep pytest==6.2.4' + - python: '3.12' + min-deps: '--force-dep pytest==6.2.4' + - python: '3.13' + min-deps: '--force-dep pytest==6.2.4' + - python: '3.14' + min-deps: '--force-dep pytest==7.3.2' + - python: 'pypy-3.7' + min-deps: '--force-dep pytest==4.6' + os: 'ubuntu-22.04' + - python: 'pypy-3.8' + min-deps: '--force-dep pytest==4.6' + - python: 'pypy-3.9' + min-deps: '--force-dep pytest==4.6' + force-min-deps: [false, true] + extra: ['', '-smtp'] fail-fast: false steps: - uses: actions/checkout@v5 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.versions.python }} uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.versions.python }} allow-prereleases: true - name: Install dependencies run: | python -m pip install --upgrade pip pip install tox - name: Test with tox - run: tox -vv -e py${{ matrix.extra }} ${{ matrix.pytest-version }} + run: tox -vv -e py${{ matrix.extra }} ${{ matrix.force-min-deps && matrix.versions.min-deps || '' }} From f68ce97dfae773f07740903efc185cdbd968bd64 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Sat, 8 Nov 2025 20:37:39 -0800 Subject: [PATCH 3/3] Add Python 3.14 trove classifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 107de59..b19ad12 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ def read(fname): "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Testing", ], )