Skip to content

Commit e4865c4

Browse files
committed
Make Python versions in GitHub Actions consistent
To ensure 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 wheels 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 the extension for PyPy on Windows, "generate-import-lib" in `Cargo.toml` is needed, as per this GitHub issue: PyO3/maturin-action#267 (comment)
1 parent c8d7b8a commit e4865c4

File tree

3 files changed

+71
-9
lines changed

3 files changed

+71
-9
lines changed

.github/workflows/CI.yml

+52-8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
3.11
5757
3.12
5858
3.13
59+
pypy3.9
5960
pypy3.10
6061
allow-prereleases: true
6162
- name: Set up uv
@@ -76,12 +77,21 @@ jobs:
7677
- uses: actions/checkout@v4
7778
- uses: actions/setup-python@v5
7879
with:
79-
python-version: "3.x"
80+
python-version: |
81+
3.8
82+
3.9
83+
3.10
84+
3.11
85+
3.12
86+
3.13
87+
pypy3.9
88+
pypy3.10
89+
allow-prereleases: true
8090
- name: Build wheels
8191
uses: PyO3/maturin-action@v1
8292
with:
8393
target: ${{ matrix.target }}
84-
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
94+
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
8595
sccache: "true"
8696
manylinux: auto
8797
- name: Upload wheels
@@ -103,12 +113,21 @@ jobs:
103113
- uses: actions/checkout@v4
104114
- uses: actions/setup-python@v5
105115
with:
106-
python-version: "3.x"
116+
python-version: |
117+
3.8
118+
3.9
119+
3.10
120+
3.11
121+
3.12
122+
3.13
123+
pypy3.9
124+
pypy3.10
125+
allow-prereleases: true
107126
- name: Build wheels
108127
uses: PyO3/maturin-action@v1
109128
with:
110129
target: ${{ matrix.target }}
111-
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
130+
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
112131
manylinux: musllinux_1_2
113132
sccache: "true"
114133
- name: Upload wheels
@@ -122,7 +141,7 @@ jobs:
122141
runs-on: windows-latest
123142
strategy:
124143
matrix:
125-
target: [x64, x86]
144+
target: [x64, x86] # x86 is not supported by pypy
126145
steps:
127146
- uses: actions/checkout@v4
128147
- uses: actions/setup-python@v5
@@ -133,12 +152,16 @@ jobs:
133152
3.10
134153
3.11
135154
3.12
155+
3.13
156+
${{ matrix.target == 'x64' && 'pypy3.9' || '' }}
157+
${{ matrix.target == 'x64' && 'pypy3.10' || '' }}
158+
allow-prereleases: true
136159
architecture: ${{ matrix.target }}
137160
- name: Build wheels
138161
uses: PyO3/maturin-action@v1
139162
with:
140163
target: ${{ matrix.target }}
141-
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12'
164+
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' || '' }}
142165
sccache: "true"
143166
- name: Upload wheels
144167
uses: actions/upload-artifact@v4
@@ -156,12 +179,21 @@ jobs:
156179
- uses: actions/checkout@v4
157180
- uses: actions/setup-python@v5
158181
with:
159-
python-version: "3.x"
182+
python-version: |
183+
3.8
184+
3.9
185+
3.10
186+
3.11
187+
3.12
188+
3.13
189+
pypy3.9
190+
pypy3.10
191+
allow-prereleases: true
160192
- name: Build wheels
161193
uses: PyO3/maturin-action@v1
162194
with:
163195
target: ${{ matrix.target }}
164-
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10'
196+
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
165197
sccache: "true"
166198
- name: Upload wheels
167199
uses: actions/upload-artifact@v4
@@ -174,6 +206,18 @@ jobs:
174206
runs-on: ubuntu-latest
175207
steps:
176208
- uses: actions/checkout@v4
209+
- uses: actions/setup-python@v5
210+
with:
211+
python-version: |
212+
3.8
213+
3.9
214+
3.10
215+
3.11
216+
3.12
217+
3.13
218+
pypy3.9
219+
pypy3.10
220+
allow-prereleases: true
177221
- name: Build an sdist
178222
uses: PyO3/maturin-action@v1
179223
with:

Cargo.lock

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ archery = "1.2.0"
1313

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

0 commit comments

Comments
 (0)