Skip to content

Commit

Permalink
Make Python versions in GitHub Actions consistent
Browse files Browse the repository at this point in the history
Consistently use the following Python versions everywhere in CI:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- pypy3.9
- pypy3.10

The heels for Python 3.13 are beneficial for dependent packages such as
`jsonschema`.

Note that PyPy3.8 was dropped since the PyPy website
(https://www.pypy.org/) states they currently support Python versions
3.10, 3.9, and 2.7.

To build extension for PyPy on Windows, "generate-import-lib" in
`Cargo.toml` is needed:
PyO3/maturin-action#267 (comment)
  • Loading branch information
rominf committed Jul 10, 2024
1 parent 0b6ea67 commit 2ef7ab8
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 10 deletions.
71 changes: 62 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- uses: pre-commit/[email protected]

list:
Expand Down Expand Up @@ -64,6 +73,7 @@ jobs:
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Set up nox
Expand All @@ -81,12 +91,21 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
sccache: "true"
manylinux: auto
- name: Upload wheels
Expand All @@ -108,12 +127,21 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
manylinux: musllinux_1_2
sccache: "true"
- name: Upload wheels
Expand All @@ -127,7 +155,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
target: [x64, x86] # x86 is not supported by pypy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -138,12 +166,16 @@ jobs:
3.10
3.11
3.12
3.13
${{ matrix.target == 'x64' && 'pypy3.9' || '' }}
${{ matrix.target == 'x64' && 'pypy3.10' || '' }}
allow-prereleases: true
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12'
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13' -- interpreter ${{ matrix.target == 'x64' && 'pypy3.9 pypy3.10' || '' }}
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -161,12 +193,21 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -179,6 +220,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Build an sdist
uses: PyO3/maturin-action@v1
with:
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ archery = "1.2.0"

[dependencies.pyo3]
version = "0.22.1"
features = ["extension-module"]
# To build extension for PyPy on Windows, "generate-import-lib" is needed:
# https://github.com/PyO3/maturin-action/issues/267#issuecomment-2106844429
features = ["extension-module", "generate-import-lib"]

0 comments on commit 2ef7ab8

Please sign in to comment.