From 9c7948801323d1d87ac229be83a508d80373bd66 Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Thu, 6 Mar 2025 21:22:42 +0100 Subject: [PATCH 1/3] build_dist - add arm support --- .github/workflows/build_dist.yml | 44 ++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index 879db7d..5cf0451 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -26,10 +26,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.x - - name: Install setuptools - run: pip install setuptools - name: Build sdist - run: python setup.py sdist + run: pipx run build --sdist - name: Save sdist uses: actions/upload-artifact@v4 with: @@ -72,11 +70,47 @@ jobs: # CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" CIBW_ARCHS_LINUX: "x86_64 i686" CIBW_ARCHS_MACOS: "auto64" # since we have both runner arches - CIBW_ARCHS_WINDOWS: "AMD64 x86" + CIBW_ARCHS_WINDOWS: "AMD64 x86 ARM64" + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "cp*-musllinux*" + CIBW_TEST_COMMAND: "tox -c {project}" + CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{aarch64,ppc64le,s390x} *-win_arm64" + CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox" + - name: Save wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + wheels_linux_arm: + name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }} + runs-on: ${{ matrix.os }} + strategy: + # since multiple builds run at the same time, cancelling them all when one + # fails is wasteful and forces handling build problems one by one instead + # of showing a "full picture" + fail-fast: false + matrix: + os: + - ubuntu-latest-arm + cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*] + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work + - name: Install Python 3.x + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: pypa/cibuildwheel@v2.21 + env: + CIBW_ENVIRONMENT: PYLZ4_USE_SYSTEM_LZ4="False" + CIBW_ARCHS_LINUX: "aarch64 armv7l" CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_SKIP: "cp*-musllinux*" CIBW_TEST_COMMAND: "tox -c {project}" - CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{aarch64,ppc64le,s390x}" CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox" - name: Save wheels uses: actions/upload-artifact@v4 From 2ddf2811ce7375fe93f9f2470771bccc6ebfde76 Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Thu, 6 Mar 2025 21:59:12 +0100 Subject: [PATCH 2/3] Update build_dist.yml --- .github/workflows/build_dist.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index 5cf0451..faf4ecf 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -74,7 +74,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_SKIP: "cp*-musllinux*" CIBW_TEST_COMMAND: "tox -c {project}" - CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{aarch64,ppc64le,s390x} *-win_arm64" + CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{ppc64le,s390x} *-win_arm64" CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox" - name: Save wheels uses: actions/upload-artifact@v4 @@ -92,7 +92,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest-arm + - ubuntu-24.04-arm cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*] steps: - name: Check out repository From 301a73da894cfb6fd751949c1787c1b763d502c4 Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Thu, 6 Mar 2025 22:08:15 +0100 Subject: [PATCH 3/3] Update build_dist.yml --- .github/workflows/build_dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index faf4ecf..ac70871 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -120,7 +120,7 @@ jobs: upload_pypi: name: Upload to PyPI - needs: [sdist, wheels] + needs: [sdist, wheels, wheels_linux_arm] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: