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 c8d7b8a commit e3741d6
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 9 deletions.
60 changes: 52 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
3.11
3.12
3.13
pypy3.9
pypy3.10
allow-prereleases: true
- name: Set up uv
Expand All @@ -76,12 +77,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 @@ -103,12 +113,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 @@ -122,7 +141,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 @@ -133,12 +152,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@v4
Expand All @@ -156,12 +179,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@v4
Expand All @@ -174,6 +206,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
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 e3741d6

Please sign in to comment.