-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧪 Pass sdist into
cibuildwheel
directly
This patch also brings a copy of `cibuildwheel` in through the GitHub Actions interface instead of PyPI.
- Loading branch information
Showing
1 changed file
with
23 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,7 @@ jobs: | |
if: ${{ ! contains(matrix.spec, 'x86_64') }} | ||
|
||
- name: build/test wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CFLAGS: -Dffi_call=cffistatic_ffi_call # override name for ffi_call to break hard if we linked against someone else's libffi | ||
CIBW_ARCHS_LINUX: all | ||
|
@@ -292,29 +293,21 @@ jobs: | |
CIBW_PRERELEASE_PYTHONS: 'True' | ||
CIBW_TEST_REQUIRES: pytest setuptools # 3.12+ no longer includes distutils, just always ensure setuptools is present | ||
CIBW_TEST_COMMAND: PYTHONUNBUFFERED=1 python -m pytest ${{ matrix.test_args || '{project}' }} # default to test all | ||
run: | | ||
set -eux | ||
mkdir cffi | ||
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi | ||
python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" | ||
# actually build libffi + wheel (using env tweaks above) | ||
python -m cibuildwheel --output-dir dist ./cffi | ||
shell: bash | ||
with: | ||
package-dir: >- | ||
${{ steps.fetch_sdist.outputs.download-path | ||
}}/${{ needs.python_sdist.outputs.artifact_name }} | ||
- name: determine built wheel filename | ||
id: built-artifact-lookup | ||
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}" | ||
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}" | ||
shell: bash -eEuxo pipefail {0} | ||
|
||
- name: upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
if-no-files-found: error | ||
if: ${{ env.skip_artifact_upload != 'true' }} | ||
|
||
|
@@ -404,40 +397,33 @@ jobs: | |
# built-in virtualenv/pip are pinned to busted versions that fail on newer Pythons | ||
|
||
- name: build wheel prereqs | ||
run: | | ||
set -eux | ||
python3 -m pip install --user --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" | ||
brew uninstall --ignore-dependencies libffi 2>&1 || true | ||
run: brew uninstall --ignore-dependencies libffi 2>&1 || true | ||
shell: bash -eux {0} | ||
|
||
- name: build/test wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.spec }} | ||
CIBW_PRERELEASE_PYTHONS: 'True' | ||
CIBW_TEST_REQUIRES: pytest setuptools | ||
CIBW_TEST_COMMAND: pip install pip --upgrade; cd {project}; PYTHONUNBUFFERED=1 pytest | ||
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }} | ||
SDKROOT: ${{ matrix.sdkroot || 'macosx' }} | ||
run: | | ||
set -eux | ||
mkdir cffi | ||
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi | ||
python3 -m cibuildwheel --output-dir dist cffi | ||
shell: bash | ||
with: | ||
package-dir: >- | ||
${{ steps.fetch_sdist.outputs.download-path | ||
}}/${{ needs.python_sdist.outputs.artifact_name }} | ||
- name: determine built wheel filename | ||
id: built-artifact-lookup | ||
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}" | ||
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}" | ||
shell: bash -eEuxo pipefail {0} | ||
|
||
- name: upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
if-no-files-found: error | ||
if: ${{ env.skip_artifact_upload != 'true' }} | ||
|
||
|
@@ -505,36 +491,29 @@ jobs: | |
name: ${{ needs.python_sdist.outputs.artifact_name }} | ||
|
||
- name: build/test wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.spec }} | ||
CIBW_PRERELEASE_PYTHONS: 'True' | ||
CIBW_TEST_REQUIRES: pytest setuptools | ||
CIBW_TEST_COMMAND: 'python -m pytest {package}/src/c' | ||
# FIXME: /testing takes ~45min on Windows and has some failures... | ||
# CIBW_TEST_COMMAND='python -m pytest {package}/src/c {project}/testing' | ||
run: | | ||
set -eux | ||
mkdir cffi | ||
tar zxf cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi | ||
python -m pip install --upgrade pip | ||
pip install "${{ matrix.cibw_version || 'cibuildwheel'}}" | ||
python -m cibuildwheel --output-dir dist cffi | ||
shell: bash | ||
with: | ||
package-dir: >- | ||
${{ steps.fetch_sdist.outputs.download-path | ||
}}/${{ needs.python_sdist.outputs.artifact_name }} | ||
- name: determine built wheel filename | ||
id: built-artifact-lookup | ||
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}" | ||
run: echo "artifact_name=$(ls ./wheelhouse/)" >> "${GITHUB_OUTPUT}" | ||
shell: bash -eEuxo pipefail {0} | ||
|
||
- name: upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
path: wheelhouse/${{ steps.built-artifact-lookup.outputs.artifact_name }} | ||
if-no-files-found: error | ||
if: ${{ env.skip_artifact_upload != 'true' }} | ||
|
||
|