120 words
1 minute
Testing against Python 3.11 preview using GitHub Actions

Testing against Python 3.11 preview using GitHub Actions#

I decided to run my CI tests against the Python 3.11 preview, to avoid the problem I had when Python 3.10 came out with a bug that affected Datasette.

I used the new GitHub Code Search to figure out how to do this. I searched for:

3.11 path:workflows/*.yml

And found this example from urllib3 which showed that the version tag to use is:

3.11-dev

Update 28th Noveber 2022: 3.12-dev now works for Python 3.12 preview

I added that to my test matrix like so:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# ...

Here’s the full workflow.

Testing against Python 3.11 preview using GitHub Actions
https://mranv.pages.dev/posts/testing-against-python-311-preview-using-github-actions/
Author
Anubhav Gain
Published at
2024-11-24
License
CC BY-NC-SA 4.0