Skip to content

Commit 4314e7b

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 4e60e2a commit 4314e7b

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
@@ -267,6 +267,7 @@ jobs:
267267
if: ${{ ! contains(matrix.spec, 'x86_64') }}
268268

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

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

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

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

@@ -505,36 +493,29 @@ jobs:
505493
name: ${{ needs.python_sdist.outputs.artifact_name }}
506494

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

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

0 commit comments

Comments
 (0)