@@ -120,8 +120,8 @@ jobs:
120
120
PYO3_CROSS_LIB_DIR : /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib
121
121
run : |
122
122
cd examples/namespace_package
123
- pip install wheel
124
- python setup.py bdist_wheel
123
+ pip install build wheel
124
+ python -m build --no-isolation
125
125
ls -l dist/
126
126
pip install --force-reinstall dist/namespace_package*_universal2.whl
127
127
cd -
@@ -159,16 +159,18 @@ jobs:
159
159
160
160
- name : Build an abi3 wheel
161
161
shell : bash
162
+ env :
163
+ # https://github.com/actions/setup-python/issues/26
164
+ MACOSX_DEPLOYMENT_TARGET : 10.9
165
+ DIST_EXTRA_CONFIG : /tmp/build-opts.cfg
162
166
run : |
163
167
set -e
164
168
cd examples/rust_with_cffi/
165
169
python --version
166
- pip install -U wheel
167
- python setup.py bdist_wheel --py-limited-api=cp39
170
+ pip install -U build cffi wheel
171
+ echo -e "[bdist_wheel]\npy_limited_api=cp39" > $DIST_EXTRA_CONFIG
172
+ python -m build --no-isolation
168
173
ls -la dist/
169
- env :
170
- # https://github.com/actions/setup-python/issues/26
171
- MACOSX_DEPLOYMENT_TARGET : 10.9
172
174
173
175
# Now we switch to a differnet Python version and ensure we can install
174
176
# the wheel we just built.
@@ -222,12 +224,20 @@ jobs:
222
224
python3.9 -m pip install crossenv
223
225
python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv
224
226
. venv/bin/activate
225
- build-pip install cffi wheel "setuptools>=62.4"
227
+
228
+ build-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1
229
+ cross-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1
230
+ build-pip install cffi
226
231
cross-expose cffi
227
- pip install wheel
228
- pip install -e ../../
229
- python setup.py bdist_wheel --py-limited-api=cp37
232
+ cross-pip install -e ../../
233
+ cross-pip list
234
+
235
+ export DIST_EXTRA_CONFIG=/tmp/build-opts.cfg
236
+ echo -e "[bdist_wheel]\npy_limited_api=cp37" > $DIST_EXTRA_CONFIG
237
+
238
+ cross-pip wheel --no-build-isolation --no-deps --wheel-dir dist .
230
239
ls -la dist/
240
+ python -m zipfile -l dist/*.whl # debug all files inside wheel file
231
241
' > build-wheels.sh
232
242
233
243
docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheels.sh
@@ -269,12 +279,15 @@ jobs:
269
279
CARGO : cross
270
280
CARGO_BUILD_TARGET : aarch64-unknown-linux-gnu
271
281
PYO3_CROSS_LIB_DIR : /opt/python/cp38-cp38/lib
282
+ DIST_EXTRA_CONFIG : /tmp/build-opts.cfg
272
283
run : |
273
284
cd examples/namespace_package
274
285
docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
275
- python -m pip install wheel
276
- python setup.py bdist_wheel --plat-name manylinux2014_aarch64
286
+ python -m pip install build wheel
287
+ echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
288
+ python -m build --no-isolation
277
289
ls -la dist/
290
+ unzip -l dist/*.whl # debug all files inside wheel file
278
291
279
292
name : Install built wheel
280
293
with :
@@ -313,13 +326,16 @@ jobs:
313
326
CARGO : cargo-zigbuild
314
327
CARGO_BUILD_TARGET : aarch64-unknown-linux-gnu
315
328
PYO3_CROSS_LIB_DIR : /opt/python/cp38-cp38/lib
329
+ DIST_EXTRA_CONFIG : /tmp/build-opts.cfg
316
330
run : |
317
331
mkdir -p $PYO3_CROSS_LIB_DIR
318
332
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python
319
333
cd examples/namespace_package
320
- python -m pip install wheel
321
- python setup.py bdist_wheel --plat-name manylinux2014_aarch64
334
+ python -m pip install build wheel
335
+ echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
336
+ python -m build --no-isolation
322
337
ls -la dist/
338
+ unzip -l dist/*.whl # debug all files inside wheel file
323
339
324
340
name : Install built wheel
325
341
with :
@@ -346,9 +362,15 @@ jobs:
346
362
347
363
env :
348
364
CIBW_BUILD : cp39-*
349
- CIBW_BEFORE_BUILD : pip install -e .
365
+ CIBW_BEFORE_BUILD : pip install -U 'pip>=23.2.1' 'setuptools>=68.0.0' 'wheel<=0.37.1' && pip install -e . && pip list
366
+ # ^-- cap on `wheel` is a workaround for pypa/auditwheel#436
367
+ # setuptools needs to be upgraded before installing setuptools-rust
350
368
CIBW_ARCHS_MACOS : " x86_64 universal2 arm64"
351
- CIBW_BUILD_VERBOSITY : 1
369
+ CIBW_BUILD_VERBOSITY : 3
370
+ CIBW_BUILD_FRONTEND : pip # pip allows disabling isolation via env var
371
+ CIBW_ENVIRONMENT : PIP_NO_BUILD_ISOLATION=false
372
+ # ^-- necessary to use working copy of setuptools-rust,
373
+ # (however PIP_NO_BUILD_ISOLATION is counter-intuitive: see pypa/pip#5735)
352
374
with :
353
375
package-dir : examples/namespace_package
354
376
0 commit comments