diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index cebd52c9..406b3473 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -6,9 +6,21 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + # Build all wheels on either: + # - tagged release + # - pull request opened with "test all wheels" label + # - pull requests when "test all wheels" label is added + BUILD_ALL: | + ${{ + (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')) + || contains(github.event.pull_request.labels.*.name, 'test all wheels') + || (github.event.action == 'labeled' && github.event.label.name == 'test all wheels') + }} + jobs: build_wheels: - name: Build wheel on ${{ matrix.os }} + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -18,7 +30,9 @@ jobs: env: CIBW_TEST_COMMAND: python -c "import numcodecs" CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" - CIBW_SKIP: "pp* *-musllinux_* *win32 *_i686 *_s390x" + CIBW_ARCHS_MACOS: native + CIBW_ARCHS_WINDOWS: native + CIBW_ARCHS_LINUX: "x86_64 aarch64" # note: CIBW_ENVIRONMENT is now set in pyproject.toml steps: @@ -26,6 +40,15 @@ jobs: with: submodules: true + - name: Restrict number of wheel builds on PRs + if: ${{ !env.BUILD_ALL }} + run: | + echo "CIBW_BUILD=cp310-win_amd64 cp311-manylinux_x86_64 cp312-macosx_x86_64 cp312-macosx_arm64" >> $GITHUB_ENV + + - name: Set up QEMU + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: docker/setup-qemu-action@v3 + - uses: pypa/cibuildwheel@v2.21.2 - uses: actions/upload-artifact@v4 diff --git a/docs/release.rst b/docs/release.rst index 434c811f..1a1dbec9 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -25,6 +25,8 @@ Enhancements * Update bundled c-blosc to v1.26.1. This updates Zlib to v1.3.1 and Zstd to v1.5.6. By :user:`David Stansby `, :issue:`560`. +* Build aarch64 wheels on linuxL + By :user:`David Stansby `, :issue:`531` Fix ~~~ @@ -38,6 +40,13 @@ Maintenance * Remove pin on Sphinx By :user:`Elliott Sales de Andrade `, :issue:`552`. +* Restrict the number of wheels built on pull requests. + By :user:`David Stansby `, :issue:`531` + +* Add an option to build all wheels on pull requests by adding + the 'build all wheels' label. + By :user:`David Stansby `, :issue:`531` + .. _release_0.13.0: diff --git a/setup.py b/setup.py index 815224aa..9f71d696 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,9 @@ if have_cflags: # respect compiler options set by user pass -elif os.name == 'posix': +elif os.name == 'posix' and os.uname()[4] != 'aarch64': + # These flags aren't recognised by gcc on aarch64 + # (at least when we build the aarch64 wheens on GitHub actions) if disable_sse2: base_compile_args.append('-mno-sse2') elif have_sse2: