diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 6746ffb8..bb3b5258 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: "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.22.0 - uses: actions/upload-artifact@v4 diff --git a/docs/release.rst b/docs/release.rst index 68a751d3..a070530c 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -43,7 +43,8 @@ Improvements Import errors caused by optional dependencies (ZFPY, MsgPack, CRC32C, and PCodec) are still silently caught. By :user:`David Stansby `, :issue:`550`. - +* Build aarch64 wheels on linux. + By :user:`David Stansby `, :issue:`531` 0.14.1 ------ @@ -116,6 +117,10 @@ Enhancements * Cleaned up the table of contents in the documentation to list codecs by category :user:`David Stansby `, :issue:`458`. +Fix +~~~ + + Maintenance ~~~~~~~~~~~ * Change format() and old string formatting to f-strings. @@ -123,6 +128,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 0f5ec481..8d844de7 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: