Skip to content

Commit b736d40

Browse files
edmorleypradyunsg
authored andcommitted
Test against Python 3.11, 3.12 and 3.13 in CI
Previously local and CI tests would only run against Python 3.10 and older. Now, Python 3.11, 3.12 and the prerelease versions of 3.13 are tested too. (If installed locally) This improves test coverage, and also gives more flexibility when running nox locally, since there is a greater chance it will find a matching Python version rather than skipping all tests if eg only newer Python is installed. I've also upgraded the setup-python and checkout actions to their latest versions: https://github.com/actions/setup-python/releases https://github.com/actions/checkout/releases
1 parent d2d4c18 commit b736d40

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

.github/workflows/check.yml

+23-12
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
name: "are correctly generated"
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
1616
- run: pip install nox
1717

1818
- run: nox -s generate
@@ -23,23 +23,34 @@ jobs:
2323
name: "work as advertised"
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-python@v4
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
2828
- run: pip install nox
2929

30-
# Install supported Python versions
31-
- uses: actions/setup-python@v4
30+
# Install supported Python versions. Keep in sync with noxfile.py as
31+
# much as possible, however, GitHub Actions eventually drops support
32+
# for EOL Python versions, at which point we can't test them in CI.
33+
- uses: actions/setup-python@v5
3234
with:
33-
python-version: 3.7
34-
- uses: actions/setup-python@v4
35+
python-version: "3.7"
36+
- uses: actions/setup-python@v5
3537
with:
36-
python-version: 3.8
37-
- uses: actions/setup-python@v4
38+
python-version: "3.8"
39+
- uses: actions/setup-python@v5
3840
with:
39-
python-version: 3.9
40-
- uses: actions/setup-python@v4
41+
python-version: "3.9"
42+
- uses: actions/setup-python@v5
4143
with:
4244
python-version: "3.10"
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.11"
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.12"
51+
- uses: actions/setup-python@v5
52+
with:
53+
python-version: "3.13-dev"
4354

4455
# Check that the scripts work.
4556
- run: nox -s check --no-error-on-missing-interpreters

noxfile.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,22 @@
1010

1111
# Keep versions in sync with .github/workflows/check.yml
1212
@nox.session(
13-
python=["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
13+
python=[
14+
"2.6",
15+
"2.7",
16+
"3.2",
17+
"3.3",
18+
"3.4",
19+
"3.5",
20+
"3.6",
21+
"3.7",
22+
"3.8",
23+
"3.9",
24+
"3.10",
25+
"3.11",
26+
"3.12",
27+
"3.13",
28+
]
1429
)
1530
def check(session):
1631
"""Ensure that get-pip.py for various Python versions, works on that version."""

0 commit comments

Comments
 (0)