Skip to content

Commit

Permalink
Test against Python 3.11, 3.12 and 3.13 in CI
Browse files Browse the repository at this point in the history
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
  • Loading branch information
edmorley authored and pradyunsg committed Apr 14, 2024
1 parent d2d4c18 commit b736d40
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: "are correctly generated"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install nox

- run: nox -s generate
Expand All @@ -23,23 +23,34 @@ jobs:
name: "work as advertised"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install nox

# Install supported Python versions
- uses: actions/setup-python@v4
# Install supported Python versions. Keep in sync with noxfile.py as
# much as possible, however, GitHub Actions eventually drops support
# for EOL Python versions, at which point we can't test them in CI.
- uses: actions/setup-python@v5
with:
python-version: 3.7
- uses: actions/setup-python@v4
python-version: "3.7"
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/setup-python@v4
python-version: "3.8"
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/setup-python@v4
python-version: "3.9"
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/setup-python@v5
with:
python-version: "3.13-dev"

# Check that the scripts work.
- run: nox -s check --no-error-on-missing-interpreters
17 changes: 16 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@

# Keep versions in sync with .github/workflows/check.yml
@nox.session(
python=["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
python=[
"2.6",
"2.7",
"3.2",
"3.3",
"3.4",
"3.5",
"3.6",
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]
)
def check(session):
"""Ensure that get-pip.py for various Python versions, works on that version."""
Expand Down

0 comments on commit b736d40

Please sign in to comment.