-
Notifications
You must be signed in to change notification settings - Fork 555
MAINT: Switch to GHA cibuildwheel #2444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
a1e2dfe
MAINT: Switch to GHA cibuildwheel
larsoner c435823
FIX: More
larsoner 9868e0d
FIX: Where
larsoner 1d65366
FIX: Select
larsoner 33b43aa
FIX: More
larsoner 9f14895
FIX: Need
larsoner 042c9f1
FIX: Syntax
larsoner c931d7e
FIX: Closer
larsoner 927405d
FIX: Path
larsoner 84f5c12
FIX: More
larsoner ca1c9c1
FIX: Pass
larsoner 1fdc617
FIX: Pass through manually
larsoner 372a023
FIX: Pass it on
larsoner d05e61e
FIX: Try another
larsoner d8406bc
FIX: Try another
larsoner 8af2c85
FIX: Fix macOS
larsoner 87cf54c
WIP: Test fix
larsoner 7865d7f
FIX: Windows
larsoner 1293287
FIX: Need coverage
larsoner d6e5c27
FIX: Windows
larsoner 18ff07a
FIX: Selector
larsoner 64b38e9
FIX: Order
larsoner 51bb92d
FIX: Try installing a usable 3.8
larsoner c575df4
FIX: Path
larsoner 8b09400
FIX: More
larsoner b01ea11
FIX: Quote
larsoner d6a921c
FIX: Archs
larsoner c0c4ca0
FIX: Speed up aarch64
larsoner 41b2ae8
TST: Test pip-pre [pip-pre]
larsoner 27e7828
FIX: Need wheel [pip-pre]
larsoner 4e91be9
FIX: Shell
larsoner b527565
FIX: Skip [pip-pre]
larsoner 707c04a
MAINT: Remove [pip-pre]
larsoner 6eba64b
MAINT: Remove better [pip-pre]
larsoner a6593f1
TST: Test aarch [aarch64]
larsoner 7c5f36b
TST: Regular PR mode
larsoner 6e67427
TST: Dev [pip-pre]
larsoner e4e92a8
TST: aarch64 [aarch64]
larsoner cafbdde
FIX: Just one dev is enough
larsoner ae2f10c
Update setup_configure.py
larsoner d8d4d19
FIX: Tweak test
larsoner 1c07912
FIX: Correct test
larsoner 4e67388
WIP: Reenable failing test and debug it
larsoner 6f835e3
FIX: Restore
larsoner a8db9a6
ENH: Add Python 3.13 to nightly [pip-pre]
larsoner 31d63b9
Merge remote-tracking branch 'upstream/master' into gha
larsoner d4af36f
MAINT: Catch up with prerelease [pip-pre]
larsoner da89e0d
TST: Maybe too fast? [pip-pre]
larsoner fae1e0f
TST: Just checking in
larsoner a60d567
FIX: Oh right 11 is gone
larsoner 16b019f
Apply suggestions from code review
larsoner 88e6b6c
DOC: Docs
larsoner cd92e07
FIX: Comment
larsoner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| --- | ||
| name: Build | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| # Adapted from https://github.com/matplotlib/matplotlib/blob/main/.github/workflows/nightlies.yml | ||
| # and https://cibuildwheel.pypa.io/en/stable/setup/#github-actions | ||
|
|
||
| # 1. Move as much as possible to pyproject.toml instead of using env vars | ||
| # 2. Use native compiling for macOS via -13 (Intel) and -14 (arm) runners | ||
| # 3. For aarch64, only ever test py312 and skip testing other python versions | ||
| # (for speed). | ||
| # 4. Split aarch64 python version builds over jobs, for all other systems/archs build | ||
| # wheels for all Python versions in a single job (for speed). | ||
| # 5. On pushes, build and test all wheels and push as release artifacts (in | ||
| # draft mode for main branch pushes). | ||
| # 6. On scheduled runs, build and test all wheels against | ||
| # scientific-python-nightly-wheels NumPy dev, then upload the resulting wheels there. | ||
| # 7. On PRs, only build one aarch64 wheel (for speed). | ||
| # 8. On PRs, build against NumPy dev if [pip-pre] is in the commit message. | ||
| # 9. On PRs, build all aarch64 variants if [aarch64] is in the commit message. | ||
|
|
||
| on: | ||
| # Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud | ||
| schedule: | ||
| - cron: '23 1 * * *' | ||
| # Run on demand with workflow dispatch | ||
| workflow_dispatch: | ||
| # Run on all PRs | ||
| pull_request: | ||
| # Run on tags | ||
| push: | ||
| branches: | ||
| - master | ||
| tags: | ||
| - '*' | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build_wheels: | ||
| name: 'Wheels: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.python }}' | ||
| runs-on: ${{ matrix.os }} | ||
| continue-on-error: true | ||
| strategy: | ||
| matrix: | ||
| # Wheel builds are fast except for aarch64, so split that into multiple jobs, | ||
| # one for each Python version | ||
| os: [ubuntu-latest] | ||
| arch: [aarch64] | ||
| python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| include: | ||
| - os: ubuntu-latest | ||
| arch: x86_64 | ||
| - os: windows-latest | ||
| arch: AMD64 | ||
| - os: macos-14 | ||
| arch: arm64 | ||
| - os: macos-13 | ||
| arch: x86_64 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # get the non-merge commit for PRs | ||
|
|
||
| # Get HDF5 outside of cibuildwheel so that we can set env vars via GITHUB_ENV | ||
| # inside the HDF5-getting scripts and have them be in effect for the | ||
| # cibuildwheel step. | ||
|
|
||
| # Cache HDF5 | ||
| - name: Cache built HDF5 | ||
| uses: actions/cache@v4 | ||
| with: | ||
| key: ${{ matrix.os }}-${{ matrix.arch }}-6 | ||
| path: cache/hdf5 | ||
|
|
||
| # Windows HDF5 | ||
| - uses: nuget/setup-nuget@v2 | ||
| if: runner.os == 'Windows' | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.12 | ||
| if: runner.os == 'Windows' | ||
| - run: bash ./ci/cibw_before_all_windows.sh "${{ github.workspace }}" | ||
| if: runner.os == 'Windows' | ||
|
|
||
| # macOS HDF5 | ||
| - run: bash ./ci/cibw_before_all_macos.sh "${{ github.workspace }}" | ||
| if: runner.os == 'macOS' | ||
| # Hack for 3.8 bug (https://github.com/pypa/cibuildwheel/pull/1871#issuecomment-2161613619) | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.8 | ||
| if: runner.os == 'macOS' && matrix.arch == 'arm64' | ||
|
|
||
| # Linux emulation for aarch64 support | ||
| # https://cibuildwheel.pypa.io/en/stable/faq/#emulation | ||
| - uses: docker/setup-qemu-action@v3 | ||
| with: | ||
| platforms: all | ||
| if: runner.os == 'Linux' && matrix.arch == 'aarch64' | ||
|
|
||
| # Triage build, and set outputs.skip = 1 if on aarch64 and we don't want to build the wheel | ||
| - run: bash ./ci/triage_build.sh "${{ matrix.arch }}" "${{ github.event.pull_request.head.sha || github.sha }}" "${{ matrix.python }}" | ||
| id: triage | ||
|
|
||
| # Now actually build the wheels | ||
| - uses: pypa/[email protected] | ||
| env: | ||
| # Note that tool.cibuildwheel "skip" in pyproject.toml also limits what gets built | ||
| CIBW_ARCHS: ${{ matrix.arch }} | ||
| CIBW_BUILD: ${{ env.CIBW_BUILD }} | ||
| CIBW_SKIP: ${{ env.CIBW_SKIP }} | ||
| CIBW_BEFORE_BUILD: ${{ env.CIBW_BEFORE_BUILD }} | ||
| CIBW_BUILD_FRONTEND: ${{ env.CIBW_BUILD_FRONTEND }} | ||
| TOX_TEST_LIMITED: ${{ env.TOX_TEST_LIMITED }} | ||
| CIBW_PRERELEASE_PYTHONS: ${{ env.CIBW_PRERELEASE_PYTHONS }} | ||
| CIBW_BEFORE_TEST: ${{ env.CIBW_BEFORE_TEST }} | ||
| if: steps.triage.outputs.skip != '1' | ||
|
|
||
| # And upload the results | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
| path: ./wheelhouse/*.whl | ||
| if: steps.triage.outputs.skip != '1' | ||
|
|
||
| upload_wheels: | ||
| name: Upload wheels | ||
| needs: build_wheels | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: cibw-wheels-* | ||
| merge-multiple: true | ||
| path: dist | ||
| - run: pwd && ls -alt . && ls -alt dist/ | ||
| # If it's a PR, do nothing else. | ||
| # If it's a scheduled run, it was built with nightly NumPy, push to scientific-python: | ||
| - name: Upload wheels to Anaconda Cloud as nightlies | ||
| uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0 | ||
| with: | ||
| artifacts_path: dist | ||
| anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} | ||
| if: github.repository_owner == 'h5py' && github.event_name == 'schedule' | ||
| # If it's a push to master, create a (private) draft release; | ||
| # If it's a tag, publish it to the existing public release, knowing that the tag name | ||
| # is the same as th release name: | ||
| - name: Set release variables | ||
| id: vars | ||
| run: | | ||
| set -eo pipefail | ||
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | ||
| RELEASE_NAME="" # will use the tag name, which we always set to the release name | ||
| GENERATE=false | ||
| else | ||
| RELEASE_NAME=dev | ||
| GENERATE=true | ||
| fi | ||
| echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT | ||
| echo "generate=$GENERATE" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Upload to GitHub releases | ||
| uses: softprops/action-gh-release@v2 | ||
| # https://github.com/softprops/action-gh-release?tab=readme-ov-file#inputs | ||
| with: | ||
| name: ${{ steps.vars.outputs.release_name }} | ||
| # Note that draft releases are not public | ||
| draft: ${{ github.ref_type != 'tag' }} | ||
| prerelease: ${{ github.ref_type != 'tag' }} | ||
| generate_release_notes: ${{ steps.vars.outputs.generate }} | ||
| files: | | ||
| dist/*.whl | ||
| if: github.repository_owner == 'h5py' && github.event_name == 'push' |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ MANIFEST | |
| coverage.xml | ||
| .vscode/ | ||
| .mypy_cache/ | ||
| /cache/ | ||
|
|
||
| # Rever | ||
| rever/ | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -34,19 +34,6 @@ jobs: | |
| - HDF5_VERSION=1.10.5 | ||
| - HDF5_DIR=$HDF5_CACHE_DIR/$HDF5_VERSION | ||
| - H5PY_ENFORCE_COVERAGE=yes | ||
| - arch: arm64 | ||
| services: docker | ||
| python: 3.9 | ||
| virt: vm | ||
| env: | ||
| - TOXENV=py39-test-deps | ||
| - TOX_OPTS="" | ||
| - HDF5_VERSION=1.10.5 | ||
| - HDF5_DIR=$HDF5_CACHE_DIR/$HDF5_VERSION | ||
| - H5PY_ENFORCE_COVERAGE=yes | ||
| - CIBW_BUILD: cp3*-manylinux* | ||
| - CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/h5py/manylinux2014_aarch64-hdf5 | ||
| - CIBW_ARCHS: aarch64 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a couple more aarch64-specific bits further down in this file, which could be cleaned up now that we're only using Travis for ppc64le. |
||
| before_install: | ||
| # - export PATH=/usr/lib/ccache:$PATH | ||
| - ccache -s | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.