Skip to content

Commit 7f406c8

Browse files
committed
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).
1 parent 94b2c4f commit 7f406c8

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

.github/workflows/tests.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build:
9-
runs-on: '${{ matrix.os }}'
9+
runs-on: '${{ matrix.versions.os || matrix.os }}'
1010
# https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/
1111
if: >
1212
github.event_name != 'pull_request'
@@ -16,36 +16,46 @@ jobs:
1616
# Not all Python versions are available for linux AND x64
1717
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
1818
os: ['ubuntu-latest']
19-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9']
20-
extra: ['', '-smtp']
2119
# The forced pytest versions correspond with the lower bounds in tox.ini
22-
pytest-version: ['', '--force-dep pytest==4.6', '--force-dep pytest==6.2.4']
23-
include:
24-
- os: 'ubuntu-22.04'
25-
python-version: '3.7'
26-
- os: 'ubuntu-22.04'
27-
python-version: 'pypy-3.7'
28-
exclude:
29-
- python-version: '3.10'
30-
pytest-version: '--force-dep pytest==4.6'
31-
- python-version: '3.11'
32-
pytest-version: '--force-dep pytest==4.6'
33-
- python-version: '3.12'
34-
pytest-version: '--force-dep pytest==4.6'
35-
- python-version: '3.13'
36-
pytest-version: '--force-dep pytest==4.6'
20+
versions:
21+
- python: '3.7'
22+
min-deps: '--force-dep pytest==4.6'
23+
os: 'ubuntu-22.04'
24+
- python: '3.8'
25+
min-deps: '--force-dep pytest==4.6'
26+
- python: '3.9'
27+
min-deps: '--force-dep pytest==4.6'
28+
- python: '3.10'
29+
min-deps: '--force-dep pytest==6.2.4'
30+
- python: '3.11'
31+
min-deps: '--force-dep pytest==6.2.4'
32+
- python: '3.12'
33+
min-deps: '--force-dep pytest==6.2.4'
34+
- python: '3.13'
35+
min-deps: '--force-dep pytest==6.2.4'
36+
- python: '3.14'
37+
min-deps: '--force-dep pytest==7.3.2'
38+
- python: 'pypy-3.7'
39+
min-deps: '--force-dep pytest==4.6'
40+
os: 'ubuntu-22.04'
41+
- python: 'pypy-3.8'
42+
min-deps: '--force-dep pytest==4.6'
43+
- python: 'pypy-3.9'
44+
min-deps: '--force-dep pytest==4.6'
45+
force-min-deps: [false, true]
46+
extra: ['', '-smtp']
3747
fail-fast: false
3848

3949
steps:
4050
- uses: actions/checkout@v5
41-
- name: Set up Python ${{ matrix.python-version }}
51+
- name: Set up Python ${{ matrix.versions.python }}
4252
uses: actions/setup-python@v6
4353
with:
44-
python-version: ${{ matrix.python-version }}
54+
python-version: ${{ matrix.versions.python }}
4555
allow-prereleases: true
4656
- name: Install dependencies
4757
run: |
4858
python -m pip install --upgrade pip
4959
pip install tox
5060
- name: Test with tox
51-
run: tox -vv -e py${{ matrix.extra }} ${{ matrix.pytest-version }}
61+
run: tox -vv -e py${{ matrix.extra }} ${{ matrix.force-min-deps && matrix.versions.min-deps }}

0 commit comments

Comments
 (0)