15
15
steps :
16
16
- uses : actions/checkout@v4
17
17
18
- - name : Set up Python ${{ matrix.python-version }}
18
+ - name : Set up Python
19
19
uses : actions/setup-python@v5
20
20
with :
21
21
python-version : " 3.x"
29
29
steps :
30
30
- uses : actions/checkout@v4
31
31
32
- - name : Set up Python ${{ matrix.python-version }}
32
+ - name : Set up Python
33
33
uses : actions/setup-python@v5
34
34
with :
35
35
python-version : " 3.x"
43
43
steps :
44
44
- uses : actions/checkout@v4
45
45
46
- - name : Set up Python ${{ matrix.python-version }}
46
+ - name : Set up Python
47
47
uses : actions/setup-python@v5
48
48
with :
49
49
python-version : " 3.x"
@@ -56,32 +56,59 @@ jobs:
56
56
- run : nox -s test
57
57
58
58
build :
59
- name : ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
59
+ name : ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
60
60
runs-on : ${{ matrix.platform.os }}
61
61
strategy :
62
62
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
63
63
fail-fast : ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
64
64
matrix :
65
- python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.8, pypy-3.9, pypy-3.10]
66
- platform : [
67
- { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
68
- { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
69
- { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
70
- ]
65
+ python-version :
66
+ ["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.9, pypy-3.10]
67
+ platform :
68
+ [
69
+ {
70
+ os : " macos-latest" ,
71
+ python-architecture : " arm64" ,
72
+ rust-target : " aarch64-apple-darwin" ,
73
+ },
74
+ {
75
+ os : " ubuntu-latest" ,
76
+ python-architecture : " x64" ,
77
+ rust-target : " x86_64-unknown-linux-gnu" ,
78
+ },
79
+ {
80
+ os : " windows-latest" ,
81
+ python-architecture : " x64" ,
82
+ rust-target : " x86_64-pc-windows-msvc" ,
83
+ },
84
+ ]
71
85
include :
72
86
# Just test one x86 Windows Python for simplicity
73
87
- python-version : 3.12
74
- platform : { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
88
+ platform :
89
+ {
90
+ os : " windows-latest" ,
91
+ python-architecture : " x86" ,
92
+ rust-target : " i686-pc-windows-msvc" ,
93
+ }
75
94
# Just test one x64 macOS Python for simplicity
76
95
- python-version : 3.12
77
- platform : { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }
96
+ platform :
97
+ {
98
+ os : " macos-13" ,
99
+ python-architecture : " x64" ,
100
+ rust-target : " x86_64-apple-darwin" ,
101
+ }
78
102
# Just test one x64 macOS Python for simplicity
79
103
exclude :
80
104
# macOS arm doesn't have Python builds before 3.10
81
105
- python-version : 3.9
82
- platform : { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
83
- - python-version : 3.8
84
- platform : { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
106
+ platform :
107
+ {
108
+ os : " macos-latest" ,
109
+ python-architecture : " arm64" ,
110
+ rust-target : " aarch64-apple-darwin" ,
111
+ }
85
112
86
113
steps :
87
114
- uses : actions/checkout@v4
@@ -114,7 +141,7 @@ jobs:
114
141
if : ${{ startsWith(matrix.platform.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
115
142
shell : bash
116
143
env :
117
- MACOSX_DEPLOYMENT_TARGET : ' 10.9'
144
+ MACOSX_DEPLOYMENT_TARGET : " 10.9"
118
145
ARCHFLAGS : -arch x86_64 -arch arm64
119
146
run : |
120
147
rustup target add aarch64-apple-darwin
@@ -199,12 +226,13 @@ jobs:
199
226
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
200
227
fail-fast : ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
201
228
matrix :
202
- platform : [
203
- { arch: "aarch64" },
204
- { arch: "armv7" },
205
- ]
229
+ platform : [{ arch: "aarch64" }, { arch: "armv7" }]
206
230
steps :
207
231
- uses : actions/checkout@v4
232
+ - name : Set up Python
233
+ uses : actions/setup-python@v5
234
+ with :
235
+ python-version : " 3.x"
208
236
- uses : docker/setup-qemu-action@v3
209
237
- run : pip install nox
210
238
- run : nox -s test-crossenv -- ${{ matrix.platform.arch }}
@@ -216,7 +244,7 @@ jobs:
216
244
- name : Setup python
217
245
uses : actions/setup-python@v5
218
246
with :
219
- python-version : 3.8
247
+ python-version : " 3.10 " # must match the ubuntu version in the install, and also the STANDALONE_PYTHON_VERSION below
220
248
- uses : dtolnay/rust-toolchain@stable
221
249
- name : Install cross
222
250
uses : taiki-e/install-action@v2
@@ -229,12 +257,16 @@ jobs:
229
257
env :
230
258
CARGO : cross
231
259
CARGO_BUILD_TARGET : aarch64-unknown-linux-gnu
232
- PYO3_CROSS_LIB_DIR : /opt/python/cp38-cp38 /lib
260
+ PYO3_CROSS_LIB_DIR : /opt/python/cp310-cp310 /lib
233
261
DIST_EXTRA_CONFIG : /tmp/build-opts.cfg
234
262
run : |
235
263
cd examples/namespace_package
236
- docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
237
- python -m pip install build
264
+ docker build \
265
+ --build-arg STANDALONE_PYTHON_VERSION=3.10.15 \
266
+ --build-arg STANDALONE_PYTHON_RELEASE=20241016 \
267
+ -t cross-pyo3:aarch64-unknown-linux-gnu \
268
+ .
269
+ python -m pip install build wheel
238
270
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
239
271
python -m build --no-isolation
240
272
ls -la dist/
@@ -243,17 +275,19 @@ jobs:
243
275
name : Install built wheel
244
276
with :
245
277
arch : aarch64
246
- distro : ubuntu20 .04
278
+ distro : ubuntu22 .04
247
279
dockerRunArgs : |
248
280
--volume "${PWD}/examples/namespace_package:/io"
249
281
install : |
250
282
apt-get update
251
- apt-get install -y --no-install-recommends python3 python3-pip
283
+ apt-get install -y --no-install-recommends python3 python3-venv python3- pip
252
284
pip3 install -U pip
253
285
run : |
254
- pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
255
- python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
256
- python3 -c "from namespace_package import python; assert python.python_func() == 15"
286
+ python3 -m venv .venv
287
+ source .venv/bin/activate
288
+ pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
289
+ python -c "from namespace_package import rust; assert rust.rust_func() == 14"
290
+ python -c "from namespace_package import python; assert python.python_func() == 15"
257
291
258
292
test-zigbuild :
259
293
runs-on : ubuntu-latest
@@ -262,7 +296,7 @@ jobs:
262
296
- name : Setup python
263
297
uses : actions/setup-python@v5
264
298
with :
265
- python-version : 3.8
299
+ python-version : " 3.10 " # must match the ubuntu version in the install, and also the version copied out of the docker image below
266
300
- uses : dtolnay/rust-toolchain@stable
267
301
with :
268
302
targets : aarch64-unknown-linux-gnu
@@ -276,13 +310,13 @@ jobs:
276
310
env :
277
311
CARGO : cargo-zigbuild
278
312
CARGO_BUILD_TARGET : aarch64-unknown-linux-gnu
279
- PYO3_CROSS_LIB_DIR : /opt/python/cp38-cp38 /lib
313
+ PYO3_CROSS_LIB_DIR : /opt/python/cp310-cp310 /lib
280
314
DIST_EXTRA_CONFIG : /tmp/build-opts.cfg
281
315
run : |
282
316
mkdir -p $PYO3_CROSS_LIB_DIR
283
- docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python
317
+ docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp310-cp310 /opt/python
284
318
cd examples/namespace_package
285
- python -m pip install build
319
+ python -m pip install build wheel
286
320
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
287
321
python -m build --no-isolation
288
322
ls -la dist/
@@ -291,17 +325,18 @@ jobs:
291
325
name : Install built wheel
292
326
with :
293
327
arch : aarch64
294
- distro : ubuntu20 .04
328
+ distro : ubuntu22 .04
295
329
dockerRunArgs : |
296
330
--volume "${PWD}/examples/namespace_package:/io"
297
331
install : |
298
332
apt-get update
299
- apt-get install -y --no-install-recommends python3 python3-pip
300
- pip3 install -U pip
333
+ apt-get install -y --no-install-recommends python3 python3-venv python3-pip
301
334
run : |
302
- pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
303
- python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
304
- python3 -c "from namespace_package import python; assert python.python_func() == 15"
335
+ python3 -m venv .venv
336
+ source .venv/bin/activate
337
+ pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
338
+ python -c "from namespace_package import rust; assert rust.rust_func() == 14"
339
+ python -c "from namespace_package import python; assert python.python_func() == 15"
305
340
306
341
test-cibuildwheel :
307
342
runs-on : macos-latest
@@ -325,14 +360,25 @@ jobs:
325
360
326
361
test-mingw :
327
362
runs-on : windows-latest
328
- name : ${{ matrix.python-version }} mingw-${{ matrix.arch }}
363
+ name : ${{ matrix.python-version }} mingw-${{ matrix.arch }}
329
364
strategy :
330
365
fail-fast : false
331
366
matrix :
332
- include : [
333
- { msystem: MINGW64, arch: x86_64, path: mingw64, rust_target: x86_64-pc-windows-gnu },
334
- { msystem: MINGW32, arch: i686, path: mingw32, rust_target: i686-pc-windows-gnu }
335
- ]
367
+ include :
368
+ [
369
+ {
370
+ msystem : MINGW64,
371
+ arch : x86_64,
372
+ path : mingw64,
373
+ rust_target : x86_64-pc-windows-gnu,
374
+ },
375
+ {
376
+ msystem : MINGW32,
377
+ arch : i686,
378
+ path : mingw32,
379
+ rust_target : i686-pc-windows-gnu,
380
+ },
381
+ ]
336
382
steps :
337
383
- uses : actions/checkout@v4
338
384
- name : Install MSys2 and dependencies
0 commit comments