* ci: improve Azure test reliability
Azure has intermittent failures, often the macOS framework-Python
`posix_spawn: Undefined error: 0` spawn race under load, plus transient
download flakiness. Address both:
- Retry integration tests via pytest-rerunfailures (already required):
add `--reruns=2 --reruns-delay=5` to the serial and non-serial runs so a
single transient flake self-heals instead of failing the whole job.
- Cap Azure at `--num-processes 3` to reduce concurrent process spawning
(the macOS runner was using 4 xdist workers), lowering the spawn-race
probability and peak resource pressure.
- Cache downloads across runs: relocate CIBW_CACHE_PATH to a stable path
and add a Cache@2 task (interpreter downloads + per-worker test pip
caches live under it), cutting the network-download flake surface.
- Bump the Azure host interpreter to 3.13.
Assisted-by: ClaudeCode:claude-opus-4.8
* ci: stabilize iOS tests, bound rerun cost
An iOS run on Azure (build 9043) hung for the full 40-min pytest timeout
on the second build config of test_ios_platforms, then reran twice
(reruns=2), blowing past the 180-min job cap with no useful signal. The
hang was a stuck simulator/xcodebuild on the second config, after the
first config had run.
- Shut down running simulators before each parametrized config via a
`clean_ios_simulators` fixture, so a simulator left booted/wedged by the
previous config isn't reused.
- Drop iOS reruns from 2 to 1. One retry still covers the documented
"fails the first time" simulator-boot flake, while halving the
worst-case retry cost (3x40=120min -> 2x40=80min) on a hang.
Assisted-by: ClaudeCode:claude-opus-4.8
* ci: don't limit num processes
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
* ci: rerun OCI unit tests that pull from Docker Hub
test_local_image et al. occasionally fail on a transient Docker Hub
anonymous-pull blip ("unauthorized: authentication required") when
pulling debian:trixie-slim. The integration runs already self-heal via
pytest-rerunfailures, but the unit run had no reruns, so a single flake
failed the whole job. Mark the three network-dependent OCI tests
(test_local_image, test_enter_error, test_multiarch_image) flaky so they
retry instead of blanket-rerunning the suite.
Assisted-by: ClaudeCode:claude-opus-4.8
* Drop iOS clean step
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
* ci: scope integration reruns to test_0_basic::test
Drop the blanket --reruns from the serial and non-serial integration
runs and instead mark test_0_basic.py::test as flaky, so only the known
flaky basic test is retried.
Assisted-by: ClaudeCode:claude-opus-4.8
---------
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
* tests: fully type the test suite
* chore: require more typing
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update dependencies
* tests: ignore tag order
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
* tests: use sorted platform tags
Per PEP 425, compressed tag sets should be sorted.
This was fixed in auditwheel 6.4.0
* tests: use sorted platform tags
this shouldn't change that often, use static order to allow override.
---------
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
* Improve integration test options
- Keep the platform and enable options in os.environ, don't duplicate state in utils
- Provide more user-friendly options for setting enable and platform in integration tests
* Ensure that CIBW_ENABLE is set in the test process
* Use get_enable_groups() where necessary
* Allow CIBW_ENABLE to control the wheels built in testing
* Set CIBW_ENABLE using PR labels
* Add docs
* Build everything on the main branch
* Add CIBW_ENABLE=all option
This was mostly for use in the `main` building case, because otherwise it's maybe a bit too easy to forget to update this file when adding an enable group
* Remove dead code
* Make unit tests robust to the value of CIBW_ENABLE
* Fix tests that explicitly choose pypy
* Fix test expectation
* Don't expect impossible wheels in expected_wheels
* Simplify logic in expected_wheels
* CircleCI- run with CIBW_ENABLE=all only on the main branch
* Azure pipelines - run with CIBW_ENABLE=all on main branch
* Update gitlab to run CIBW_ENABLE=all on main
* Set CIBW_ENABLE=all on travis - it only runs on main anyway
* Fix job name error on CircleCI
* Fix tests for graalpy
* Update the test configuration to use the label
* Remove duplication of default value. Make it affect sample build too
* Move the action to after deps are installed
* GraalPy workaround for this assumption
* Make unit test resilient to changing CIBW_ENABLE
* feat: stricter selector parsing, refactor to `platforms` module
- Use a different method to build nothing
- Make the check aware of enable groups
* optimise unit tests - a specific platform module API for all configs
Unit test time: 26.2s -> 13.1s
* Remove unnecessary get_platform_module function
* feat: support pypa build
fix: update `cibuildwheel.linux.troubleshoot` to know about build
Workaround issue with PyPy venv module by installing build[virtualenv]
fix: test_dependency_constraints_file when using build
fix: test/test_pep518.py
fix: use `strtobool` to parse `CIBW_PYPA_BUILD`
fix: update `cibuildwheel.linux.troubleshoot` to know about `python -m pip wheel`
test: use `build_mode` in `test/test_dependency_versions.py` tests
* refactor: use build-backend instead
* Apply suggestions from code review
Co-authored-by: Joe Rickerby <joerick@mac.com>
* refactor: use literal types for build_frontend
* refactor(tests): build_mode -> build_frontend_env
* Update test/test_before_build.py
Co-authored-by: Joe Rickerby <joerick@mac.com>
* Add CPython 3.10 support
* Fix logger displaying CPython 3.1 instead of 3.10
* Fix tests failing with CPython 3.10
* Use pytest instead of nose
* feat: --pre flag
Apply suggestions from code review
Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
* fix: update Python update script to process beta versions
* refactor: prerelease-pythons
* Use `strtobool` to parse `CIBW_PRERELEASE_PYTHONS` env var
* Update python version filtering for universal2 & arm64
* Filter out CPython 3.10 and above for `test_manylinuxXXXX_only[manylinux1]` test
* Use CIBW_BUILD filtering rather than CIBW_SKIP for test_docker_images
* Use skip_patterns to filter out pre-releases
* Use `prerelease_pythons` instead of `pre`
* Reword `CIBW_PRERELEASE_PYTHONS` doc per review.
* Use `CIBW_PRERELEASE_PYTHONS: True` for usage example.
* Update `cibuildwheel --help` doc
* docs: add note on spec.filter
* Clean up the BuildSelector __repr__ by refactoring
* fix: remove platform variants for CIBW_PRERELEASE_PYTHONS
* docs: mention the flag
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>