Skip to content

Commit b15583c

Browse files
committed
🧪 Pass sdist into cibuildwheel directly
This patch also brings a copy of `cibuildwheel` in through the GitHub Actions interface instead of PyPI.
1 parent c9cd7fb commit b15583c

File tree

1 file changed

+21
-40
lines changed

1 file changed

+21
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ jobs:
265265
if: ${{ ! contains(matrix.spec, 'x86_64') }}
266266

267267
- name: build/test wheels
268+
uses: pypa/[email protected]
268269
env:
269270
CFLAGS: -Dffi_call=cffistatic_ffi_call # override name for ffi_call to break hard if we linked against someone else's libffi
270271
CIBW_ARCHS_LINUX: all
@@ -290,29 +291,21 @@ jobs:
290291
CIBW_PRERELEASE_PYTHONS: 'True'
291292
CIBW_TEST_REQUIRES: pytest setuptools # 3.12+ no longer includes distutils, just always ensure setuptools is present
292293
CIBW_TEST_COMMAND: PYTHONUNBUFFERED=1 python -m pytest ${{ matrix.test_args || '{project}' }} # default to test all
293-
run: |
294-
set -eux
295-
296-
mkdir cffi
297-
298-
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
299-
python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}"
300-
301-
# actually build libffi + wheel (using env tweaks above)
302-
python -m cibuildwheel --output-dir dist ./cffi
303-
304-
shell: bash
294+
with:
295+
package-dir: >-
296+
${{ steps.fetch_sdist.outputs.download-path
297+
}}/${{ needs.python_sdist.outputs.artifact_name }}
305298
306299
- name: determine built wheel filename
307300
id: built-artifact-lookup
308-
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
301+
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}"
309302
shell: bash -eEuxo pipefail {0}
310303

311304
- name: upload artifacts
312305
uses: actions/upload-artifact@v4
313306
with:
314307
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
315-
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
308+
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }}
316309
if-no-files-found: error
317310
if: ${{ env.skip_artifact_upload != 'true' }}
318311

@@ -408,34 +401,29 @@ jobs:
408401
brew uninstall --ignore-dependencies libffi 2>&1 || true
409402
410403
- name: build/test wheels
404+
uses: pypa/[email protected]
411405
env:
412406
CIBW_BUILD: ${{ matrix.spec }}
413407
CIBW_PRERELEASE_PYTHONS: 'True'
414408
CIBW_TEST_REQUIRES: pytest setuptools
415409
CIBW_TEST_COMMAND: pip install pip --upgrade; cd {project}; PYTHONUNBUFFERED=1 pytest
416410
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }}
417411
SDKROOT: ${{ matrix.sdkroot || 'macosx' }}
418-
run: |
419-
set -eux
420-
421-
mkdir cffi
422-
423-
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
424-
425-
python3 -m cibuildwheel --output-dir dist cffi
426-
427-
shell: bash
412+
with:
413+
package-dir: >-
414+
${{ steps.fetch_sdist.outputs.download-path
415+
}}/${{ needs.python_sdist.outputs.artifact_name }}
428416
429417
- name: determine built wheel filename
430418
id: built-artifact-lookup
431-
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
419+
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}"
432420
shell: bash -eEuxo pipefail {0}
433421

434422
- name: upload artifacts
435423
uses: actions/upload-artifact@v4
436424
with:
437425
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
438-
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
426+
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }}
439427
if-no-files-found: error
440428
if: ${{ env.skip_artifact_upload != 'true' }}
441429

@@ -503,36 +491,29 @@ jobs:
503491
name: ${{ needs.build_sdist.outputs.artifact_name }}
504492

505493
- name: build/test wheels
494+
uses: pypa/[email protected]
506495
env:
507496
CIBW_BUILD: ${{ matrix.spec }}
508497
CIBW_PRERELEASE_PYTHONS: 'True'
509498
CIBW_TEST_REQUIRES: pytest setuptools
510499
CIBW_TEST_COMMAND: 'python -m pytest {package}/src/c'
511500
# FIXME: /testing takes ~45min on Windows and has some failures...
512501
# CIBW_TEST_COMMAND='python -m pytest {package}/src/c {project}/testing'
513-
run: |
514-
set -eux
515-
516-
mkdir cffi
517-
518-
tar zxf cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
519-
520-
python -m pip install --upgrade pip
521-
pip install "${{ matrix.cibw_version || 'cibuildwheel'}}"
522-
python -m cibuildwheel --output-dir dist cffi
523-
524-
shell: bash
502+
with:
503+
package-dir: >-
504+
${{ steps.fetch_sdist.outputs.download-path
505+
}}/${{ needs.python_sdist.outputs.artifact_name }}
525506
526507
- name: determine built wheel filename
527508
id: built-artifact-lookup
528-
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
509+
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}"
529510
shell: bash -eEuxo pipefail {0}
530511

531512
- name: upload artifacts
532513
uses: actions/upload-artifact@v4
533514
with:
534515
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
535-
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
516+
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }}
536517
if-no-files-found: error
537518
if: ${{ env.skip_artifact_upload != 'true' }}
538519

0 commit comments

Comments
 (0)