From f996066b1fe6c4b2ff18100774f76d22e75ef297 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 12 Aug 2025 16:24:03 -0400 Subject: [PATCH 1/4] chore: adding Android wheels Signed-off-by: Henry Schreiner --- .github/workflows/wheels.yml | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 699ec426..b6c48736 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -168,36 +168,36 @@ jobs: path: wheelhouse/*.whl name: wheels-ios-${{ matrix.runs-on }} - # build_android_wheels: - # name: Android ${{ matrix.runs-on }} - # runs-on: ${{ matrix.runs-on }} - # strategy: - # fail-fast: false - # matrix: - # runs-on: [ubuntu-latest, macos-latest] - # steps: - # - uses: actions/checkout@v6 - # with: - # fetch-depth: 0 - # submodules: true - # - # - uses: mhsmith/cibuildwheel@android - # env: - # CIBW_PLATFORM: android - # - # - name: Verify clean directory - # run: git diff --exit-code - # shell: bash - # - # - name: Upload wheels - # uses: actions/upload-artifact@v7 - # with: - # path: wheelhouse/*.whl - # name: wheels-android-${{ matrix.runs-on }} + build_android_wheels: + name: Android ${{ matrix.runs-on }} + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + runs-on: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: true + + - uses: pypa/cibuildwheel@v4.0 + env: + CIBW_PLATFORM: android + + - name: Verify clean directory + run: git diff --exit-code + shell: bash + + - name: Upload wheels + uses: actions/upload-artifact@v7 + with: + path: wheelhouse/*.whl + name: wheels-android-${{ matrix.runs-on }} upload_all: name: Upload if release - needs: [build_wheels, build_pyodide_wheels, build_ios_wheels, build_sdist] + needs: [build_wheels, build_pyodide_wheels, build_ios_wheels, build_android_wheels, build_sdist] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' environment: From b4bd1f82467ac2348b63415895a403e04adbbcc7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 12 Aug 2025 17:33:26 -0400 Subject: [PATCH 2/4] Update pyproject.toml --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dc2ff4d1..b1a87dc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -205,11 +205,11 @@ xbuild-tools = ["cmake", "ninja"] test-command = "python -m pytest --benchmark-disable tests" environment.PIP_EXTRA_INDEX_URL = "https://pypi.anaconda.org/beeware/simple/" -# [tool.cibuildwheel.android] -# build-frontend = "build" -# xbuild-tools = ["cmake", "ninja"] -# test-command = "pytest --benchmark-disable tests" -# environment.PIP_EXTRA_INDEX_URL = "https://chaquo.com/pypi-13.1" +[tool.cibuildwheel.android] +build-frontend = "build" +test-command = "python -m pytest --benchmark-disable tests" +environment.ANDROID_API_LEVEL = "24" +environment.PIP_EXTRA_INDEX_URL = "https://chaquo.com/pypi-13.1" [[tool.cibuildwheel.overrides]] select = ["gp*"] From 321fd122554ac0ce9cf38d282f4b70b944d09daf Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 12 Aug 2025 21:22:32 -0400 Subject: [PATCH 3/4] fix: add emulation and skip Signed-off-by: Henry Schreiner --- .github/workflows/wheels.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b6c48736..b8016758 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -181,6 +181,19 @@ jobs: fetch-depth: 0 submodules: true + # GitHub Actions can't currently run the Android emulator on macOS. + - name: Skip Android tests on macOS + if: contains(matrix.runs-on, 'macos') + run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV" + + # https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/ + - name: Enable KVM for Android emulator + if: contains(matrix.runs-on, 'ubuntu') + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - uses: pypa/cibuildwheel@v4.0 env: CIBW_PLATFORM: android From d22c9710cf2ac83682e46d1a6c8b57f55f2ae867 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 03:13:04 +0000 Subject: [PATCH 4/4] style: pre-commit fixes --- .github/workflows/wheels.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b8016758..531c50f4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -210,7 +210,14 @@ jobs: upload_all: name: Upload if release - needs: [build_wheels, build_pyodide_wheels, build_ios_wheels, build_android_wheels, build_sdist] + needs: + [ + build_wheels, + build_pyodide_wheels, + build_ios_wheels, + build_android_wheels, + build_sdist, + ] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' environment: