Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ed57229
test(workflows/build): enable cibuildwheel test for iOS simulator and…
XuehaiPan Oct 13, 2025
5961b7f
chore(workflows/build): use macos-26
XuehaiPan Oct 13, 2025
0b69f37
chore(workflows/build): explicitly set CIBW platform
XuehaiPan Oct 17, 2025
d726ab6
chore(workflows/build): enable x86_64 wheels for Android
XuehaiPan Oct 17, 2025
cb662a8
fix: fix Android test for subprocessing
XuehaiPan Oct 17, 2025
ae7af62
chore(workflows/build): add platform to job name and cache key
XuehaiPan Oct 17, 2025
1bd5213
chore(workflows/build): use macos-26
XuehaiPan Oct 17, 2025
415bd0f
chore(workflows): update job name and cache key
XuehaiPan Oct 18, 2025
fc8111f
deps: test `pypa/cibuildwheel#2590`
XuehaiPan Oct 18, 2025
0d590b9
Merge remote-tracking branch 'upstream/main' into enable-ios-android-…
XuehaiPan Oct 27, 2025
7e0cf36
chore: update pypa/cibuildwheel back to v3.2
XuehaiPan Oct 30, 2025
66c66d8
Merge remote-tracking branch 'upstream/main' into enable-ios-android-…
XuehaiPan Nov 4, 2025
6a2f728
chore(workflows/build): use macos-latest
XuehaiPan Nov 4, 2025
7b63bfc
chore: pin `typing-extensions` for test
XuehaiPan Nov 6, 2025
f660125
Merge remote-tracking branch 'upstream/main' into enable-ios-android-…
XuehaiPan Nov 7, 2025
bd7357e
Merge remote-tracking branch 'upstream/main' into enable-ios-android-…
XuehaiPan Nov 8, 2025
4898d6c
deps(workflows/build): bump cibuildwheel to 3.3
XuehaiPan Nov 13, 2025
b31034b
chore(workflows/build): stop building universal2 for macOS but build …
XuehaiPan Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 67 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ jobs:

build-wheels:
name: >-
Build wheels for Python ${{ matrix.python-version }}
on ${{ matrix.target.runner }} (${{ matrix.target.archs }})
Build wheels for
${{ startsWith(matrix.python-version, 'pypy') && 'PyPy' || 'CPython' }} ${{ matrix.python-version }}
on ${{ matrix.target.runner }} (${{ matrix.target.platform }} / ${{ matrix.target.archs }})
if: |
github.repository_owner == 'metaopt' &&
(github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) &&
Expand All @@ -112,16 +113,17 @@ jobs:
matrix:
# Reference: https://cibuildwheel.pypa.io
target:
- { runner: ubuntu-latest, archs: "auto64" }
- { runner: ubuntu-latest, archs: "auto32" }
- { runner: ubuntu-24.04-arm, archs: "aarch64" }
- { runner: ubuntu-latest, archs: "ppc64le" }
- { runner: ubuntu-latest, archs: "s390x" }
- { runner: ubuntu-latest, archs: "riscv64" }
- { runner: macos-latest, archs: "auto64" }
- { runner: windows-latest, archs: "auto64" }
- { runner: windows-latest, archs: "auto32" }
- { runner: windows-11-arm, archs: "ARM64" }
- { runner: ubuntu-latest, platform: linux, archs: "auto64" }
- { runner: ubuntu-latest, platform: linux, archs: "auto32" }
- { runner: ubuntu-24.04-arm, platform: linux, archs: "aarch64" }
- { runner: ubuntu-latest, platform: linux, archs: "ppc64le" }
- { runner: ubuntu-latest, platform: linux, archs: "s390x" }
- { runner: ubuntu-latest, platform: linux, archs: "riscv64" }
- { runner: macos-latest, platform: macos, archs: "auto64" }
- { runner: macos-latest, platform: macos, archs: "x86_64" }
- { runner: windows-latest, platform: windows, archs: "auto64" }
- { runner: windows-latest, platform: windows, archs: "auto32" }
- { runner: windows-11-arm, platform: windows, archs: "ARM64" }
python-version:
- "3.9"
- "3.10"
Expand Down Expand Up @@ -151,24 +153,58 @@ jobs:
include:
# iOS
- python-version: "3.13"
target: { runner: macos-latest, archs: "arm64_iphoneos" }
target:
runner: macos-latest
platform: ios
archs: "arm64_iphoneos"
- python-version: "3.14"
target: { runner: macos-latest, archs: "arm64_iphoneos" }
target:
runner: macos-latest
platform: ios
archs: "arm64_iphoneos"
# iOS Simulator
- python-version: "3.13"
target: { runner: macos-latest, archs: "arm64_iphonesimulator" }
target:
runner: macos-latest
platform: ios
archs: "arm64_iphonesimulator"
- python-version: "3.14"
target: { runner: macos-latest, archs: "arm64_iphonesimulator" }
target:
runner: macos-latest
platform: ios
archs: "arm64_iphonesimulator"
# Android
- python-version: "3.13"
target: { runner: macos-latest, archs: "arm64_v8a" }
target:
runner: ubuntu-latest
platform: android
archs: "arm64_v8a"
- python-version: "3.14"
target: { runner: macos-latest, archs: "arm64_v8a" }
target:
runner: ubuntu-latest
platform: android
archs: "arm64_v8a"
- python-version: "3.13"
target:
runner: ubuntu-latest
platform: android
archs: "x86_64"
- python-version: "3.14"
target:
runner: ubuntu-latest
platform: android
archs: "x86_64"
# Pyodide
- python-version: "3.12"
target: { runner: ubuntu-latest, archs: "wasm32" }
target:
runner: ubuntu-latest
platform: pyodide
archs: "wasm32"
- python-version: "3.13"
target: { runner: ubuntu-latest, archs: "wasm32" }
target:
runner: ubuntu-latest
platform: pyodide
archs: "wasm32"
fail-fast: false
timeout-minutes: 180
steps:
Expand Down Expand Up @@ -237,23 +273,13 @@ jobs:
fi
echo "PYTHON_TAG=${PYTHON_TAG}" | tee -a "${GITHUB_ENV}"
echo "CIBW_BUILD=${PYTHON_TAG}-*" | tee -a "${GITHUB_ENV}"
if [[ "${{ matrix.target.archs }}" == *arm*v8a* ]]; then
echo "CIBW_PLATFORM=android" | tee -a "${GITHUB_ENV}"
# Skip testing on Android
echo "CIBW_TEST_SKIP=*" | tee -a "${GITHUB_ENV}"
elif [[ "${{ matrix.target.archs }}" == *iphone* ]]; then
echo "CIBW_PLATFORM=ios" | tee -a "${GITHUB_ENV}"
if [[ "${{ matrix.target.archs }}" == *simulator* ]]; then
xcrun simctl shutdown all || true
xcrun simctl delete unavailable || true
xcrun simctl list devices >/dev/null || true
xcodebuild -downloadPlatform iOS || true
xcrun simctl list devices available || true
# Skip testing in iOS simulators
echo "CIBW_TEST_SKIP=*" | tee -a "${GITHUB_ENV}"
fi
elif [[ "${{ matrix.target.archs }}" == wasm* ]]; then
echo "CIBW_PLATFORM=pyodide" | tee -a "${GITHUB_ENV}"
if [[ "${{ matrix.target.platform }}" == 'ios' &&
"${{ matrix.target.archs }}" == *simulator* ]]; then
xcrun simctl shutdown all || true
xcrun simctl delete unavailable || true
xcrun simctl list devices >/dev/null || true
xcodebuild -downloadPlatform iOS || true
xcrun simctl list devices available || true
fi

- name: Set up QEMU
Expand All @@ -263,13 +289,13 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v3.2
uses: pypa/cibuildwheel@v3.3
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_PLATFORM: ${{ matrix.target.platform }}
CIBW_ARCHS: ${{ matrix.target.archs }}
CIBW_ARCHS_MACOS: ${{ matrix.target.archs }} universal2
CIBW_ENABLE: pypy cpython-freethreading${{ env.ALLOW_PRERELEASES == 'true' && ' cpython-prerelease' || '' }}
CIBW_ALLOW_EMPTY: ${{ env.ALLOW_PRERELEASES }}
CIBW_ALLOW_EMPTY: ${{ env.ALLOW_PRERELEASES == 'true' }}
with:
package-dir: .
output-dir: wheelhouse
Expand All @@ -278,7 +304,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-${{ env.PYTHON_TAG }}-${{ runner.os }}-${{ matrix.target.archs }}
name: wheels-${{ env.PYTHON_TAG }}-${{ matrix.target.platform }}-${{ matrix.target.archs }}
path: wheelhouse/*.whl
if-no-files-found: ${{ env.ALLOW_PRERELEASES == 'true' && 'warn' || 'error' }}

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ env:

jobs:
test:
name: Test for Python ${{ matrix.python-version }} on ${{ matrix.runner }}
name: >-
Test for
${{ startsWith(matrix.python-version, 'pypy') && 'PyPy' || 'CPython' }} ${{ matrix.python-version }}
on ${{ matrix.runner }}
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.runner }}
strategy:
Expand Down
6 changes: 6 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
reason='iOS does not support subprocesses',
)

ANDROID = sys.platform.startswith('android')
skipif_android = pytest.mark.skipif(
ANDROID,
reason='Android testbed returns wrong `sys.executable` which breaks subprocesses',
)

WASM = sys.platform.startswith(('emscripten', 'wasi'))
skipif_wasm = pytest.mark.skipif(
WASM,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@
is_tuple,
never,
parametrize,
skipif_android,
skipif_ios,
skipif_wasm,
)


@skipif_wasm
@skipif_android
@skipif_ios
def test_import_no_warnings():
env = {
Expand Down
3 changes: 3 additions & 0 deletions tests/test_treespec.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
gc_collect,
parametrize,
recursionlimit,
skipif_android,
skipif_ios,
skipif_pypy,
skipif_wasm,
Expand All @@ -58,6 +59,7 @@
reason='Only run on x86_64 and AMD64 architectures',
)
@skipif_wasm
@skipif_android
@skipif_ios
@skipif_pypy
@disable_systrace
Expand Down Expand Up @@ -526,6 +528,7 @@ def __init__(self, x, y):


@skipif_wasm
@skipif_android
@skipif_ios
def test_treespec_pickle_missing_registration():
if sys.version_info[:2] == (3, 11) and platform.system() == 'Windows' and Py_DEBUG:
Expand Down
Loading