Compare commits

..
Author SHA1 Message Date
Henry Schreiner 1828c10ab3 Bump version: v4.2.0 2026-08-04 22:23:12 -04:00
cibuildwheel-bot[bot]andcibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com> 1ed6c225c9 [Bot] Update dependencies (#2960)
Update dependencies

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
2026-08-04 22:19:16 -04:00
Matthieu Darbois 92e2145d80 feat: Python 3.15 build by default (#2944) 2026-08-04 20:26:00 -04:00
cibuildwheel-bot[bot]andcibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com> 3568a1cb9e [Bot] Update dependencies (#2952)
Update dependencies

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
2026-08-04 19:46:48 -04:00
Hood Chathamandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 03cefa35ab feat: add pyodide_315 support (#2958)
* Add pyodide_315 support

Guarded by cpython_prerelease for the moment.

* Update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update constraints to pyodide-build 0.39.0

* Update to 315.0.0a2

* Remove example versions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-04 17:41:22 -04:00
Matthieu Darbois 73417aefe5 fix(tests): delete test_overridden_pip_constraint (#2957)
* fix: test_overridden_pip_constraint with pip>=26.2

* fix(tests): delete test_overridden_pip_constraint

This test is not needed since #2583 and will fail with pip>=26.2
2026-08-03 10:20:35 -04:00
Matthieu Darbois 3c603e4a4a fix: pin pip on GraalPy (#2955) 2026-08-03 06:58:53 +02:00
Matthieu Darbois f0b2156470 chore: use pp311 for test_abi3 (#2956)
this should be faster on Linux when PyPy is not enabled as a whole in CI
2026-08-03 06:58:36 +02:00
Henry Schreiner ffd2e18240 fix(schema): default is fine for pyodide too (#2951) 2026-08-02 07:49:12 -04:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> dca67ee350 chore(deps): bump the actions group with 5 updates (#2954)
Bumps the actions group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/setup-python](https://github.com/actions/setup-python) | `6.3.0` | `7.0.0` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `8.3.2` | `9.0.0` |
| [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.14.0` | `1.14.1` |
| [j178/prek-action](https://github.com/j178/prek-action) | `2.0.5` | `2.0.6` |
| [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.6.0` | `0.6.1` |


Updates `actions/setup-python` from 6.3.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/ece7cb06caefa5fff74198d8649806c4678c61a1...5fda3b95a4ea91299a34e894583c3862153e4b97)

Updates `astral-sh/setup-uv` from 8.3.2 to 9.0.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/11f9893b081a58869d3b5fccaea48c9e9e46f990...c771a70e6277c0a99b617c7a806ffedaca235ff9)

Updates `pypa/gh-action-pypi-publish` from 1.14.0 to 1.14.1
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/cef221092ed1bacb1cc03d23a2d87d1d172e277b...ba38be9e461d3875417946c167d0b5f3d385a247)

Updates `j178/prek-action` from 2.0.5 to 2.0.6
- [Release notes](https://github.com/j178/prek-action/releases)
- [Commits](https://github.com/j178/prek-action/compare/e98a699c41eb69ab013a45817a0406469a748f8d...5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16)

Updates `zizmorcore/zizmor-action` from 0.6.0 to 0.6.1
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/6599ee8b7a49aef6a770f63d261d214911a7ce02...6fc4b006235f201fdab3722e17240ab420d580e5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.14.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: j178/prek-action
  dependency-version: 2.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-02 07:04:49 +02:00
Henry Schreiner b2533d3833 fix: survive short network outages when downloading (#2953)
* fix: use exponential backoff when a download fails

The retry used a flat 3 second wait over 3 attempts, which covers only
about 6 seconds of downtime. A CI runner lost DNS for approximately a
minute and the PyPy download failed. Wait 3, 6, 12, 24, then 48 seconds
over 6 attempts.

Assisted-by: ClaudeCode:claude-opus-5

* ci: raise the uv HTTP retry count

uv stops after 3 retries, which was too few when a runner lost DNS for
approximately a minute during a test run.

Assisted-by: ClaudeCode:claude-opus-5

* fix: do not retry a download after a client error

A bad URL will not fix itself, and the longer backoff made the wait
before the report about 93 seconds. Report 4xx responses at once, and
keep retrying 5xx.

Assisted-by: ClaudeCode:claude-opus-5
2026-08-02 07:01:14 +02:00
Agriya Khetarpal f05f72d4c1 Update to Pyodide 314.0.3 (#2949) 2026-07-25 22:56:28 -04:00
dependabot[bot] 1e4eb55ef2 chore(deps): bump the actions group with 2 updates (#2948)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-26 02:49:36 +05:30
Henry Schreiner 4726cd35bb Bump version: v4.1.1 2026-07-24 16:31:06 -04:00
Henry Schreiner 1af5cd76db docs: switch from mkdocs to properdocs (#2946)
properdocs is a drop-in MkDocs fork by the original MkDocs maintainers.
The existing plugins (include-markdown, macros, intersphinx) and pymdown
extensions work unchanged; themes are unbundled, so the readthedocs
theme comes from properdocs-theme-readthedocs.

Assisted-by: ClaudeCode:claude-fable-5
2026-07-24 14:55:37 -04:00
Henry Schreiner b21d76ae03 docs: add missing cp314-pyodide_wasm32 to build-id table (#2947)
* docs: add missing cp314-pyodide_wasm32 to build-id table

The build-id table in docs/options.md is hand-maintained, so a new
identifier can be missed when build-platforms.toml changes. Add a unit
test that checks every identifier appears in the table to guard against
this.

Assisted-by: ClaudeCode:claude-opus-4.8

* test: skip docs table check when docs/options.md is absent

Assisted-by: ClaudeCode:claude-opus-4.8
2026-07-24 14:55:24 -04:00
Henry Schreiner 03cbe932e6 fix(macos): make matching python3-config available in build/test venvs (#2922) 2026-07-24 01:19:38 -04:00
Henry Schreiner b7cac6dfef fix: don't error when a global build-frontend is set on pyodide (#2945)
Since #2609, the pyodide platform required the 'pyodide-build' frontend,
but a global build-frontend setting (TOML or CIBW_BUILD_FRONTEND)
overrides the platform default, so previously-working configs like
build-frontend = "build" failed with a ConfigurationError. Even
"default" failed, since it was mapped to "build" before the check.

Resolve "default" to the platform default, and warn and use
pyodide-build when another frontend is set on pyodide, matching
pre-#2609 behavior where the frontend name only affected verbosity
flags.

Assisted-by: ClaudeCode:claude-opus-4.8
2026-07-23 11:40:11 -04:00
Yashas Gunderiaandychampion 1520daf8ae fix: support platform-specific test runtime environment variables (#2941)
Honor platform-specific test runtime settings

Let the shared option reader apply Android and iOS environment overrides, matching the documented configuration precedence.

Constraint: Preserve existing global, TOML, and override behavior for test-runtime.
Rejected: Add Android/iOS-specific lookup code | OptionsReader already implements platform environment precedence.
Confidence: high
Scope-risk: narrow
Directive: Keep test-runtime on the shared option cascade when adding future platforms.
Tested: Focused red/green regression; 824 unit tests; prek all hooks; pylint 10.00/10; diff check.
Not-tested: Android and iOS device integration runs.

Co-authored-by: ychampion <ychampion@users.noreply.github.com>
2026-07-21 21:12:40 -04:00
cibuildwheel-bot[bot]cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>Henry Schreinermayeut
17b74206ab [Bot] Update dependencies (#2939)
* Update dependencies

* fix: older pip for graalpy on Windows

The dependency update regenerated the constraints and dropped the pip
hold-back for GraalPy on Windows, where newer pip breaks. Restore the
marker-based pin.

Assisted-by: ClaudeCode:claude-opus-4.8

* ci: keep graalpy pip workaround across dependency bumps

update_constraints now re-applies the GraalPy Windows pip hold-back after
uv pip compile, so the bot no longer wipes it each run. Target only the
Python versions that ship a GraalPy config (3.12), derived from
build-platforms.toml; drop the stale pin from the 3.11 constraints.

Assisted-by: ClaudeCode:claude-opus-4.8

* fix(macos): accept .tar.gz PyPy archives

PyPy switched its macOS downloads from .tar.bz2 to .tar.gz, which tripped
the hard-coded extension assert in install_pypy. Accept both.

Assisted-by: ClaudeCode:claude-opus-4.8

* ci: hold filelock back for graalpy

filelock >=3.30 imports errno.ENOTSUP, which GraalPy lacks, so virtualenv
fails on GraalPy. Hold it at 3.29.4 for GraalPy until the upstream fix
ships (~2026-08), reusing the update_constraints workaround mechanism.

Assisted-by: ClaudeCode:claude-opus-4.8

* ci: bump filelock for graalpy

* revert android cp315 update

see https://github.com/pypa/cibuildwheel/pull/2933#issuecomment-4821042715

---------

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
2026-07-21 21:12:27 -04:00
dependabot[bot] f8d8cca5bb chore(deps): bump astral-sh/setup-uv from 8.2.0 to 8.3.2 in the actions group (#2943)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-18 17:18:12 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 265b435c86 chore(deps): bump the actions group with 2 updates (#2942)
Bumps the actions group with 2 updates: [j178/prek-action](https://github.com/j178/prek-action) and [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action).


Updates `j178/prek-action` from 2.0.4 to 2.0.5
- [Release notes](https://github.com/j178/prek-action/releases)
- [Commits](https://github.com/j178/prek-action/compare/bdca6f102f98e2b4c7029491a53dfd366469e33d...e98a699c41eb69ab013a45817a0406469a748f8d)

Updates `docker/setup-qemu-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/06116385d9baf250c9f4dcb4858b16962ea869c3...96fe6ef7f33517b61c61be40b68a1882f3264fb8)

---
updated-dependencies:
- dependency-name: j178/prek-action
  dependency-version: 2.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-11 20:55:54 +02:00
dependabot[bot] 3f8bd1c9ba chore(deps): bump the actions group with 3 updates (#2938)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-07 10:51:43 +05:30
pre-commit-ci[bot] 6647035c75 [pre-commit.ci] pre-commit autoupdate (#2940) 2026-07-07 10:45:25 +05:30
cibuildwheel-bot[bot]cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>mayeut
e6eb0f50ed [Bot] Update dependencies (#2935)
* Update dependencies

* Revert pip marker flattening for GraalPy on Windows

* revert android cp315 update

see https://github.com/pypa/cibuildwheel/pull/2933#issuecomment-4821042715

---------

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
2026-06-30 09:00:00 -04:00
Agriya Khetarpal cecc541579 Use absolute path for {project} placeholder in config-settings (#2934) 2026-06-30 18:09:52 +05:30
Joe Rickerbyandmayeut eab8065b00 Implement test enabling with the "CI: PyPy EoL" PR label (#2930)
* Implement test enabling with the "CI: PyPy EoL" PR label

* apply "CI: PyPy EoL" to "Update dependencies" PR

---------

Co-authored-by: mayeut <mayeut@users.noreply.github.com>
2026-06-29 09:13:31 +01:00
Matthieu Darbois 3666de056a feat: use digests instead of tags for pinned images (#2915) 2026-06-28 10:00:50 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e5054806ba chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 in the actions group (#2932)
chore(deps): bump actions/checkout in the actions group

Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-28 07:21:46 +02:00
Malcolm Smith a5624fcd2c Android fixes (#2933)
* Update Android test repository URL
* Update to current Python versions, and remove patch which isn't needed anymore
2026-06-28 07:05:08 +02:00
cibuildwheel-bot[bot]cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>Joe Rickerby
816a6ffbb1 [Bot] Update dependencies (#2917)
* Update dependencies

* restore graalpy windows workaround

* aand the other one

---------

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
2026-06-25 09:08:06 -04:00
Agriya Khetarpal 7933323184 Add pyodide-build as a separate build frontend and update its build verbosity handling (#2609) 2026-06-22 00:12:15 +05:30
Agriya Khetarpal 291be6a345 Validate pyodide-version option against Pyodide build identifier (#2925)
* Validate pyodide-version against identifier

* Add tests

* Allow Pyodide nightly xbuildenvs too (for later)
2026-06-21 18:17:55 +01:00
Agriya Khetarpal 78d8530df9 docs: replace outdated note about build frontend and remove mention of ClearLinux (#2926)
* Remove outdated `pip wheel` note

* Remove ClearLinux reference

* Change Alpine to BSD
2026-06-20 01:31:15 -04:00
Henry Schreiner dc30bfb527 fix: make CIBW_ARCHS parsing case-insensitive and platform-aware (#2920)
Architecture name lookup in `parse_config` was a case-sensitive StrEnum
lookup. Since the enum carries both lowercase `arm64` (macOS/Android) and
uppercase `ARM64` (Windows), `parse_config("arm64", "windows")` silently
returned the macOS member and later failed with a confusing "Invalid archs
option" error, while lowercase `amd64` failed to parse at all.

Resolve names case-insensitively, preferring a member valid for the target
platform before falling back to any case-insensitive match (which keeps the
clear ConfigurationError for genuinely invalid names).

Closes #2373

Assisted-by: ClaudeCode:claude-opus-4.8
2026-06-18 11:41:17 -04:00
Henry Schreiner aeea2cba0a chore: drop orjson (#2923)
Not used by mypy 2+ (sqlite used instead of json)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-06-15 22:27:24 +05:30
dependabot[bot] ce96a012ef chore(deps): bump the actions group with 2 updates (#2914)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-13 22:08:41 +05:30
Agriya Khetarpal 034e6353e8 Fix quoting of test-requires and audit-requires options for PEP 508 specifiers (#2913) 2026-06-13 06:04:58 +05:30
Joe Rickerby 2947353127 Bump version: v4.1.0 2026-06-12 17:02:22 +01:00
Joe Rickerby 14a3c3a226 Remove Travis pre-commit check 2026-06-12 16:42:14 +01:00
Henry Schreiner 42aa1345c3 chore: minor cleanups and perf tweaks from code review (#2910)
* chore: minor cleanups and perf tweaks from code review

- util/file.py, util/python_build_standalone.py: use hashlib.file_digest
  for streaming SHA-256 verification instead of loading whole archives
  into memory with read_bytes()
- logger.py: convert colors/symbols properties to functools.cached_property
  so the Colors/Symbols objects are constructed only once per Logger instance
- platforms/windows.py: remove redundant .strip() on where_pip (already
  stripped at assignment)
- util/python_build_standalone.py: remove unreachable python_base_dir.exists()
  guard (callers always pass a fresh temp subdirectory)
- util/file.py: add comment explaining the getattr shim for
  tar_.extraction_filter and when it can be removed

Assisted-by: ClaudeCode:claude-fable-5

* revert: restore assertion to check python_base_dir existence
2026-06-12 16:03:36 +01:00
Himanshu Agrawal 01265e5db0 Clarify shell used for command options (#2904) 2026-06-12 14:24:15 +01:00
Mike Evdokimov f4afd95cbc Add FAQ section on caching cibuildwheel's downloaded tools (#2842)
* Add FAQ section on caching cibuildwheel's downloaded tools

Adds a Tips entry covering:

- What cibuildwheel caches (CPython/PyPy installers, virtualenv,
  python-build-standalone archives) and the default per-OS cache folder.
- How to override the cache location with ``CIBW_CACHE_PATH``.
- A worked GitHub Actions example pairing ``actions/cache`` with
  ``CIBW_CACHE_PATH`` so the cache survives between runs.
- A pointer to ``--clean-cache`` for invalidating stale entries.

Closes #1585.

Per @joerick's request in the issue ("a caching section in the FAQ
would be great, if you can contribute it") the scope is intentionally
narrow — just FAQ-level guidance. Platform-specific caching (e.g.
Windows NuGet, addressed in #2839) lives in the platforms doc.

* docs: bump actions/cache v4 to v5

* docs: move cache to runner.temp, add cache poisoning warning (review feedback)
2026-06-12 14:02:09 +01:00
Henry Schreiner 6c08562aa1 fix: faster CLI on Python 3.15 (#2797)
* chore: lazy imports

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: bump flake8-lazy, rerun

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: include android

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: after rebase

Assisted-by: ClaudeCode:claude-sonnet-4.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: autofix __lazy_modules__

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: avoid touching resources

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: bump flake8-lazy to v0.8.2, rerun

Assisted-by: ClaudeCode:claude-sonnet-4-6

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-06-12 14:01:49 +01:00
Henry Schreiner 4f42ee3f03 fix: raise clear errors when no wheel is produced (#2909) 2026-06-12 17:22:07 +05:30
Victorien f3aa1bed4f Fix dead Pyodide env info link, remove mention of alpha ABI (#2911) 2026-06-12 15:29:56 +05:30
Tim Felgentreff d60fc2bdd0 Support new graalpy asset names that include Python version. (#2863)
* Support new graalpy asset names that include Python version

* Slight readability improvement for graalpy asset regex
2026-06-11 12:05:48 +02:00
Himanshu Agrawal 55c8985c12 docs: clarify environment precedence (#2905) 2026-06-10 09:34:19 -04:00
Agriya Khetarpal 2f9a352352 Update to Pyodide 314.0.0 (#2906)
* Update to Pyodide 314.0.0

* Update selector

* Update tests

* Use v2 xbuildenvs endpoint

* Update pyodide-build in constraints

* Add comment about `test_build_filter_pyodide_prerelease`
2026-06-09 16:30:30 -04:00
Agriya Khetarpal c58c5c58ec Drop use of Unbuffered wrapper class (#2894) 2026-06-08 18:13:44 +05:30
Henry Schreiner 90b8fdffd3 docs: rerun prek after changelog fix
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-06-07 16:27:27 -04:00
Henry Schreiner c3e47f896b docs: fix changelog formatting
Updates changelog to reflect changes in CPython 3.15 support and other enhancements.
2026-06-07 15:19:15 -04:00
Henry Schreiner f03ac7617d Bump version: v4.0.0 2026-06-07 14:53:57 -04:00
Henry Schreiner 557c5f65f8 feat: remove GraalPy 3.11 (gp311) support (#2895)
Drops the GraalPy 3.11 / GraalPy 24.2 builds (gp311_242) as agreed in
pypa/cibuildwheel#2741: a ~6-month overlap after the GraalPy 25 (gp312)
release. GraalPy 3.12 (gp312_250) stays.

This also removes the GraalPy 24-only workarounds that were explicitly
marked "Remove when GraalPy 24.x is dropped":
- the Visual Studio compiler-discovery (vswhere) and build-isolation
  (graalpython#491) workarounds in the Windows backend
- the issue-491 Windows skip/filter hacks in test_pep518 and
  test_dependency_versions (added in the original GraalPy PR #1538 and
  unneeded since GraalPy 25 per #2597)

The uv-doesn't-support-graalpy skip (#2754), the `graalpy` enable group,
and the generated constraints pins apply to all GraalPy and are kept.

Assisted-by: ClaudeCode:claude-opus-4.8
2026-06-07 14:24:31 -04:00
70975c2153 chore: use ConfigurationError when package_dir is outside cwd (#2898)
* chore: use ConfigurationError when package_dir is outside cwd

Replace a generic Exception with errors. ConfigurationError when package_dir is not inside the working directory. This makes the error type consistent with the project's error handling and allows the CLI to treat this as a fatal error with the expected exit behavior.

* test: merge linux package_dir test into linux_build_steps_test

Fold the standalone linux_build_test.py into the existing
linux_build_steps_test.py, which already covers the linux platform
build orchestration. Reuses the file's existing import boilerplate and
module-qualified build() call style.

Assisted-by: ClaudeCode:claude-opus-4.8
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 23:10:32 -04:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e2f143c327 chore(deps): bump docker/setup-qemu-action from 4.0.0 to 4.1.0 in the actions group (#2902)
chore(deps): bump docker/setup-qemu-action in the actions group

Bumps the actions group with 1 update: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action).


Updates `docker/setup-qemu-action` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/ce360397dd3f832beb865e1373c09c0e9f86d70a...06116385d9baf250c9f4dcb4858b16962ea869c3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-06 21:35:17 -04:00
Henry Schreiner 866ae74781 docs: fix CUDA manylinux container references in FAQ (#2900)
Noticed by Claude when doing something else.
2026-06-06 10:32:03 -04:00
Matthieu Darbois 84b518a1b1 chore: simplify pinned image lookup (#2897)
Replace the explicit if/else used to resolve pinned container images with pinned_images.get(config_value, config_value) in the manylinux and musllinux loops inside _compute_build_options. This keeps behavior identical while reducing duplication and simplifying the code in cibuildwheel/options.py.
2026-06-06 08:19:14 -04:00
Philip Hyunsu Cho 785d812a47 docs: add instructions for building CUDA wheels (#2896)
* Add documentation for building CUDA wheels

* Move to Tips section
2026-06-06 08:18:02 -04:00
Henry Schreiner f6bd0477cc Bump version: v4.0.0rc2 2026-06-05 09:26:48 -04:00
Matthieu DarboisandCopilot 6cd2d197c1 fix: remove potential partial cache-population in case of error (#2892)
fix: remove potential partial extraction in case of error

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-06-05 08:10:48 -04:00
cibuildwheel-bot[bot]Matthieu Darboiscibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
cdb170b8c6 [Bot] Update dependencies (#2893)
* Update dependencies

* restore pip workaround for graalpy

Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>

---------

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
2026-06-05 08:09:34 -04:00
Henry Schreiner eec3efa84e ci: improve Azure test reliability (#2890)
* 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>
2026-06-05 08:09:16 -04:00
Henry Schreiner 29888149e1 fix: ensure container removal on teardown even if bash hangs or dies (#2887)
`OCIContainer.__enter__` was hardened in #2879 to always clean up on
failure, but `__exit__` was left unguarded. If the container/bash had
already died, `bash_stdin.write("exit 0")` raises `BrokenPipeError`; if
bash refuses to exit, `process.wait(timeout=30)` raises `TimeoutExpired`.
Either propagated out of `__exit__` before `_remove_container()` ran,
leaking the container (and, on timeout, the `start` process too).

Wrap the teardown so a broken pipe or timeout instead forces the process
down (kill + wait) and always falls through to container removal, while
still respecting CIBW_DEBUG_KEEP_CONTAINER. Pipe closes are now also
guarded so a flush-on-close against a dead pipe can't mask cleanup.

Add non-docker unit tests for the clean-exit, already-dead-bash, and
shutdown-timeout paths.

Assisted-by: ClaudeCode:claude-opus-4.8
2026-06-04 22:35:59 -04:00
Henry Schreiner 2f49f9a050 fix: minor 4.0 issues in Android validation, docs, and docstring (#2891)
* fix: minor 4.0 issues in android validation, docs, and docstring

- android: raise a clear FatalError when ANDROID_API_LEVEL is not an
  integer, instead of an uncaught ValueError deep in localized_vars
- docs: note that delvewheel is the default Windows repair-wheel-command
  since 4.0 and how to skip it for platform-tagged wheels with no
  extension module; update the now-outdated FAQ wording
- venv: fix _parse_pip_constraint_for_virtualenv docstring to say
  marker-bearing constraints are evaluated against the host's default
  environment (not skipped) when marker_env is None

Assisted-by: ClaudeCode:claude-opus-4.8

* fix: use int() with original error for ANDROID_API_LEVEL validation

Handle ANDROID_API_LEVEL validation via try/except around int() so the
original exception message is surfaced, and so non-ASCII Unicode digits
(which isdigit() accepts but int() may reject) are handled correctly.

Assisted-by: ClaudeCode:claude-opus-4.8

* refactor: address reivew by moving error catch

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-06-03 15:23:06 -04:00
Henry Schreiner 4ae59097cb fix: detect musl libc when downloading python-build-standalone (#2889)
* fix: detect musl libc when downloading python-build-standalone

`platform.libc_ver()` only ever reports glibc and returns `("", "")` on
musl systems, so `"musl" in platform.libc_ver()` was never true and musl
hosts (e.g. Alpine) always selected the `gnu` python-build-standalone
asset, which won't run.

Detect musl by shelling out to `ldd --version`, which prints "musl libc"
on musl-based systems. This probes the actual system loader rather than
the host Python's linkage, so it stays correct even when cibuildwheel
runs under a relocatable/statically-linked interpreter. Falls back to
glibc when `ldd` is unavailable.

Assisted-by: ClaudeCode:claude-opus-4.8

* test: add type annotations to satisfy mypy and ruff

Assisted-by: ClaudeCode:claude-opus-4.8
2026-06-03 10:43:53 -04:00
Henry Schreiner bb4ee99896 fix: config settings expansion issue (#2886) 2026-06-02 07:57:09 -04:00
Henry Schreiner f01c1955a9 fix: pass platform args to linux32 deadlock sanity check (#2888)
The linux32 sanity check added in #2880 omitted `*platform_args`, unlike
the surrounding `uname -m` probes and the `create` command. On the i386
fallback path `platform_args` is reassigned to AMD64, so without
forwarding it the check could run against a different image variant than
the one actually built (e.g. on a multi-platform/containerd backend),
making the check meaningless or pulling the wrong variant.

Assisted-by: ClaudeCode:claude-opus-4.8
2026-06-02 06:42:44 +02:00
cibuildwheel-bot[bot]henryiiicibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
72b75a45a2 [Bot] Update dependencies (#2882)
* Update dependencies

* Restore GraalPy-specific pip workaround in constraints

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

---------

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
2026-06-01 18:27:52 -04:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 2d8daaef8e [pre-commit.ci] pre-commit autoupdate (#2884)
updates:
- [github.com/astral-sh/ruff-pre-commit: 0c7b6c989466a93942def1f84baf36ddfcd60c83 → 0671d8ab202c4ac093b78433ae5baf74f3fc7246](https://github.com/astral-sh/ruff-pre-commit/compare/0c7b6c989466a93942def1f84baf36ddfcd60c83...0671d8ab202c4ac093b78433ae5baf74f3fc7246)
- [github.com/pre-commit/mirrors-mypy: fc0f09a29bb495f4a91f00266155d6282d52485d → d2823d321df3af8f878f7ee3414dc94d037145b9](https://github.com/pre-commit/mirrors-mypy/compare/fc0f09a29bb495f4a91f00266155d6282d52485d...d2823d321df3af8f878f7ee3414dc94d037145b9)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-01 18:27:34 -04:00
52f77ea3dd ci: fix Windows Gitlab test running (#2870)
* Try to fix the problem with py trying to execute the shebang

* run whenever the branch name starts with gitlab

* Modernise GitLab CI config

- Windows: remove stale servercore:1809 image and choco install
  (runners are now Windows 2022 VMs with Python 3.13 pre-installed)
- macOS: update deprecated macos-14-xcode-15 to macos-15-xcode-16
- Linux: bump Python image from 3.12 to 3.13
- All jobs: also run on gitlab* branches with CIBW_ENABLE=all

Generated with the help of AI (Amp/Claude Opus 4.7)

Amp-Thread-ID: https://ampcode.com/threads/T-019e6496-f89a-74e7-9f6b-655574290e68
Co-authored-by: Amp <amp@ampcode.com>

* ci: exclude graalpy on GitLab Windows runners

GraalPy is JVM-based and slow to start; on the small (2-core) GitLab
SaaS Windows runners, virtualenv's interpreter query for graalpy.exe
times out, failing test_0_basic::test[pip]. Restrict the Windows job's
CIBW_ENABLE to all groups except graalpy (other platforms keep "all").

CIBW_ENABLE rather than CIBW_SKIP is used so the test's expected-wheel
set (derived from CIBW_ENABLE) stays consistent with what is built.

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
2026-05-31 23:23:33 -04:00
Matthieu Darbois 3c07d63629 fix: prevent deadlock when linux32 fails (#2880)
This was the case when running `nox -s tests -- --run-podman -v -s 'unit_test/oci_container_test.py::test_multiarch_image[podman-OCIPlatform.i386]'` on macOS arm64.
2026-05-31 23:23:14 -04:00
Matthieu DarboisandCopilot Autofix powered by AI ca0dd067e0 fix: ensure clean-up on container start failure and warn on removal failure (#2879)
* fix: ensure clean-up on container start failure and warn on removal failure

Properly release resources on container start failure.

If we fail to remove the created container, warn when not running in CI.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-31 18:01:52 -04:00
Matthieu Darbois acdba60d3a chore: add unit tests for OCIContainer._get_platform_args (#2878)
* chore: add unit tests for `OCIContainer._get_platform_args`

While this was already tested indirectly through `test_local_image`, this makes the behaviour check of `OCIContainer._get_platform_args` clear.

* fix: re-add `check=False` removed at some point in local testing
2026-05-31 17:57:40 -04:00
Henry SchreinerCopilotcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>henryiii
cd38ee1548 feat: add SHA256 verification for direct downloads (#2873)
* feat: add SHA256 verification for direct downloads

Store SHA256 hashes when running update scripts and verify them
when downloading files at build time. This improves security by
detecting unexpected changes to downloaded artifacts.

Platforms covered: macOS (CPython, PyPy, GraalPy), iOS, Android,
virtualenv, and python-build-standalone. Windows (nuget) and
Linux (Docker) are excluded.

SHA256 sources per platform:
- macOS/iOS/Android CPython (python.org): sha256_sum from API
- GraalPy: .sha256 sidecar assets from GitHub releases
- python-build-standalone: SHA256SUMS file in release
- PyPy, BeeWare iOS, Maven (Chaquopy): stream-download and compute

Changes:
- cibuildwheel/util/file.py: add sha256 param to download()
- cibuildwheel/platforms/{macos,ios,android}.py: add sha256 to
  PythonConfiguration and pass to download()
- cibuildwheel/venv.py: read sha256 from toml and pass to download()
- cibuildwheel/util/python_build_standalone.py: add sha256 to
  PythonBuildStandaloneAsset and pass to download()
- cibuildwheel/resources/build-platforms.toml: add sha256 fields
- cibuildwheel/resources/virtualenv.toml: add sha256 field
- cibuildwheel/resources/python-build-standalone-releases.json: add sha256
- bin/update_pythons.py: compute/store sha256 per source strategy
- bin/update_virtualenv.py: compute sha256 by streaming download
- bin/update_python_build_standalone.py: parse SHA256SUMS file

Closes #908

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: copilot-cli:claude-sonnet-4.6

* fix: populate sha256 in resource files and fix Windows PythonConfiguration

- Add sha256 field to Windows PythonConfiguration (PyPy/GraalPy have
  direct download URLs on Windows too)
- Pass sha256 to install_pypy() and install_graalpy() in windows.py
- Fix update_pythons.py: handle empty sha256 from CPython API (older
  versions) by streaming download to compute it; fix condition to
  check 'not sha256' rather than 'not in dict'
- Fix update_virtualenv.py: compute sha256 even when version unchanged
  but sha256 is empty (first-time population)
- Fix update_python_build_standalone.py: resolve file path relative to
  the script itself (not the installed package) so writes go to source
  checkout, not the uv cache
- Populate actual sha256 values by running all three update scripts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: copilot-cli:claude-sonnet-4.6

* fix: also include pyodide

Assisted-by: CopilotCLI:gpt-5.3-codex
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: PR review comments for cache verification and docs wording

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: require sha256 for download configs

Require sha256 for URL-backed Python and virtualenv download configs. Update the GraalPy updater to refresh macOS x86_64 entries by selecting the latest release that still has a matching asset, and fill the two missing GraalPy checksums in build-platforms.toml.

Assisted-by: CopilotCLI:gpt-5.4

* ci: remove unit test for bin item

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* refactor: combine sha256 unit tests into test_sha256.py

Merge pyodide_test.py and python_build_standalone_test.py into a
single unit_test/test_sha256.py since both test sha256-related
behaviour.

Assisted-by: opencode:glm-5

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
2026-05-29 15:02:33 -04:00
Henry Schreiner 322b876891 docs: add delvewheel to diagram, schema defaults, and docs (#2877)
Since delvewheel is now the default repair-wheel-command on Windows,
update all places where auditwheel/delocate were referenced but
delvewheel was missing:

- diagram.html: add delvewheel repair block for Windows (was grouped
  with ios/pyodide as optional dot)
- generate_schema.py: add Windows delvewheel default to the platform
  loop so schema.json includes the default
- schema.json: regenerated with Windows delvewheel default
- options.md: add Windows to defaults list, remove outdated tip about
  delvewheel being early-stage/optional, update examples
- contributing.md: add delvewheel to the tool list

Assisted-by: OpenCode:glm-5.1

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-05-29 13:51:09 -04:00
CopilothenryiiiHenry Schreinercopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
b84dd90062 docs: support intersphinx (#2871)
* Initial plan

* Add mkdocs-intersphinx plugin to generate objects.inv for intersphinx linking

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

* Add options.md comments to schema generator

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

* Plan intersphinx marker fix

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

* Add Python 3.12 marker to mkdocs-intersphinx

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

* Revert schema comment metadata changes

Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-05-29 13:22:53 -04:00
Henry SchreinerandCopilot 80d5810e2a feat: add CIBUILDWHEEL_BUILD_IDENTIFIER environment variable (#2872)
* feat: add CIBUILDWHEEL_BUILD_IDENTIFIER environment variable

Set `CIBUILDWHEEL_BUILD_IDENTIFIER` to the current build identifier
(e.g. `cp311-manylinux_x86_64`) in the environment for all per-build
steps: `before_build`, the build itself, `repair_command`,
`before_test`, and `test_command`.

This allows scripts and commands to inspect which build is currently
running, which is useful for e.g. writing per-build output files:

    CIBW_TEST_COMMAND='pytest --junit-xml=results-$CIBUILDWHEEL_BUILD_IDENTIFIER.xml'

The variable is set after the user's environment overrides are applied
and is only available for per-build steps (not `before_all`, where no
single identifier applies). All six platforms are covered: linux, macOS,
Windows, pyodide, Android, and iOS.

Closes #944, closes #2750

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: OpenCode:claude-sonnet-4.6

* fix: address review comment moving this for Android

Assisted-by: OpenCode:glm-5.1
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-29 00:28:20 -04:00
1cf64d0d3c feat: Android improvements needed for building NumPy and related packages (#2695)
* Use auditwheel on Android

* Add auditwheel command to defaults

* pkgconfig fixes

* Pre-import ctypes before monkey-patching in _cross_venv

* Set PKG_CONFIG and PKG_CONFIG_RELOCATE_PATHS variables

* Initial attempt at using mzakharo/android-gfortran

* Switch to using termux/ndk-toolchain-clang-with-flang

* Move PKG_CONFIG variables from build_env to android_env

* Simplify flang installation

* Add cross build files for NumPy

* Add ldpaths entry for libomp

* Add `--rm` to docker command line

* Make Rust and Fortran shims consistent

* Update documentation

* Default to API level 24 on all Python versions

* Clarify comments

* Cleanups

* Fix tests:
* Set up Android env after installing pkgconf
* Add tests for successfully using an older API level
* Previous commit's auditwheel failure is fixed in the auditwheel PR

* Update how-it-works diagram

* Add tests for repair errors

* Add more repair tests

* Add test for Meson and Fortran

* Add test for cross build files

* Improve test_api_level error message

* Add xbuild-files option

* use pypa/auditwheel@main

* Remove dependencies which are no longer needed

* Fix README

* Update to auditwheel 6.7.0

* Fix compatibility with pkgconf 2.5.1.post2

* Documentation clarifications

Co-authored-by: Joe Rickerby <joerick@mac.com>

* Fortran shim improvements

* Add Jinja variables to new_meson_project

* Update run_example_ci_configs for changed new_meson_project signature

* Add missing dependency to run_example_ci_configs

---------

Co-authored-by: mayeut <mayeut@users.noreply.github.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
2026-05-29 00:27:28 -04:00
126 changed files with 4498 additions and 1998 deletions
+3 -3
View File
@@ -19,16 +19,16 @@ jobs:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
allow-prereleases: true
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install tooling
run: |
+3 -3
View File
@@ -13,7 +13,7 @@ jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
@@ -37,10 +37,10 @@ jobs:
path: dist
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
with:
subject-path: "dist/cibuildwheel-*"
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
- uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
with:
attestations: true
+32 -25
View File
@@ -23,7 +23,7 @@ on:
- .travis.yml
- README.md
- azure-pipelines.yml
- mkdocs.yml
- properdocs.yml
- noxfile.py
workflow_dispatch:
# allow manual runs on branches without a PR
@@ -34,19 +34,23 @@ concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
# runners see short DNS/network outages; uv's default of 3 retries is too few
UV_HTTP_RETRIES: "6"
jobs:
lint:
name: Linters (mypy, ruff, etc.)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
- name: PyLint checks
run: uvx nox -s pylint -- --output-format=github
@@ -55,14 +59,14 @@ jobs:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
name: Install Python
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --no-dev --group test
- name: Generate a sample project
@@ -117,16 +121,16 @@ jobs:
test_select: android
timeout-minutes: 180
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Free up disk space
if: runner.os == 'Linux' && matrix.test_select != 'android'
@@ -139,7 +143,7 @@ jobs:
# for oci_container unit tests
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
- name: Set up Xcode
if: ${{ startsWith(matrix.os, 'macos-15') }}
@@ -168,6 +172,9 @@ jobs:
if [[ -n "$GITHUB_PR_LABEL_CI_GRAALPY" ]]; then
CIBW_ENABLE+=" graalpy"
fi
if [[ -n "$GITHUB_PR_LABEL_CI_PYPY_EOL" ]]; then
CIBW_ENABLE+=" pypy-eol"
fi
fi
echo "CIBW_ENABLE=${CIBW_ENABLE}" >> $GITHUB_ENV
@@ -247,13 +254,13 @@ jobs:
outputs:
archs: ${{ steps.archs.outputs.archs }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --no-dev --group test
- name: Get qemu emulated architectures
@@ -272,18 +279,18 @@ jobs:
matrix:
arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --no-dev --group test
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
- name: Run the emulation tests
env:
@@ -296,14 +303,14 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 180
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
name: Install Python 3.12
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Install dependencies
run: uv sync --no-dev --group test
@@ -321,13 +328,13 @@ jobs:
output-dir: wheelhouse
env:
CIBW_PLATFORM: pyodide
CIBW_ENABLE: pyodide-prerelease
CIBW_ENABLE: cpython-prerelease
- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
run: uv run --no-sync ./bin/run_tests.py
env:
CIBW_PLATFORM: pyodide
CIBW_ENABLE: pyodide-prerelease
CIBW_ENABLE: cpython-prerelease
test-uv-extras:
name: Test uv extra on ${{ matrix.os }} ${{ matrix.test_select }}
@@ -348,7 +355,7 @@ jobs:
- os: macos-15
test_select: android
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download a sample project
+3 -2
View File
@@ -37,11 +37,11 @@ jobs:
permission-contents: write
permission-pull-requests: write
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.14"
@@ -69,4 +69,5 @@ jobs:
labels: |
CI: GraalPy
CI: PyPy
CI: PyPy EoL
dependencies
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
+2 -2
View File
@@ -16,9 +16,9 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1
+1
View File
@@ -122,3 +122,4 @@ site/
# This file should be a symlink or contain "See @AGENTS.md"
CLAUDE.md
.claude/
+13 -12
View File
@@ -1,5 +1,5 @@
linux:
image: python:3.12
image: python:3.13
services:
- name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
@@ -14,7 +14,7 @@ linux:
# (comment the below line in a PR to debug a Gitlab-specific issue)
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/'
variables:
CIBW_ENABLE: "all"
script:
@@ -25,28 +25,29 @@ linux:
- python ./bin/run_tests.py
windows:
image: mcr.microsoft.com/windows/servercore:1809
variables:
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
before_script:
- choco install python -y --allow-downgrade --version 3.12.4
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/'
variables:
CIBW_ENABLE: "all"
# Everything except graalpy. GraalPy is JVM-based and very slow to
# start; on the small (2-core) GitLab SaaS Windows runners,
# virtualenv's interpreter query for graalpy.exe times out, failing
# the build. (Other platforms run the full "all" group.)
CIBW_ENABLE: "cpython-prerelease pypy pypy-eol pyodide-eol pyodide-prerelease"
script:
- py -m pip install -U pip
- py -m pip install -e. pytest-custom-exit-code --group test
- py bin\run_tests.py
- python -m pip install -U pip
- python -m pip install -e. pytest-custom-exit-code --group test
- python bin\run_tests.py
tags:
- saas-windows-medium-amd64
macos:
image: macos-14-xcode-15
image: macos-15-xcode-16
variables:
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/'
variables:
CIBW_ENABLE: "all"
script:
+11 -6
View File
@@ -18,14 +18,14 @@ repos:
exclude: ^cibuildwheel/resources/android/android.patch$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 0c7b6c989466a93942def1f84baf36ddfcd60c83 # frozen: v0.15.14
rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20
hooks:
- id: ruff-check
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: fc0f09a29bb495f4a91f00266155d6282d52485d # frozen: v1.20.2
rev: d2823d321df3af8f878f7ee3414dc94d037145b9 # frozen: v2.1.0
hooks:
- id: mypy
name: mypy 3.11 on cibuildwheel/
@@ -37,9 +37,7 @@ repos:
- dependency-groups>=1.2
- humanize
- nox>=2025.2.9
- orjson
- packaging
- pyelftools
- pygithub
- pytest
- rich
@@ -78,6 +76,14 @@ repos:
files: '^(README\.md|docs/changelog\.md|docs/options\.md|bin/readme.*)$'
additional_dependencies: [cogapp>=3.5]
- repo: https://github.com/henryiii/flake8-lazy
rev: 5fed9a818f2583f0403aed779bf2b6c9aa8d25f4 # frozen: v0.8.5
hooks:
- id: flake8-lazy
args: ["--apply=set"]
files: '^cibuildwheel'
exclude: "^cibuildwheel/resources/"
- repo: https://github.com/codespell-project/codespell
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2
hooks:
@@ -87,14 +93,13 @@ repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 943377262562a12b57292fc98fabd7dbf81451fe # frozen: 0.37.2
rev: 1a4bb160cab6417b3045e1b37b6b72449243e658 # frozen: 0.37.4
hooks:
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
- id: check-gitlab-ci
- id: check-readthedocs
- id: check-travis
- id: check-jsonschema
name: Check projects
args: [--schemafile, docs/data/projects.schema.json]
+1 -1
View File
@@ -8,4 +8,4 @@ build:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- NO_COLOR=1 uv run --python 3.14 --managed-python --no-dev --group docs mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html
- NO_COLOR=1 uv run --python 3.14 --managed-python --no-dev --group docs properdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html
+2 -2
View File
@@ -11,7 +11,7 @@
- `nox -s tests -- test -k before_build` — single integration test/file via pytest `-k`.
- `nox -s lint` — run all linters (pre-commit/prek).
- `nox -s pylint` — run pylint separately (not in pre-commit).
- `nox -s docs`mkdocs serve (interactive) or build (non-interactive).
- `nox -s docs`properdocs serve (interactive) or build (non-interactive).
- Set up local dev env at `.venv`: `uv sync` (dependency groups used).
## Project layout
@@ -19,7 +19,7 @@
- `test/`**integration tests** (expensive, run actual wheel builds).
- `unit_test/`**unit tests** (fast, no wheel builds).
- `bin/` — maintainer scripts (update pins, generate README tables, schema, etc.).
- `docs/`mkdocs source.
- `docs/`properdocs (MkDocs fork) source.
## Testing specifics
- Three test suites exist, run in this order by `bin/run_tests.py`:
+104 -64
View File
@@ -22,27 +22,24 @@ What does it do?
While cibuildwheel itself requires a recent Python version to run (we support the last three releases), it can target the following versions to build wheels:
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | Android | iOS | Pyodide |
| ------------------------ | ----------- | ------------------- | ------------- | ------------- | -------------- | ------------------------------ | ---------------------------- | ------------------------------- | ------------------------------- | ----------------------------- | ------------------------------ | ------- | --- | -------------- |
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | N/A |
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | N/A |
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | N/A |
| CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | ✅<sup>3</sup> |
| CPython 3.13 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | ✅ | ✅ | ✅ |
| CPython 3.14 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | ✅ | ✅ | ✅<sup>4</sup> |
| CPython 3.15<sup>6</sup> | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | ✅ | ✅ | N/A |
| PyPy 3.9 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| PyPy 3.10 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| GraalPy 3.11 v24.2 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | N/A | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| GraalPy 3.12 v25.0 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | N/A | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | Android | iOS | Pyodide |
|--------------------| ----------- | ------------------- | ------------- | ------------- | -------------- | ------------------------------ | ---------------------------- | ------------------------------- | ------------------------------- | ----------------------------- | ------------------------------ | ------- | --- | -------------- |
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | N/A | N/A | N/A |
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | N/A | N/A | N/A |
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | N/A | N/A | N/A |
| CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | N/A | N/A | ✅<sup>3</sup> |
| CPython 3.13 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | ✅ |
| CPython 3.14 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | ✅ |
| CPython 3.15 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | |
| PyPy 3.9 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| PyPy 3.10 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
| GraalPy 3.12 v25.0 | ✅ | ✅ | ✅ | N/A | N/A | ✅<sup>1</sup> | N/A | ✅<sup>1</sup> | N/A | N/A | N/A | N/A | N/A | N/A |
<sup>**1** PyPy & GraalPy are only supported for manylinux wheels.</sup><br>
<sup>**2** Windows arm64 support is experimental.</sup><br>
<sup>**3** Not supported on PyPI, uses old `pyodide` tag instead of `pyemscripten`. Requires `pyodide-eol` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable).</sup><br>
<sup>**4** Experimental alpha ABI, do not upload to PyPI yet.</sup><br>
<sup>**5** manylinux armv7l support is experimental. As there are no RHEL based image for this architecture, it's using an Ubuntu based image instead.</sup><br>
<sup>**6** Python 3.15 requires opt-in using [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable).</sup><br>
<sup>**4** manylinux armv7l support is experimental. As there are no RHEL based image for this architecture, it's using an Ubuntu based image instead.</sup><br>
- Builds manylinux, musllinux, macOS, Windows, pyemscripten, iOS, and Android wheels
- Supports CPython, PyPy, and GraalPy
@@ -100,7 +97,7 @@ jobs:
- uses: actions/setup-python@v6
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==4.0.0rc1
run: python -m pip install cibuildwheel==4.2.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
@@ -152,6 +149,7 @@ The following diagram summarises the steps that cibuildwheel takes on each platf
| | [`before-all`](https://cibuildwheel.pypa.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. |
| | [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build |
| | [`xbuild-tools`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-tools) | Binaries on the path that should be included in an isolated cross-build environment. |
| | [`xbuild-files`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-files) | Platform-specific files in the build environment |
| | [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each built wheel |
| | [`manylinux-*-image`<br>`musllinux-*-image`](https://cibuildwheel.pypa.io/en/stable/options/#linux-image) | Specify manylinux / musllinux container images |
| | [`container-engine`](https://cibuildwheel.pypa.io/en/stable/options/#container-engine) | Specify the container engine to use when building Linux wheels |
@@ -173,7 +171,7 @@ The following diagram summarises the steps that cibuildwheel takes on each platf
| | [`build-verbosity`](https://cibuildwheel.pypa.io/en/stable/options/#build-verbosity) | Increase/decrease the output of the build |
<!--[[[end]]] (sum: b7YIjCyCkf) -->
<!--[[[end]]] (sum: Of/28Z7Nut) -->
These options can be specified in a pyproject.toml file, or as environment variables, see [configuration docs](https://cibuildwheel.pypa.io/en/latest/configuration/).
@@ -190,8 +188,8 @@ Here are some repos that use cibuildwheel.
|-----------------------------------|----|----|:------|
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an analytical in-process SQL database management system |
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The fundamental package for scientific computing with Python. |
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The venerable Matplotlib, a Python library with C++ portions |
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
@@ -201,8 +199,8 @@ Here are some repos that use cibuildwheel.
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
[duckdb]: https://github.com/duckdb/duckdb
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
[NumPy]: https://github.com/numpy/numpy
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
[NCNN]: https://github.com/Tencent/ncnn
[Matplotlib]: https://github.com/matplotlib/matplotlib
[Tornado]: https://github.com/tornadoweb/tornado
@@ -240,33 +238,107 @@ Changelog
<!-- [[[cog from readme_changelog import mini_changelog; print(mini_changelog()) ]]] -->
### v4.0.0rc1
### v4.2.0
_14 May 2026_
_4 August 2026_
- 🌟 CPython 3.15 wheels are now built by default - without the `"cpython-prerelease"` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) set. It's time to build and upload these wheels to PyPI! This release includes CPython 3.15.0rc1, which is guaranteed to be ABI compatible with the final release. (#2944)
- ✨ Adds Pyodide 3.15 support with the `cp315-pyodide_wasm32` build identifier, using Pyodide 315.0.0a2. These are also stable wrt. the final release. (#2958)
- 🐛 Retries a failed download six times with exponential backoff, so short network outages no longer stop a build. A `4xx` response is still reported at once. (#2953)
- 🐛 Accepts `default` as a [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) value on Pyodide, and accepts `pyodide-build` in the top-level table and in overrides (#2951)
- 🛠 Holds pip back on GraalPy, where newer pip breaks the build (#2955)
- 🛠 Updates Pyodide to 314.0.4 (#2949, #2952)
- 🛠 Updates dependencies and container pins (#2952, #2960)
- 💼 Updates CI action pins (#2948, #2954)
- 🧪 Uses pp311 for the abi3 test, and deletes `test_overridden_pip_constraint`, which is not necessary since #2583 (#2956, #2957)
### v4.1.1
_24 July 2026_
- ✨ Adds `pyodide-build` as a separate [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend), now the default frontend for Pyodide, with verbosity flags handling. Any other frontend is ignored with a warning on Pyodide. (#2609, #2945)
- 🔐 Uses digests instead of tags for pinned container images, strengthening supply-chain security. The human-readable tags remain as comments in `pinned_docker_images.cfg`. (#2915)
- 🐛 Fixes platform-specific [`test-runtime`](https://cibuildwheel.pypa.io/en/stable/options/#test-runtime) environment variables (e.g. `CIBW_TEST_RUNTIME_ANDROID`) not being honored (#2941)
- 🐛 Fixes quoting of [`test-requires`](https://cibuildwheel.pypa.io/en/stable/options/#test-requires) and [`audit-requires`](https://cibuildwheel.pypa.io/en/stable/options/#audit-requires) so PEP 508 specifiers containing spaces work (#2913)
- 🐛 Makes [`archs`](https://cibuildwheel.pypa.io/en/stable/options/#archs) parsing case-insensitive and platform-aware, so e.g. `arm64` works on Windows (#2920)
- 🐛 Uses an absolute path for the `{project}` placeholder in [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) (#2934)
- 🐛 Validates the [`pyodide-version`](https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version) option against the build identifier with a clear error (#2925)
- 🐛 Fixes PyPy installs on macOS after PyPy switched its downloads from `.tar.bz2` to `.tar.gz` (#2939)
- 🐛 Makes a matching `python3-config` available in the build and test venvs on macOS (#2922)
- 🛠 Updates dependencies and container pins (#2917, #2935, #2939)
- 🛠 Updates Android tests to current Python versions and the new test repository URL (#2933)
- 🛠 Drops the `orjson` dependency, no longer used by mypy 2+ (#2923)
- 📚 Builds the docs with properdocs, a MkDocs fork (#2946)
- 📚 Adds the missing `cp314-pyodide_wasm32` entry to the build identifier table (#2947)
- 📚 Removes outdated notes about the `pip wheel` build frontend and ClearLinux (#2926)
- 💼 Adds a "CI: PyPy EoL" PR label to run PyPy EoL tests on PRs (#2930)
- 💼 Updates CI action pins and pre-commit hooks (#2914, #2932, #2938, #2940, #2942, #2943)
### v4.1.0
_12 June 2026_
- ✨ Updates Pyodide to the final 314.0.0 release, so Pyodide 3.14 wheels now build by default without the `pyodide-prerelease` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag. (#2906)
- 🐛 Raises clear errors when a build produces no wheel, instead of failing later with a confusing message (#2909)
- 🛠 Speeds up CLI startup through lazy imports on Python 3.15 (#2797)
- 📚 Adds an FAQ section on caching cibuildwheel's downloaded tools with `CIBW_CACHE_PATH` (#2842)
- 📚 Documentation improvements: clarifies which shell is used for command options, clarifies environment variable precedence, and fixes a dead Pyodide env info link (#2904, #2905, #2911)
### v4.0.0
_7 June 2026_
See @henryiii's [release post](https://iscinumpy.dev/post/cibuildwheel-4-0-0/) for more info on new features!
- 🌟 Adds wheel auditing with `abi3audit` as a default after the repair step, with new [`audit-requires`](https://cibuildwheel.pypa.io/en/stable/options/#audit-requires) and [`audit-command`](https://cibuildwheel.pypa.io/en/stable/options/#audit-command) options (#2805)
- 🌟 Adds `pyemscripten` platform tag support (PEP 783), updates Pyodide to 314.0.0a1, and adds a `pyodide-eol` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag for building end-of-life Pyodide versions (#2812, #2848)
- 🌟 Adds `pyemscripten` platform tag support (PEP 783), updates Pyodide to 314.0.0a2, and adds a `pyodide-eol` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag for building end-of-life Pyodide versions (#2812, #2848)
- 🌟 Sets up `delvewheel` as the default [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) for Windows, so extension module DLLs are now bundled automatically. Skip by setting it to empty if not needed. (#2831)
- ✨ Adds CPython 3.15 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/stable/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.15.0b1. (#2833, #2850)
- ✨ Adds CPython 3.15 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/stable/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.15.0b2. (#2833, #2850)
_While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.14 will be available in cibuildwheel without the flag._ (#2390)
_While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.15 will be available in cibuildwheel without the flag._
- ✨ Adds CPython 3.15 support for iOS and Android (#2857, #2858)
- ✨ Adds Android improvements for building NumPy and related packages, including auditwheel support, pkg-config and Fortran configuration, and the [`xbuild-files`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-files) option (#2695)
- ✨ Adds `CIBUILDWHEEL_BUILD_IDENTIFIER` environment variable set to the current build identifier (e.g. `cp311-manylinux_x86_64`) during per-build steps (#2872)
- ✨ Adds `{project}` and `{package}` placeholders to [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) (#2827)
- ⚠️ Drops support for Python 3.8 (#2686)
- ⚠️ Removes the experimental CPython 3.13 free-threading builds and the `cpython-freethreading` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) option. CPython 3.14+ free-threading support remains available without the enable flag. (#2684)
- ⚠️ Drops support for Cirrus CI, which is shutting down June 1, 2026 (#2817)
- ⚠️ Drops GraalPy 3.11 (gp311) support, as agreed in #2741, and removes GraalPy 24-only workarounds (#2895)
- 🔐 Adds SHA256 verification for direct downloads of Python interpreters, virtualenv, and python-build-standalone assets (#2873)
- 🔐 Adds tarfile extraction filter for safe archive extraction (#2856)
- 🐛 Fixes `UV_PYTHON` not being set for [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) on Linux when using `uv` as the [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) (#2830)
- 🐛 Fixes detection of musl libc when downloading python-build-standalone, which previously always selected the gnu asset on musl hosts like Alpine (#2889)
- 🐛 Fixes [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) expansion when `{project}` or `{package}` contains spaces or backslashes (#2886)
- 🐛 Prevents deadlock when `linux32` fails and forwards platform args to the sanity check (#2880, #2888)
- 🐛 Fixes container resource leaks on start failure and during teardown (#2879, #2887)
- 🐛 Removes potential partial cache-population in case of error (#2892)
- 🐛 Raises a clear error when `ANDROID_API_LEVEL` is not an integer (#2891)
- 🐛 Replaces assert with proper exception in python-build-standalone (#2859)
- 🐛 Uses ConfigurationError when `package_dir` is outside cwd instead of a generic Exception (#2898)
- 🛠 Updates dependencies and container pins (#2893, #2882, #2874, #2868, #2862, #2884, #2845, #2837, #2818, #2810, #2838, #2813)
- 🛠 Updates Android to Python 3.13.13 and 3.14.4 (#2821)
- 🛠 Applies Pyodide-specific patches to the Emscripten toolchain installation (#2800)
- 🛠 Updates dependencies and container pins (#2845, #2837, #2821, #2818, #2810, #2838, #2813)
- 🛠 Uses `python -V -V` for Windows build diagnostics (#2832)
- 🛠 Simplifies pinned container image lookup (#2897)
- 🛠 Minor fixups across error messages, OCI container, and options (#2860)
- 💼 Adds PEP 723 metadata for `bin/` scripts and drops the `bin` dependency group (#2819)
- 💼 Improves Azure test reliability with retries and caching (#2890)
- 💼 Fixes Windows GitLab CI test running (#2870)
- 💼 Updates CI action pins and dev dependencies (#2902, #2867, #2851, #2843, #2826, #2823, #2820, #2807)
- 💼 Adds agent and copilot setup files (#2861)
- 💼 Uses `if TYPE_CHECKING:` blocks (#2866, #2864)
- 🧪 Fixes Android tests using the `uv` frontend (#2809)
- 🧪 Fixes the update-dependencies workflow to use `uv` to run `nox` (#2808)
- 🧪 Adds unit tests for `OCIContainer._get_platform_args` (#2878)
- 📚 Updates documentation for delvewheel as the default Windows [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command), including the build diagram, schema defaults, and legal note (#2877, #2853, #2891)
- 📚 Documents platform-specific [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) configuration (#2834)
- 📚 Updates the "How it works" diagram with details of Android, iOS, and Pyodide builds (#2816)
- 📚 Adds Pyodide icon and regenerates working examples data for Android, iOS, and Pyodide (#2815, #2811)
- 📚 Adds intersphinx support for external documentation linking (#2871)
- 📚 Adds instructions for building CUDA wheels and fixes manylinux container references in FAQ (#2896, #2900)
- 📚 Links back to source in docs (#2806)
- 💼 Adds PEP 723 metadata for `bin/` scripts and drops the `bin` dependency group (#2819)
- 💼 Updates CI action pins and dev dependencies (#2851, #2843, #2826, #2823, #2820, #2807)
- 🧪 Fixes Android tests using the `uv` frontend (#2809)
- 🧪 Fixes the update-dependencies workflow to use `uv` to run `nox` (#2808)
- 📚 Removes outdated numpy info (#2855)
### v3.4.1
@@ -279,39 +351,7 @@ _2 April 2026_
- ✨ cibuildwheel prints the selected build identifiers at the start of the build. (#2785)
- 🔐 The GitHub Action now references other actions with a full SHA (#2744)
### v3.4.0
_5 March 2026_
- 🌟 You can now build wheels using `uv` as a build frontend. This should improve performance, especially if your project has lots of build dependencies. To use, set [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) to `uv`. (#2322)
- ⚠️ We no longer support running on Travis CI. It may continue working but we don't run tests there anymore so we can't be sure. (#2682)
- ✨ Improvements to building rust wheels on Android (#2650)
- 🛠 Update Pyodide to 0.29.3 (#2719, #2733)
- 🐛 Fix bug with the GitHub Action on Windows, where PATH was getting unnecessarily changed, causing issues with meson builds. (#2723)
- ✨ Add support for quiet setting on `build` and `uv` from the cibuildwheel `build-verbosity` setting. (#2737)
- 📚 Docs updates, including guidance on using Meson on Windows (#2718)
### v3.3.1
_5 January 2026_
- 🛠 Update dependencies and container pins, including updating to CPython 3.14.2. (#2708)
### v3.3.0
_12 November 2025_
- 🐛 Fix an incompatibility with Docker v29 (#2660)
- ✨ Adds `test-runtime` option, to customise how tests on simulated/emulated environments are run (#2636)
- ✨ Adds support for new `manylinux_2_35` images on 32-bit ARM `armv7l`, offering better C++20 compatibility (#2656)
- ✨ `build[uv]` is now supported on Android (#2587)
- ✨ You can now install extras (such as `uv`) with a simple option on the GitHub Action (#2630)
- ✨ `{project}` and `{package}` placeholders are now supported in `repair-wheel-command` (#2589)
- 🛠 The versions set with `dependency-versions` no longer constrain packages specified by your `build-system.requires`. Previously, on platforms other than Linux, the constraints in this option would remain in the environment during the build. This has been tidied up make behaviour more consistent between platforms, and to prevent version conflicts. (#2583)
- 🛠 Improve the handling of `test-command` on Android, enabling more options to be passed (#2590)
- 📚 Docs improvements (#2618)
<!-- [[[end]]] (sum: ZD0EjcyC0B) -->
<!-- [[[end]]] (sum: fEuiF50wvg) -->
---
+1 -1
View File
@@ -28,7 +28,7 @@ branding:
runs:
using: composite
steps:
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
id: python
with:
python-version: "3.11 - 3.14"
+28 -13
View File
@@ -12,46 +12,61 @@ pr:
- .readthedocs.yml
- .travis.yml
- README.md
- mkdocs.yml
- properdocs.yml
- noxfile.py
jobs:
- job: tests
strategy:
matrix:
linux_311:
linux_313:
imageName: "ubuntu-latest"
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "native"
android_311:
android_313:
imageName: "ubuntu-latest"
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "android"
macos_311:
macos_313:
imageName: "macos-latest"
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "native"
ios_311:
ios_313:
imageName: "macos-14" # See https://github.com/actions/runner-images/issues/12777
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "ios"
android_macos_311:
android_macos_313:
imageName: "macos-latest"
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "android"
windows_311:
windows_313:
imageName: "windows-latest"
pythonVersion: "3.11"
pythonVersion: "3.13"
testSelect: "native"
timeoutInMinutes: 180
pool:
vmImage: $(imageName)
variables:
# Relocate cibuildwheel's download cache (interpreters) and the per-worker
# test pip caches (which live under it) to a stable, cacheable path.
CIBW_CACHE_PATH: $(Pipeline.Workspace)/.cibw-cache
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(pythonVersion)
- task: Cache@2
displayName: 'Cache cibuildwheel downloads'
inputs:
# build-platforms.toml carries the interpreter pins; bump the version
# prefix to force a cold cache. restoreKeys lets a stale cache still seed
# a new run (cibuildwheel re-downloads only what's missing).
key: 'cibw-cache | v1 | "$(imageName)" | "$(testSelect)" | cibuildwheel/resources/build-platforms.toml'
restoreKeys: |
cibw-cache | v1 | "$(imageName)" | "$(testSelect)"
path: $(CIBW_CACHE_PATH)
- task: JavaToolInstaller@0
condition: and(eq(variables['testSelect'], 'android'), eq(variables['Agent.OS'], 'Linux'))
inputs:
+70 -32
View File
@@ -15,6 +15,8 @@ parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--schemastore", action="store_true", help="Generate schema_store version")
args = parser.parse_args()
# The defaults in the schema are used by external tools for validation and IDE support. They
# should match the values in defaults.toml, which are used by cibuildwheel itself.
starter = """
$schema: http://json-schema.org/draft-07/schema#
$id: https://github.com/pypa/cibuildwheel/blob/main/cibuildwheel/resources/cibuildwheel.schema.json
@@ -33,7 +35,7 @@ $defs:
- pyodide-prerelease
- pypy
- pypy-eol
description: A Python version or flavor to enable.
description: A Python version or flavor to enable.
additionalProperties: false
description: cibuildwheel's settings.
type: object
@@ -60,29 +62,7 @@ properties:
default: ['*']
description: Choose the Python versions to build.
type: string_array
build-frontend:
default: default
description: Set the tool to use to build, either "build" (default), "build[uv]", "uv", or "pip"
oneOf:
- enum: [pip, build, "build[uv]", uv, default]
- type: string
pattern: '^pip; ?args:'
- type: string
pattern: '^build; ?args:'
- type: string
pattern: '^build\\[uv\\]; ?args:'
- type: string
pattern: '^uv; ?args:'
- type: object
additionalProperties: false
required: [name]
properties:
name:
enum: [pip, build, "build[uv]", uv]
args:
type: array
items:
type: string
build-frontend: {} # filled in by build_frontend_schema below
build-verbosity:
type: integer
minimum: -3
@@ -200,6 +180,9 @@ properties:
xbuild-tools:
description: Binaries on the path that should be included in an isolated cross-build environment
type: string_array
xbuild-files:
description: Platform-specific files in the build environment
type: string_table_array
pyodide-version:
type: string
description: Specify the version of Pyodide to use
@@ -287,6 +270,43 @@ string_table = yaml.safe_load(
"""
)
FRONTENDS = ["pip", "build", "build[uv]", "uv"]
def build_frontend_schema(
names: list[str], description: str, default: str = "default"
) -> dict[str, Any]:
"""
A frontend is a name, a "name; args: ..." string, or a table with a name and args.
"""
# Only the brackets in "build[uv]" need escaping
patterns = [name.replace("[", r"\[").replace("]", r"\]") for name in names]
return {
"default": default,
"description": description,
"oneOf": [
{"enum": [*names, "default"]},
*({"type": "string", "pattern": f"^{pattern}; ?args:"} for pattern in patterns),
{
"type": "object",
"additionalProperties": False,
"required": ["name"],
"properties": {
"name": {"enum": names},
"args": {"type": "array", "items": {"type": "string"}},
},
},
],
"title": "CIBW_BUILD_FRONTEND",
}
schema["properties"]["build-frontend"] = build_frontend_schema(
[*FRONTENDS, "pyodide-build"],
'Set the tool to use to build, either "build" (default), "build[uv]", "uv", or "pip"'
' ("pyodide-build" for pyodide)',
)
for value in schema["properties"].values():
match value:
case {"type": "string_array"}:
@@ -319,6 +339,7 @@ items:
before-all: {"$ref": "#/$defs/inherit"}
before-build: {"$ref": "#/$defs/inherit"}
xbuild-tools: {"$ref": "#/$defs/inherit"}
xbuild-files: {"$ref": "#/$defs/inherit"}
before-test: {"$ref": "#/$defs/inherit"}
config-settings: {"$ref": "#/$defs/inherit"}
container-engine: {"$ref": "#/$defs/inherit"}
@@ -374,17 +395,34 @@ oses = {
"ios": as_object(not_linux),
}
oses["linux"]["properties"]["repair-wheel-command"] = {
**schema["properties"]["repair-wheel-command"],
"default": "auditwheel repair -w {dest_dir} {wheel}",
}
oses["macos"]["properties"]["repair-wheel-command"] = {
**schema["properties"]["repair-wheel-command"],
"default": "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
}
for os_name, command in [
("linux", "auditwheel repair -w {dest_dir} {wheel}"),
("windows", "delvewheel repair -w {dest_dir} -v {wheel}"),
("macos", "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"),
("android", "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"),
]:
oses[os_name]["properties"]["repair-wheel-command"] = {
**schema["properties"]["repair-wheel-command"],
"default": command,
}
del oses["linux"]["properties"]["dependency-versions"]
schema["$defs"]["build-frontend-no-pyodide"] = build_frontend_schema(
FRONTENDS,
'Set the tool to use to build, either "build" (default), "build[uv]", "uv", or "pip"',
)
for os_val in oses.values():
os_val["properties"]["build-frontend"] = {"$ref": "#/$defs/build-frontend-no-pyodide"}
oses["pyodide"]["properties"]["build-frontend"] = build_frontend_schema(
["pyodide-build"],
'On the pyodide platform, the build frontend must be "pyodide-build"',
default="pyodide-build",
)
schema["properties"]["overrides"] = overrides
schema["properties"] |= oses
+7 -3
View File
@@ -3,6 +3,7 @@
# /// script
# dependencies = [
# "click",
# "jinja2",
# ]
# ///
@@ -39,13 +40,16 @@ def generate_project(path: Path, build_backend: BuildBackend) -> None:
sys.path.insert(0, "")
match build_backend:
case "meson":
from test.test_projects.meson import new_meson_project as new_project # noqa: PLC0415
from test.test_projects.meson import new_meson_project # noqa: PLC0415
project = new_meson_project()
case "setuptools":
from test.test_projects.setuptools import new_c_project as new_project # noqa: PLC0415
from test.test_projects.setuptools import new_c_project # noqa: PLC0415
project = new_c_project()
case _:
typing.assert_never(build_backend)
project = new_project()
project.generate(path)
+90 -42
View File
@@ -9,6 +9,7 @@
import configparser
import dataclasses
from functools import cache
from pathlib import Path
import requests
@@ -33,7 +34,7 @@ class PyPAImage(Image):
super().__init__(manylinux_version, platforms, image_name, tag, True)
images = [
IMAGES = [
# manylinux2014 images
PyPAImage(
"manylinux2014",
@@ -88,49 +89,71 @@ images = [
),
]
config = configparser.ConfigParser()
for image in images:
# get the tag name whose digest matches 'latest'
if image.tag is not None:
# image has been pinned, do not update
tag_name = image.tag
elif image.image_name.startswith("quay.io/"):
_, _, repository_name = image.image_name.partition("/")
response = requests.get(
f"https://quay.io/api/v1/repository/{repository_name}?includeTags=true"
)
response.raise_for_status()
repo_info = response.json()
tags_dict = repo_info["tags"]
latest_tag = tags_dict.pop("latest")
@cache
def quay_lookup(image_name: str, tag_name: str) -> tuple[str, str]:
_, _, repository_name = image_name.partition("/")
if tag_name == "latest":
url = f"https://quay.io/api/v1/repository/{repository_name}?includeTags=true"
else:
url = f"https://quay.io/api/v1/repository/{repository_name}/tag?specificTag={tag_name}"
response = requests.get(url)
response.raise_for_status()
info = response.json()
if tag_name == "latest":
tags_dict = info["tags"]
tag_info = tags_dict.pop(tag_name)
# find the tag whose manifest matches 'latest'
tag_name = next(
name
tag_name, digest = next(
(name, info["manifest_digest"])
for (name, info) in tags_dict.items()
if info["manifest_digest"] == latest_tag["manifest_digest"]
if info["manifest_digest"] == tag_info["manifest_digest"]
)
elif image.image_name.startswith("ghcr.io/"):
repository = image.image_name[8:]
response = requests.get(
"https://ghcr.io/token", params={"scope": f"repository:{repository}:pull"}
)
response.raise_for_status()
token = response.json()["token"]
else:
tags_list = info["tags"]
tag_info = next(tag for tag in tags_list if tag["name"] == tag_name)
digest = tag_info["manifest_digest"]
return tag_name, digest
@cache
def ghcr_lookup(image_name: str, tag_name: str) -> tuple[str, str]:
repository = image_name[8:]
response = requests.get(
"https://ghcr.io/token", params={"scope": f"repository:{repository}:pull"}
)
response.raise_for_status()
token = response.json()["token"]
if tag_name == "latest":
response = requests.get(
f"https://ghcr.io/v2/{repository}/tags/list",
headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
ghcr_tags = [(Version(tag), tag) for tag in response.json()["tags"] if tag != "latest"]
info = response.json()
ghcr_tags = [(Version(tag), tag) for tag in info["tags"] if tag != "latest"]
ghcr_tags.sort(reverse=True)
tag_name = ghcr_tags[0][1]
else:
response = requests.get(f"https://hub.docker.com/v2/repositories/{image.image_name}/tags")
response.raise_for_status()
tags = response.json()["results"]
response = requests.head(
f"https://ghcr.io/v2/{repository}/manifests/{tag_name}",
headers={
"Authorization": f"Bearer {token}",
"Accept": "application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, application/vnd.oci.artifact.manifest.v1+json",
},
)
response.raise_for_status()
digest = response.headers["Docker-Content-Digest"]
return tag_name, digest
@cache
def dockerhub_lookup(image_name: str, tag_name: str) -> tuple[str, str]:
response = requests.get(f"https://hub.docker.com/v2/repositories/{image_name}/tags")
response.raise_for_status()
tags = response.json()["results"]
if tag_name == "latest":
latest_tag = next(tag for tag in tags if tag["name"] == "latest")
# i don't know what it would mean to have multiple images per tag
assert len(latest_tag["images"]) == 1
@@ -139,15 +162,40 @@ for image in images:
pinned_tag = next(
tag for tag in tags if tag != latest_tag and tag["images"][0]["digest"] == digest
)
tag_name = pinned_tag["name"]
else:
pinned_tag = next(tag for tag in tags if tag["name"] == tag_name)
digest = pinned_tag["images"][0]["digest"]
tag_name = pinned_tag["name"]
return tag_name, digest
for platform in image.platforms:
if not config.has_section(platform):
config[platform] = {}
suffix = ""
if image.use_platform_suffix:
suffix = f"_{platform.removeprefix('pypy_')}"
config[platform][image.manylinux_version] = f"{image.image_name}{suffix}:{tag_name}"
with open(RESOURCES / "pinned_docker_images.cfg", "w") as f:
config.write(f)
def main() -> None:
config = configparser.ConfigParser()
for image in IMAGES:
# get the tag name whose digest matches 'latest'
# if image has been pinned, do not update
search_tag = image.tag or "latest"
if image.image_name.startswith("quay.io/"):
lookup = quay_lookup
elif image.image_name.startswith("ghcr.io/"):
lookup = ghcr_lookup
else:
lookup = dockerhub_lookup
tag_name, digest = lookup(image.image_name, search_tag)
for platform in image.platforms:
if not config.has_section(platform):
config[platform] = {}
image_name = image.image_name
if image.use_platform_suffix:
image_name = f"{image_name}_{platform.removeprefix('pypy_')}"
_, digest = lookup(image_name, tag_name)
assert digest.startswith("sha256:")
config[platform][image.manylinux_version] = f"{image_name}@{digest} # {tag_name}"
with open(RESOURCES / "pinned_docker_images.cfg", "w") as f:
config.write(f)
if __name__ == "__main__":
main()
+27 -20
View File
@@ -124,14 +124,22 @@ class GraalPyVersions:
response.raise_for_status()
releases = response.json()
gp_version_re = re.compile(r"-(\d+\.\d+\.\d+)$")
gp_asset_re = re.compile(
r"^(?P<prefix>graalpy(?P<cpython>\d+\.\d+)?-(?P<graalpy>\d+\.\d+\.\d+))-"
)
cp_version_re = re.compile(r"Python (\d+\.\d+(?:\.\d+)?)")
for release in releases:
m = gp_version_re.search(release["tag_name"])
if m:
release["graalpy_version"] = Version(m.group(1))
m = cp_version_re.search(release["body"])
if m:
for asset in release["assets"]:
m = gp_asset_re.match(asset["name"])
if m:
release["asset_prefix"] = m.group("prefix")
release["graalpy_version"] = Version(m.group("graalpy"))
if m.group("cpython"):
release["python_version"] = Version(m.group("cpython"))
break
if "python_version" not in release and (
m := cp_version_re.search(release["body"] or "")
):
release["python_version"] = Version(m.group(1))
self.releases = [r for r in releases if "graalpy_version" in r and "python_version" in r]
@@ -158,10 +166,6 @@ class GraalPyVersions:
msg = f"GraalPy {arch} not found for {spec}!"
raise RuntimeError(msg)
release = releases[-1]
version = release["python_version"]
gpversion = release["graalpy_version"]
if "macosx" in identifier:
arch = "x86_64" if "x86_64" in identifier else "arm64"
platform = "macos"
@@ -174,15 +178,19 @@ class GraalPyVersions:
arch = "amd64" if arch == "x86_64" else "aarch64"
ext = "zip" if "win" in identifier else "tar.gz"
urls = [
rf["browser_download_url"]
for rf in release["assets"]
if rf["name"].endswith(f"{platform}-{arch}.{ext}")
and rf["name"].startswith(f"graalpy-{gpversion.major}")
]
if urls:
for release in reversed(releases):
version = release["python_version"]
urls = [
rf["browser_download_url"]
for rf in release["assets"]
if rf["name"].endswith(f"{platform}-{arch}.{ext}")
and rf["name"].startswith(release["asset_prefix"])
]
if not urls:
continue
(url,) = urls
# Fetch sha256 from the ".sha256" sidecar asset in the same release
# Fetch sha256 from the ".sha256" sidecar asset in the same release.
sha256 = ""
sha256_asset_name = url.rsplit("/", 1)[-1] + ".sha256"
sha256_urls = [
@@ -200,6 +208,7 @@ class GraalPyVersions:
url=url,
sha256=sha256,
)
return None
@@ -494,8 +503,6 @@ class AllVersions:
elif "macosx_arm64" in identifier:
config_update = self.macos_pypy_arm64.update_version_macos(spec)
elif identifier.startswith("gp"):
if "macosx_x86_64" in identifier:
return
config_update = self.graalpy.update_version(identifier, spec)
elif "t-win32" in identifier and identifier.startswith("cp"):
config_update = self.windows_t_32.update_version_windows(spec)
+2 -2
View File
@@ -99,7 +99,7 @@ def update_virtualenv(force: bool, level: str) -> None:
else:
version = local_version
url = default["url"]
sha256 = default.get("sha256", "")
sha256 = default["sha256"]
# Compute sha256 if not already stored (new version or first-time population)
if not sha256:
@@ -117,7 +117,7 @@ def update_virtualenv(force: bool, level: str) -> None:
"sha256": sha256,
}
result_toml = "".join(
f'{key} = {{ version = "{value["version"]}", url = "{value["url"]}", sha256 = "{value.get("sha256", "")}" }}\n'
f'{key} = {{ version = "{value["version"]}", url = "{value["url"]}", sha256 = "{value["sha256"]}" }}\n'
for key, value in configurations.items()
)
+1 -1
View File
@@ -1 +1 @@
__version__ = "4.0.0rc1"
__version__ = "4.2.0"
+32 -22
View File
@@ -1,9 +1,35 @@
from __future__ import annotations
__lazy_modules__ = {
"argparse",
"cibuildwheel._compat",
"cibuildwheel._compat.tarfile",
"cibuildwheel.architecture",
"cibuildwheel.ci",
"cibuildwheel.logger",
"cibuildwheel.options",
"cibuildwheel.platforms",
"cibuildwheel.selector",
"cibuildwheel.typing",
"cibuildwheel.util",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.resources",
"contextlib",
"functools",
"io",
"pathlib",
"shutil",
"tempfile",
"textwrap",
"traceback",
}
import argparse
import contextlib
import dataclasses
import functools
import io
import os
import shutil
import sys
@@ -30,7 +56,7 @@ from cibuildwheel.util.resources import read_all_configs
TYPE_CHECKING = False
if TYPE_CHECKING:
from collections.abc import Generator, Iterable, Sequence
from typing import Any, Literal, TextIO
from typing import Literal
@dataclasses.dataclass
@@ -44,23 +70,6 @@ class FileReport:
size: str
# Taken from https://stackoverflow.com/a/107717
class Unbuffered:
def __init__(self, stream: TextIO) -> None:
self.stream = stream
def write(self, data: str) -> None:
self.stream.write(data)
self.stream.flush()
def writelines(self, data: Iterable[str]) -> None:
self.stream.writelines(data)
self.stream.flush()
def __getattr__(self, attr: str) -> Any: # noqa: ANN401
return getattr(self.stream, attr)
def main() -> None:
global_options = GlobalOptions()
try:
@@ -360,10 +369,11 @@ def build_in_directory(args: CommandLineArguments) -> None:
# Add CIBUILDWHEEL environment variable
os.environ["CIBUILDWHEEL"] = "1"
# Python is buffering by default when running on the CI platforms, giving
# problems interleaving subprocess call output with unflushed calls to
# 'print'
sys.stdout = Unbuffered(sys.stdout)
# Python block-buffers stdout when it isn't a tty, which de-interleaves
# `print` output and direct fd-1 writes from subprocesses sharing this
# stdout. line_buffering allows each newline to flush all the way to fd-1.
if isinstance(sys.stdout, io.TextIOWrapper):
sys.stdout.reconfigure(line_buffering=True)
# create the cache dir before it gets printed & builds performed
CIBW_CACHE_PATH.mkdir(parents=True, exist_ok=True)
+22 -4
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"platform", "re", "shutil", "subprocess"}
import platform as platform_module
import re
import shutil
@@ -105,13 +107,29 @@ class Architecture(StrEnum):
case "auto32":
result |= cls.bitness_archs(platform=platform, bitness="32")
case _:
try:
result.add(cls(arch_str))
except ValueError as e:
if arch := cls._parse_arch_name(arch_str, platform=platform):
result.add(arch)
else:
msg = f"Invalid architecture '{arch_str}'"
raise errors.ConfigurationError(msg) from e
raise errors.ConfigurationError(msg)
return result
@classmethod
def _parse_arch_name(cls, arch_str: str, platform: PlatformName) -> Self | None:
"""Resolve an architecture name case-insensitively.
The same value (e.g. "arm64"/"ARM64") can map to different members
depending on the platform, so prefer a member valid for ``platform``
before falling back to any case-insensitive match.
"""
for arch in cls.all_archs(platform):
if arch.value.lower() == arch_str.lower():
return arch
for arch in cls:
if arch.value.lower() == arch_str.lower():
return arch
return None
@classmethod
def native_arch(cls, platform: PlatformName) -> Self | None:
native_machine = platform_module.machine()
+11
View File
@@ -1,5 +1,16 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"pathlib",
"subprocess",
}
import subprocess
import sys
from pathlib import Path
+2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"bashlex", "subprocess"}
import dataclasses
import subprocess
+2
View File
@@ -1,3 +1,5 @@
__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers"}
import os
import re
from enum import Enum
+2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"bashlex", "bashlex.errors"}
import dataclasses
from typing import Protocol
+18
View File
@@ -4,6 +4,8 @@ a different return code, by defining them all here, we can ensure that they're
semantically clear and unique.
"""
__lazy_modules__ = {"textwrap"}
import textwrap
@@ -109,3 +111,19 @@ class AuditCommandFailedError(FatalError):
def __init__(self, message: str) -> None:
super().__init__(message)
self.return_code = 9
class BuildProducedNoWheelError(FatalError):
def __init__(self) -> None:
message = textwrap.dedent(
"""
Build failed because the build frontend completed successfully but
did not produce a wheel.
This usually indicates a problem with your project configuration or
build backend. Check your project configuration, or run cibuildwheel
with CIBW_BUILD_VERBOSITY=1 to view build logs.
"""
)
super().__init__(message)
self.return_code = 10
+3 -1
View File
@@ -4,6 +4,8 @@ These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
from __future__ import annotations
__lazy_modules__ = {"io", "json", "urllib", "urllib.error", "urllib.request"}
import json
import time
import typing
@@ -103,7 +105,7 @@ class PyodideXBuildEnvInfo(typing.TypedDict):
def get_pyodide_xbuildenv_info() -> PyodideXBuildEnvInfo:
xbuildenv_info_url = (
"https://pyodide.github.io/pyodide/api/pyodide-cross-build-environments.json"
"https://pyodide.github.io/pyodide/api/v2/pyodide-cross-build-environments.json"
)
with urllib.request.urlopen(xbuildenv_info_url) as response:
return typing.cast("PyodideXBuildEnvInfo", json.loads(response.read().decode("utf-8")))
+19 -2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers", "shlex"}
import dataclasses
import shlex
import typing
@@ -14,7 +16,7 @@ if TYPE_CHECKING:
from cibuildwheel.typing import PathOrStr
BuildFrontendName = Literal["pip", "build", "build[uv]", "uv"]
BuildFrontendName = Literal["pip", "build", "build[uv]", "uv", "pyodide-build"]
@dataclasses.dataclass(frozen=True)
@@ -44,6 +46,11 @@ class BuildFrontendConfig:
def _get_verbosity_flags(level: int, frontend: BuildFrontendName) -> list[str]:
if frontend == "pyodide-build":
if level > 0:
return ["-" + min(level, 2) * "v"]
return []
if level < 0:
return ["-" + -level * "q"]
@@ -62,7 +69,17 @@ def _split_config_settings(config_settings: str) -> list[str]:
def prepare_config_settings(config_settings: str, *, project: PathOrStr, package: PathOrStr) -> str:
return prepare_command(config_settings, project=project, package=package)
# Substitute the {project}/{package} placeholders on each already-split
# token rather than on the raw string. A substituted path may contain
# spaces or backslashes (e.g. a Windows `{package}` path), and the result
# is later re-parsed with shlex.split (in _split_config_settings /
# parse_config_settings) — substituting on the whole string would let
# those characters be reinterpreted, splitting one setting into several or
# eating backslashes. shlex.join re-quotes each token so the round-trip is
# lossless.
settings = shlex.split(config_settings)
prepared = [prepare_command(setting, project=project, package=package) for setting in settings]
return shlex.join(prepared)
# Based on build.__main__.main.
+14 -2
View File
@@ -1,5 +1,17 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.ci",
"contextlib",
"functools",
"hashlib",
"humanize",
"io",
"pathlib",
"re",
"textwrap",
}
import codecs
import contextlib
import dataclasses
@@ -363,11 +375,11 @@ class Logger:
out.write("\n")
return out.getvalue()
@property
@functools.cached_property
def colors(self) -> Colors:
return Colors(enabled=self.colors_enabled)
@property
@functools.cached_property
def symbols(self) -> Symbols:
return Symbols(unicode=self.unicode_enabled)
+108 -45
View File
@@ -1,5 +1,24 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.ci",
"cibuildwheel.errors",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"contextlib",
"io",
"json",
"platform",
"shlex",
"shutil",
"subprocess",
"textwrap",
"uuid",
}
import contextlib
import dataclasses
import io
import json
@@ -206,7 +225,6 @@ class OCIContainer:
UTILITY_PYTHON = "/opt/python/cp39-cp39/bin/python"
process: subprocess.Popen[bytes]
bash_stdin: IO[bytes]
bash_stdout: IO[bytes]
@@ -226,6 +244,7 @@ class OCIContainer:
self.oci_platform = oci_platform
self.cwd = cwd
self.name: str | None = None
self.process: subprocess.Popen[bytes] | None = None
self.engine = engine
self.host_tar_format = ""
if sys.platform.startswith("darwin"):
@@ -257,10 +276,12 @@ class OCIContainer:
# this allows to run local only images
pull = "never"
except subprocess.CalledProcessError:
# silently fallback to "--pull=always"
pass
return f"--platform={oci_platform.value}", f"--pull={pull}"
def __enter__(self) -> Self:
assert self.process is None
self.name = f"cibuildwheel-{uuid.uuid4()}"
_check_engine_version(self.engine)
@@ -296,7 +317,17 @@ class OCIContainer:
).strip()
else:
raise
simulate_32_bit = container_machine not in {"i686", "armv7l", "armv8l"}
if container_machine not in {"i686", "armv7l", "armv8l"}:
simulate_32_bit = True
# sanity check to ensure no deadlock waiting for container to start
call(
*run_cmd,
*platform_args,
self.image,
"linux32",
"/bin/true",
capture_stdout=True,
)
shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"]
@@ -318,32 +349,41 @@ class OCIContainer:
check=True,
)
self.process = subprocess.Popen(
[
self.engine.name,
"start",
"--attach",
"--interactive",
self.name,
],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
try:
self.process = subprocess.Popen(
[
self.engine.name,
"start",
"--attach",
"--interactive",
self.name,
],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
assert self.process.stdin
assert self.process.stdout
self.bash_stdin = self.process.stdin
self.bash_stdout = self.process.stdout
assert self.process.stdin
assert self.process.stdout
self.bash_stdin = self.process.stdin
self.bash_stdout = self.process.stdout
# run a noop command to block until the container is responding
self.call(["/bin/true"], cwd="/")
if self.cwd:
# Although `docker create -w` does create the working dir if it
# does not exist, podman does not. There does not seem to be a way
# to setup a workdir for a container running in podman.
self.call(["mkdir", "-p", os.fspath(self.cwd)], cwd="/")
# run a noop command to block until the container is responding
self.call(["/bin/true"], cwd="/")
if self.cwd:
# Although `docker create -w` does create the working dir if it
# does not exist, podman does not. There does not seem to be a way
# to setup a workdir for a container running in podman.
self.call(["mkdir", "-p", os.fspath(self.cwd)], cwd="/")
except BaseException:
# clean-up
if self.process is not None:
if self.process.poll() is None:
self.process.kill()
self.process.communicate()
self.process = None
self._remove_container()
raise
return self
def __exit__(
@@ -352,29 +392,52 @@ class OCIContainer:
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> None:
self.bash_stdin.write(b"exit 0\n")
self.bash_stdin.flush()
self.process.wait(timeout=30)
self.bash_stdin.close()
self.bash_stdout.close()
assert self.process is not None
try:
# Ask bash to exit cleanly and wait for the `start` process to finish.
# If the container/bash has already died, the write raises
# BrokenPipeError; if bash refuses to exit, `wait` raises
# TimeoutExpired. Both are handled below so we always reach the
# cleanup in `finally` rather than leaking the process or container.
self.bash_stdin.write(b"exit 0\n")
self.bash_stdin.flush()
self.process.wait(timeout=30)
if self.engine.name == "podman":
# This works around what seems to be a race condition in the podman
# backend. The full reason is not understood. See PR #966 for a
# discussion on possible causes and attempts to remove this line.
# For now, this seems to work "well enough".
self.process.wait()
if self.engine.name == "podman":
# This works around what seems to be a race condition in the
# podman backend. The full reason is not understood. See PR #966
# for a discussion on possible causes and attempts to remove this
# line. For now, this seems to work "well enough".
self.process.wait()
except (OSError, subprocess.TimeoutExpired):
# bash didn't shut down cleanly; force the process down so it isn't
# leaked, then continue to cleanup.
if self.process.poll() is None:
self.process.kill()
self.process.wait()
finally:
with contextlib.suppress(OSError):
self.bash_stdin.close()
with contextlib.suppress(OSError):
self.bash_stdout.close()
self.process = None
assert isinstance(self.name, str)
keep_container = strtobool(os.environ.get("CIBW_DEBUG_KEEP_CONTAINER", ""))
if not keep_container:
self._remove_container()
keep_container = strtobool(os.environ.get("CIBW_DEBUG_KEEP_CONTAINER", ""))
if not keep_container:
subprocess.run(
[self.engine.name, "rm", "--force", "-v", self.name],
stdout=subprocess.DEVNULL,
check=False,
)
self.name = None
def _remove_container(self) -> None:
assert self.name is not None
result = subprocess.run(
[self.engine.name, "rm", "--force", "-v", self.name],
stdout=subprocess.DEVNULL,
check=False,
)
# only warn when not running in CI
if result.returncode != 0 and detect_ci_provider() is None:
msg = f"Failed to remove {self.name!r} container."
log.warning(msg)
self.name = None
def copy_into(self, from_path: Path, to_path: PurePath) -> None:
if from_path.is_dir():
+64 -20
View File
@@ -1,5 +1,29 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.environment",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.oci_container",
"cibuildwheel.projectfiles",
"cibuildwheel.selector",
"cibuildwheel.typing",
"cibuildwheel.util",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"collections",
"configparser",
"contextlib",
"difflib",
"packaging",
"packaging.specifiers",
"pathlib",
"shlex",
"textwrap",
"tomllib",
}
import collections
import configparser
import contextlib
@@ -19,7 +43,7 @@ from packaging.specifiers import SpecifierSet
from cibuildwheel import errors
from cibuildwheel.architecture import Architecture
from cibuildwheel.environment import EnvironmentParseError, ParsedEnvironment, parse_environment
from cibuildwheel.frontend import BuildFrontendConfig
from cibuildwheel.frontend import BuildFrontendConfig, BuildFrontendName
from cibuildwheel.logger import log
from cibuildwheel.oci_container import OCIContainerEngineConfig
from cibuildwheel.projectfiles import get_requires_python_str, resolve_dependency_groups
@@ -120,6 +144,7 @@ class BuildOptions:
before_all: str
before_build: str | None
xbuild_tools: list[str] | None
xbuild_files: dict[str, list[str]]
repair_command: str
manylinux_images: dict[str, str] | None
musllinux_images: dict[str, str] | None
@@ -772,6 +797,14 @@ class Options:
if xbuild_tools == ["\u0000"]:
xbuild_tools = None
xbuild_files = parse_key_value_string(
self.reader.get(
"xbuild-files",
option_format=ShlexTableFormat(sep="; ", pair_sep=":", allow_merge=False),
),
kw_arg_names=["*"],
)
test_sources = shlex.split(
self.reader.get(
"test-sources", option_format=ListFormat(sep=" ", quote=shlex.quote)
@@ -788,7 +821,6 @@ class Options:
test_runtime_str = self.reader.get(
"test-runtime",
env_plat=False,
option_format=ShlexTableFormat(sep="; ", pair_sep=":", allow_merge=False),
)
if not test_runtime_str:
@@ -800,9 +832,11 @@ class Options:
msg = f"Failed to parse test runtime config. {e}"
raise errors.ConfigurationError(msg) from e
test_requires = self.reader.get(
"test-requires", option_format=ListFormat(sep=" ")
).split()
test_requires = shlex.split(
self.reader.get(
"test-requires", option_format=ListFormat(sep=" ", quote=shlex.quote)
)
)
test_extras = self.reader.get("test-extras", option_format=ListFormat(sep=","))
test_groups_str = self.reader.get("test-groups", option_format=ListFormat(sep=" "))
test_groups = [x for x in test_groups_str.split() if x]
@@ -816,8 +850,11 @@ class Options:
env_plat=False,
option_format=ShlexTableFormat(sep="; ", pair_sep=":", allow_merge=False),
)
default_frontend: BuildFrontendName = (
"pyodide-build" if self.platform == "pyodide" else "build"
)
if not build_frontend_str or build_frontend_str == "default":
build_frontend = BuildFrontendConfig("build")
build_frontend = BuildFrontendConfig(default_frontend)
else:
try:
build_frontend = BuildFrontendConfig.from_config_string(build_frontend_str)
@@ -825,6 +862,18 @@ class Options:
msg = f"Failed to parse build frontend. {e}"
raise errors.ConfigurationError(msg) from e
if self.platform == "pyodide" and build_frontend.name != "pyodide-build":
# pip and uv could become an error, eventually. build -> pyodide-build is
# probably fine to keep as a warning
log.warning(
f"The pyodide platform ignores the {build_frontend.name!r} build "
"frontend; using 'pyodide-build' instead"
)
build_frontend = BuildFrontendConfig("pyodide-build", build_frontend.args)
if self.platform != "pyodide" and build_frontend.name == "pyodide-build":
msg = "The 'pyodide-build' build frontend is only supported on the pyodide platform"
raise errors.ConfigurationError(msg)
try:
environment = parse_environment(environment_config)
except (EnvironmentParseError, ValueError) as e:
@@ -871,11 +920,7 @@ class Options:
f"manylinux-{build_platform}-image", ignore_empty=True
)
self._check_pinned_image(config_value, pinned_images)
if config_value in pinned_images:
image = pinned_images[config_value]
else:
image = config_value
manylinux_images[build_platform] = image
manylinux_images[build_platform] = pinned_images.get(config_value, config_value)
for build_platform in MUSLLINUX_ARCHS:
pinned_images = all_pinned_container_images[build_platform]
@@ -883,11 +928,7 @@ class Options:
f"musllinux-{build_platform}-image", ignore_empty=True
)
self._check_pinned_image(config_value, pinned_images)
if config_value in pinned_images:
image = pinned_images[config_value]
else:
image = config_value
musllinux_images[build_platform] = image
musllinux_images[build_platform] = pinned_images.get(config_value, config_value)
container_engine_str = self.reader.get(
"container-engine",
@@ -907,9 +948,11 @@ class Options:
)
audit_command = audit_command_str.split(" && ") if audit_command_str else []
audit_requires = self.reader.get(
"audit-requires", option_format=ListFormat(sep=" ")
).split()
audit_requires = shlex.split(
self.reader.get(
"audit-requires", option_format=ListFormat(sep=" ", quote=shlex.quote)
)
)
return BuildOptions(
globals=self.globals,
@@ -925,6 +968,7 @@ class Options:
before_all=before_all,
build_verbosity=build_verbosity,
xbuild_tools=xbuild_tools,
xbuild_files=xbuild_files,
repair_command=repair_command,
environment=environment,
dependency_constraints=dependency_constraints,
@@ -1094,6 +1138,6 @@ def _get_pinned_container_images() -> Mapping[str, Mapping[str, str]]:
'pypy_x86_64': {'manylinux2010': '...' }
... }
"""
all_pinned_images = configparser.ConfigParser()
all_pinned_images = configparser.ConfigParser(inline_comment_prefixes="#")
all_pinned_images.read(resources.PINNED_DOCKER_IMAGES)
return all_pinned_images
+189 -191
View File
@@ -1,16 +1,41 @@
from __future__ import annotations
import csv
import hashlib
__lazy_modules__ = {
"build",
"build.env",
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.util.python_build_standalone",
"cibuildwheel.venv",
"filelock",
"packaging",
"packaging.utils",
"pathlib",
"platform",
"pprint",
"re",
"runpy",
"shlex",
"shutil",
"subprocess",
"textwrap",
"typing",
}
import os
import platform
import re
import shlex
import shutil
import subprocess
import sysconfig
import sys
from dataclasses import dataclass
from os.path import relpath
from pathlib import Path
from pprint import pprint
from runpy import run_path
@@ -19,9 +44,8 @@ from typing import Any
from build import ProjectBuilder
from build.env import IsolatedEnv
from elftools.common.exceptions import ELFError
from elftools.elf.elffile import ELFFile
from filelock import FileLock
from packaging.utils import canonicalize_name
from cibuildwheel import errors, platforms # pylint: disable=cyclic-import
from cibuildwheel.architecture import Architecture, arch_synonym
@@ -34,7 +58,13 @@ from cibuildwheel.frontend import (
from cibuildwheel.logger import log
from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell
from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
from cibuildwheel.util.file import (
CIBW_CACHE_PATH,
copy_test_sources,
download,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command
from cibuildwheel.util.packaging import find_compatible_wheel
from cibuildwheel.util.python_build_standalone import create_python_build_standalone_environment
@@ -42,10 +72,9 @@ from cibuildwheel.venv import constraint_flags, find_uv, virtualenv
TYPE_CHECKING = False
if TYPE_CHECKING:
from collections.abc import Iterable, Iterator, MutableMapping
from cibuildwheel.options import BuildOptions, Options
from cibuildwheel.selector import BuildSelector
from cibuildwheel.typing import PathOrStr
RESOURCES_ANDROID = resources.PATH / "android"
ANDROID_TRIPLET = {
@@ -72,7 +101,7 @@ class PythonConfiguration:
version: str
identifier: str
url: str
sha256: str = ""
sha256: str
@property
def arch(self) -> str:
@@ -146,9 +175,11 @@ def build(options: Options, tmp_path: Path) -> None:
build_path.mkdir()
python_dir = setup_target_python(config, build_path)
build_env, android_env = setup_env(config, build_options, build_path, python_dir)
state = BuildState(
config, build_options, build_path, python_dir, build_env, android_env
)
setup_xbuild_files(state)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
if compatible_wheel:
@@ -163,7 +194,7 @@ def build(options: Options, tmp_path: Path) -> None:
repaired_wheel = repair_wheel(state, built_wheel)
run_audit(tmp_dir=tmp_path, build_options=build_options, wheel=repaired_wheel)
test_wheel(state, repaired_wheel, build_frontend=build_options.build_frontend.name)
test_wheel(state, repaired_wheel)
output_wheel: Path | None = None
if compatible_wheel is None:
@@ -185,15 +216,17 @@ def setup_target_python(config: PythonConfiguration, build_path: Path) -> Path:
python_tgz = CIBW_CACHE_PATH / config.url.rpartition("/")[-1]
with FileLock(f"{python_tgz}.lock"):
if not python_tgz.exists():
download(config.url, python_tgz, sha256=config.sha256 or None)
with remove_on_error(python_tgz):
download(config.url, python_tgz, sha256=config.sha256)
python_dir = build_path / "python"
python_dir.mkdir()
shutil.unpack_archive(python_tgz, python_dir)
# Patch a testbed bug. This code and the patch file can both be removed once we've
# updated to Python versions that include the fix.
call("patch", "-p1", "-i", RESOURCES_ANDROID / "android.patch", cwd=python_dir)
# Work around https://github.com/python/cpython/issues/138800. This can be removed
# once we've updated to Python versions that include the fix.
pc_path = python_dir / f"prefix/lib/pkgconfig/python-{config.version}.pc"
pc_path.write_text(pc_path.read_text().replace("$(BLDLIBRARY)", f"-lpython{config.version}"))
return python_dir
@@ -208,13 +241,7 @@ def setup_env(
* android_env, which uses the environment while simulating running on Android.
"""
log.step("Setting up build environment...")
build_frontend = build_options.build_frontend.name
use_uv = build_frontend in {"build[uv]", "uv"}
uv_path = find_uv()
if use_uv and uv_path is None:
msg = "uv not found"
raise AssertionError(msg)
pip = ["pip"] if not use_uv else [str(uv_path), "pip"]
use_uv, pip = find_pip(build_options)
# Create virtual environment
python_exe = create_python_build_standalone_environment(
@@ -229,8 +256,12 @@ def setup_env(
)
create_cmake_toolchain(config, build_path, python_dir, build_env)
# See platforms.md for the reason why we use this default API level.
build_env.setdefault("ANDROID_API_LEVEL", "24")
# Apply custom environment variables, and check environment is still valid
build_env = build_options.environment.as_dictionary(build_env)
build_env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
build_env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
for command in ["python"] if use_uv else ["python", "pip"]:
command_path = call("which", command, env=build_env, capture_stdout=True).strip()
@@ -246,14 +277,14 @@ def setup_env(
else:
call(command, "--version", env=build_env)
# Construct an altered environment which simulates running on Android.
android_env = setup_android_env(config, python_dir, venv_dir, build_env)
# Install build tools
if build_frontend not in {"build", "build[uv]", "uv"}:
msg = "Android requires the build frontend to be 'build' or 'uv'"
raise errors.FatalError(msg)
call(*pip, "install", "build", *constraint_flags(dependency_constraint), env=build_env)
tools = ["auditwheel", "patchelf", "pkgconf"]
if build_options.build_frontend.name in {"build", "build[uv]"}:
tools.append("build")
call(*pip, "install", *tools, *constraint_flags(dependency_constraint), env=build_env)
# Construct an altered environment which simulates running on Android.
android_env = setup_android_env(config, python_dir, build_env)
# Build-time requirements must be queried within android_env, because
# `get_requires_for_build` can run arbitrary code in setup.py scripts, which may be
@@ -276,7 +307,14 @@ def setup_env(
call(*pip, "install", *pb.build_system_requires, env=build_env)
requires_for_build = pb.get_requires_for_build(
"wheel", parse_config_settings(build_options.config_settings)
"wheel",
parse_config_settings(
prepare_config_settings(
build_options.config_settings,
project=Path.cwd(),
package=build_options.package_dir,
)
),
)
if requires_for_build:
call(*pip, "install", *requires_for_build, env=build_env)
@@ -344,8 +382,11 @@ def localized_vars(
final = final.replace(orig_prefix, str(prefix))
if key == "ANDROID_API_LEVEL":
if api_level := build_env.get(key):
final = int(api_level)
try:
final = int(build_env[key])
except ValueError as e:
msg = f"ANDROID_API_LEVEL: {e}. This variable must be an integer."
raise errors.FatalError(msg) from e
# Build systems vary in whether FLAGS variables are read from sysconfig, and if so,
# whether they're replaced by environment variables or combined with them. Even
@@ -368,15 +409,15 @@ def localized_vars(
def setup_android_env(
config: PythonConfiguration, python_dir: Path, venv_dir: Path, build_env: dict[str, str]
config: PythonConfiguration, python_dir: Path, build_env: dict[str, str]
) -> dict[str, str]:
site_packages = next(venv_dir.glob("lib/python*/site-packages"))
site_packages = find_site_packages(build_env)
for suffix in ["pth", "py"]:
shutil.copy(RESOURCES_ANDROID / f"_cross_venv.{suffix}", site_packages)
sysconfigdata_path = Path(
shutil.copy(
next(python_dir.glob("prefix/lib/python*/_sysconfigdata_*.py")),
glob1(python_dir, "prefix/lib/python*/_sysconfigdata_*.py"),
site_packages,
)
)
@@ -395,10 +436,14 @@ def setup_android_env(
# * a key=value string, without quotes
for i, token in enumerate(shlex.split(env_output)):
if i % 2 == 0:
assert token == "export", token
if token != "export":
msg = f"Unexpected output from android.py env: expected 'export', got {token!r}"
raise errors.FatalError(msg)
else:
key, sep, value = token.partition("=")
assert sep == "=", token
if sep != "=":
msg = f"Unexpected output from android.py env: expected 'key=value', got {token!r}"
raise errors.FatalError(msg)
android_env[key] = value
# localized_vars cleared the CFLAGS and CXXFLAGS in the sysconfigdata, but most
@@ -415,6 +460,17 @@ def setup_android_env(
# Cargo target linker needs to be specified after CC is set
setup_rust(config, python_dir, android_env)
# Create shims which install additional build tools on first use.
setup_fortran(android_env)
# `android.py env` returns PKG_CONFIG="pkg-config --define-prefix", but some build
# systems can't handle arguments in that variable. Since we have a known version
# of pkgconf, it's safe to use PKG_CONFIG_RELOCATE_PATHS instead.
android_env["PKG_CONFIG"] = call(
"which", "pkgconf-pypi", env=build_env, capture_stdout=True
).strip()
android_env["PKG_CONFIG_RELOCATE_PATHS"] = "1"
# Format the environment so it can be pasted into a shell when debugging.
for key, value in sorted(android_env.items()):
if os.environ.get(key) != value:
@@ -423,11 +479,7 @@ def setup_android_env(
return android_env
def setup_rust(
config: PythonConfiguration,
python_dir: Path,
env: MutableMapping[str, str],
) -> None:
def setup_rust(config: PythonConfiguration, python_dir: Path, env: dict[str, str]) -> None:
cargo_target = android_triplet(config.identifier)
# CARGO_BUILD_TARGET is the variable used by Cargo and setuptools_rust
@@ -451,13 +503,83 @@ def setup_rust(
shim_path.chmod(0o755)
def setup_fortran(env: dict[str, str]) -> None:
# In case there's any autodetection based on the executable name, use the same name
# as the real executable (see fortran_shim.run_flang)
shim_in = RESOURCES_ANDROID / "fortran_shim.py"
shim_out = Path(env["VIRTUAL_ENV"]) / "bin/flang-new"
# The hashbang line runs the shim in cibuildwheel's own virtual environment, so it
# has access to utility functions for downloading and caching files.
shim_out.write_text(f"#!{sys.executable}\n\n" + shim_in.read_text())
shim_out.chmod(0o755)
env["FC"] = str(shim_out)
def setup_xbuild_files(state: BuildState) -> None:
_, pip = find_pip(state.options)
xbf_dir = state.build_path / "xbuild_files"
xbf_dir.mkdir()
for requirement in call(*pip, "freeze", env=state.build_env, capture_stdout=True).splitlines():
name, _, _ = requirement.strip().partition("==")
xbuild_files = state.options.xbuild_files.get(canonicalize_name(name), [])
if xbuild_files:
log.step(f"Installing xbuild-files for {name}...")
pip_install_android(state, xbf_dir, "--no-deps", requirement)
for xbf in xbuild_files:
if (xbf_dir / xbf).exists():
shutil.copy(
xbf_dir / xbf,
find_site_packages(state.build_env) / xbf,
)
else:
log.warning(f"{xbf_dir / xbf} does not exist")
def pip_install_android(state: BuildState, target: Path, *args: PathOrStr) -> None:
use_uv, pip = find_pip(state.options)
call(
*pip,
"install",
"--only-binary=:all:",
*(["--python-platform", android_triplet(state.config.identifier)] if use_uv else []),
"--target",
target,
*args,
env=state.android_env,
)
def find_site_packages(env: dict[str, str]) -> Path:
return glob1(Path(env["VIRTUAL_ENV"]), "lib/python*/site-packages")
def glob1(base: Path, pattern: str) -> Path:
results = list(base.glob(pattern))
if len(results) != 1:
msg = f"{base} contains {len(results)} paths matching '{pattern}'; expected 1"
raise errors.FatalError(msg)
return results[0]
def find_pip(build_options: BuildOptions) -> tuple[bool, list[str]]:
use_uv = build_options.build_frontend.name in {"build[uv]", "uv"}
uv_path = find_uv()
if use_uv and uv_path is None:
msg = "uv not found"
raise AssertionError(msg)
pip = ["pip"] if not use_uv else [str(uv_path), "pip"]
return use_uv, pip
def before_build(state: BuildState) -> None:
if state.options.before_build:
log.step("Running before_build...")
shell_prepared(
state.options.before_build,
build_options=state.options,
env=state.build_env,
env=state.android_env,
)
@@ -480,7 +602,7 @@ def build_wheel(state: BuildState) -> Path:
state.options.build_verbosity,
prepare_config_settings(
state.options.config_settings,
project=".",
project=Path.cwd(),
package=state.options.package_dir,
),
),
@@ -501,22 +623,17 @@ def build_wheel(state: BuildState) -> Path:
state.options.build_verbosity,
prepare_config_settings(
state.options.config_settings,
project=".",
project=Path.cwd(),
package=state.options.package_dir,
),
),
env=state.android_env,
)
case x:
msg = f"Invalid build backend {x!r}"
raise AssertionError(msg)
built_wheels = list(built_wheel_dir.glob("*.whl"))
if len(built_wheels) != 1:
msg = f"{built_wheel_dir} contains {len(built_wheels)} wheels; expected 1"
raise errors.FatalError(msg)
built_wheel = built_wheels[0]
msg = f"Android requires the build frontend to be 'build' or 'uv', not {x!r}"
raise errors.FatalError(msg)
built_wheel = glob1(built_wheel_dir, "*.whl")
if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError()
return built_wheel
@@ -528,9 +645,20 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
repaired_wheel_dir.mkdir()
if state.options.repair_command:
# Tell auditwheel the locations of compiler libraries.
toolchain = Path(state.android_env["CC"]).parent.parent
triplet = android_triplet(state.config.identifier)
ldpaths = ":".join(
str(glob1(toolchain, pattern))
for pattern in [
f"lib/clang/*/lib/linux/{triplet.split('-')[0]}", # libomp
f"sysroot/usr/lib/{triplet}", # libc++_shared
]
)
shell(
prepare_command(
state.options.repair_command,
ldpaths=ldpaths,
wheel=built_wheel,
dest_dir=repaired_wheel_dir,
package=state.options.package_dir,
@@ -539,14 +667,15 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
env=state.build_env,
)
else:
repair_default(state.android_env, built_wheel, repaired_wheel_dir)
shutil.move(built_wheel, repaired_wheel_dir)
repaired_wheels = list(repaired_wheel_dir.glob("*.whl"))
if len(repaired_wheels) == 0:
raise errors.RepairStepProducedNoWheelError()
if len(repaired_wheels) != 1:
msg = f"{repaired_wheel_dir} contains {len(repaired_wheels)} wheels; expected 1"
raise errors.FatalError(msg)
raise errors.RepairStepProducedMultipleWheelsError(
[rw.name for rw in repaired_wheels],
)
repaired_wheel = repaired_wheels[0]
if repaired_wheel.name.endswith("none-any.whl"):
@@ -554,119 +683,12 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
return repaired_wheel
def repair_default(
android_env: dict[str, str], built_wheel: Path, repaired_wheel_dir: Path
) -> None:
"""
Adds libc++ to the wheel if anything links against it. In the future this should be
moved to auditwheel and generalized to support more libraries.
"""
if (match := re.search(r"^(.+?)-", built_wheel.name)) is None:
msg = f"Failed to parse wheel filename: {built_wheel.name}"
raise errors.FatalError(msg)
wheel_name = match[1]
unpacked_dir = repaired_wheel_dir / "unpacked"
unpacked_dir.mkdir()
shutil.unpack_archive(built_wheel, unpacked_dir, format="zip")
# Some build systems are inconsistent about name normalization, so don't assume the
# dist-info name is identical to the wheel name.
record_paths = list(unpacked_dir.glob("*.dist-info/RECORD"))
if len(record_paths) != 1:
msg = f"{built_wheel.name} contains {len(record_paths)} dist-info/RECORD files; expected 1"
raise errors.FatalError(msg)
old_soname = "libc++_shared.so"
paths_to_patch = []
for path, elffile in elf_file_filter(
unpacked_dir / filename
for filename, *_ in csv.reader(record_paths[0].read_text().splitlines())
):
if (dynamic := elffile.get_section_by_name(".dynamic")) and any( # type: ignore[no-untyped-call]
tag.entry.d_tag == "DT_NEEDED" and tag.needed == old_soname
for tag in dynamic.iter_tags()
):
paths_to_patch.append(path)
if not paths_to_patch:
shutil.copyfile(built_wheel, repaired_wheel_dir / built_wheel.name)
else:
# Android doesn't support DT_RPATH, but supports DT_RUNPATH since API level 24
# (https://github.com/aosp-mirror/platform_bionic/blob/master/android-changes-for-ndk-developers.md).
if int(sysconfig_print('get_config_vars()["ANDROID_API_LEVEL"]', android_env)) < 24:
msg = f"Adding {old_soname} requires ANDROID_API_LEVEL to be at least 24"
raise errors.FatalError(msg)
toolchain = Path(android_env["CC"]).parent.parent
src_path = toolchain / f"sysroot/usr/lib/{android_env['CIBW_HOST_TRIPLET']}/{old_soname}"
# Use the same library location as auditwheel would.
libs_dir = unpacked_dir / (wheel_name + ".libs")
libs_dir.mkdir()
new_soname = soname_with_hash(src_path)
dst_path = libs_dir / new_soname
shutil.copyfile(src_path, dst_path)
call(which("patchelf"), "--set-soname", new_soname, dst_path)
for path in paths_to_patch:
call(which("patchelf"), "--replace-needed", old_soname, new_soname, path)
call(
which("patchelf"),
"--set-rpath",
f"${{ORIGIN}}/{relpath(libs_dir, path.parent)}",
path,
)
call(which("wheel"), "pack", unpacked_dir, "-d", repaired_wheel_dir)
# If cibuildwheel was called without activating its environment, its scripts directory
# will not be on the PATH.
def which(cmd: str) -> str:
scripts_dir = sysconfig.get_path("scripts")
result = shutil.which(cmd, path=scripts_dir + os.pathsep + os.environ["PATH"])
if result is None:
msg = f"Couldn't find {cmd!r} in {scripts_dir} or on the PATH"
raise errors.FatalError(msg)
return result
def elf_file_filter(paths: Iterable[Path]) -> Iterator[tuple[Path, ELFFile]]:
"""Filter through an iterator of filenames and load up only ELF files"""
for path in paths:
if not path.name.endswith(".py"):
try:
with open(path, "rb") as f:
candidate = ELFFile(f) # type: ignore[no-untyped-call]
yield path, candidate
except ELFError:
pass # Not an ELF file
def soname_with_hash(src_path: Path) -> str:
"""Return the same library filename as auditwheel would"""
shorthash = hashlib.sha256(src_path.read_bytes()).hexdigest()[:8]
src_name = src_path.name
base, ext = src_name.split(".", 1)
if not base.endswith(f"-{shorthash}"):
return f"{base}-{shorthash}.{ext}"
else:
return src_name
def test_wheel(state: BuildState, wheel: Path, *, build_frontend: str) -> None:
def test_wheel(state: BuildState, wheel: Path) -> None:
test_command = state.options.test_command
if not (test_command and state.options.test_selector(state.config.identifier)):
return
log.step("Testing wheel...")
use_uv = build_frontend in {"build[uv]", "uv"}
uv_path = find_uv()
if use_uv and uv_path is None:
msg = "uv not found"
raise AssertionError(msg)
pip = ["pip"] if not use_uv else [str(uv_path), "pip"]
native_arch = arch_synonym(platform.machine(), platforms.native_platform(), "android")
if state.config.arch != native_arch:
log.warning(
@@ -679,31 +701,17 @@ def test_wheel(state: BuildState, wheel: Path, *, build_frontend: str) -> None:
shell_prepared(
state.options.before_test,
build_options=state.options,
env=state.build_env,
env=state.android_env,
)
platform_args = (
["--python-platform", android_triplet(state.config.identifier)]
if use_uv
else [
"--platform",
sysconfig_print("get_platform()", state.android_env).replace("-", "_"),
]
)
# Install the wheel and test-requires.
site_packages_dir = state.build_path / "site-packages"
site_packages_dir.mkdir()
call(
*pip,
"install",
"--only-binary=:all:",
*platform_args,
"--target",
pip_install_android(
state,
site_packages_dir,
f"{wheel}{state.options.test_extras}",
*state.options.test_requires,
env=state.android_env,
)
# Copy test-sources.
@@ -773,13 +781,3 @@ def test_wheel(state: BuildState, wheel: Path, *, build_frontend: str) -> None:
*test_args,
env=state.build_env,
)
def sysconfig_print(method_call: str, env: dict[str, str]) -> str:
return call(
"python",
"-c",
f'import sysconfig; print(sysconfig.{method_call}, end="")',
env=env,
capture_stdout=True,
)
+69 -15
View File
@@ -1,5 +1,28 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.platforms.macos",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"packaging",
"packaging.version",
"pathlib",
"platform",
"shlex",
"shutil",
"subprocess",
"textwrap",
"typing",
}
import dataclasses
import os
import platform
@@ -25,7 +48,13 @@ from cibuildwheel.logger import log
from cibuildwheel.platforms.macos import install_cpython as install_build_cpython
from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell, split_command
from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
from cibuildwheel.util.file import (
CIBW_CACHE_PATH,
copy_test_sources,
download,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command, unwrap_preserving_paragraphs
from cibuildwheel.util.packaging import find_compatible_wheel
from cibuildwheel.venv import constraint_flags, virtualenv
@@ -46,7 +75,8 @@ class PythonConfiguration:
identifier: str
url: str
build_url: str
sha256: str = ""
build_sha256: str
sha256: str
@property
def sdk(self) -> str:
@@ -79,7 +109,7 @@ def all_python_configurations() -> list[PythonConfiguration]:
# configuration.
macos_python_configs = resources.read_python_configs("macos")
def build_url(config_dict: dict[str, str]) -> str:
def build_python_config(config_dict: dict[str, str]) -> dict[str, str]:
# The iOS identifier will be something like cp313-ios_arm64_iphoneos.
# Drop the iphoneos suffix, then replace ios with macosx to yield
# cp313-macosx_arm64, which will be a macOS build identifier.
@@ -88,18 +118,30 @@ def all_python_configurations() -> list[PythonConfiguration]:
matching = [
config for config in macos_python_configs if config["identifier"] == macos_identifier
]
return matching[0]["url"]
if not matching:
msg = (
f"Internal error: no macOS configuration found matching "
f"{macos_identifier!r}, needed to build the iOS configuration "
f"{config_dict['identifier']!r}. The bundled build-platforms.toml "
f"resources are inconsistent."
)
raise errors.FatalError(msg)
return matching[0]
# Load the platform configuration
full_python_configs = resources.read_python_configs("ios")
# Build the configurations, annotating with macOS URL details.
return [
PythonConfiguration(
**item,
build_url=build_url(item),
python_configurations = []
for item in full_python_configs:
build_config = build_python_config(item)
python_configurations.append(
PythonConfiguration(
**item,
build_url=build_config["url"],
build_sha256=build_config["sha256"],
)
)
for item in full_python_configs
]
return python_configurations
def get_python_configurations(
@@ -134,9 +176,10 @@ def install_target_cpython(tmp: Path, config: PythonConfiguration, free_threadin
with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists():
downloaded_tar_gz = tmp / ios_python_tar_gz
download(config.url, downloaded_tar_gz, sha256=config.sha256 or None)
installation_path.mkdir(parents=True, exist_ok=True)
call("tar", "-C", installation_path, "-xf", downloaded_tar_gz)
download(config.url, downloaded_tar_gz, sha256=config.sha256)
with remove_on_error(installation_path):
installation_path.mkdir(parents=True)
call("tar", "-C", installation_path, "-xf", downloaded_tar_gz)
downloaded_tar_gz.unlink()
return installation_path
@@ -320,6 +363,7 @@ def setup_python(
python_configuration.version,
python_configuration.build_url,
free_threading,
python_configuration.build_sha256,
)
else:
msg = f"Unknown Python implementation: {implementation_id}"
@@ -419,6 +463,9 @@ def setup_python(
*constraint_flags(dependency_constraint),
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
@@ -483,6 +530,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_frontend=build_frontend.name,
xbuild_tools=build_options.xbuild_tools,
)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
if compatible_wheel:
@@ -511,7 +559,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.build_verbosity,
prepare_config_settings(
build_options.config_settings,
project=".",
project=Path.cwd(),
package=build_options.package_dir,
),
)
@@ -543,10 +591,16 @@ def build(options: Options, tmp_path: Path) -> None:
*extra_flags,
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
built_wheel = next(built_wheel_dir.glob("*.whl"))
try:
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError()
+26 -2
View File
@@ -1,5 +1,22 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"collections",
"contextlib",
"pathlib",
"shutil",
"subprocess",
"textwrap",
"typing",
}
import contextlib
import dataclasses
import shutil
@@ -237,6 +254,7 @@ def build_in_container(
env["PATH"] = f"{python_bin}:{env['PATH']}"
env = build_options.environment.as_dictionary(env, executor=container.environment_executor)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
# check config python is still on PATH
which_python = container.call(["which", "python"], env=env, capture_output=True).strip()
@@ -342,10 +360,16 @@ def build_in_container(
],
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
try:
built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
except IndexError:
raise errors.BuildProducedNoWheelError() from None
repaired_wheel_dir = temp_dir / "repaired_wheel"
container.call(["rm", "-rf", repaired_wheel_dir])
@@ -492,7 +516,7 @@ def build(options: Options, tmp_path: Path) -> None:
abs_package_dir = options.globals.package_dir.resolve()
if cwd != abs_package_dir and cwd not in abs_package_dir.parents:
msg = "package_dir must be inside the working directory"
raise Exception(msg)
raise errors.ConfigurationError(msg)
container_project_path = PurePosixPath("/project")
container_package_dir = container_project_path / abs_package_dir.relative_to(cwd)
+68 -22
View File
@@ -1,5 +1,27 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.ci",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"inspect",
"packaging",
"packaging.version",
"pathlib",
"platform",
"re",
"shutil",
"subprocess",
}
import dataclasses
import functools
import inspect
@@ -27,7 +49,13 @@ from cibuildwheel.frontend import (
from cibuildwheel.logger import log
from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell
from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
from cibuildwheel.util.file import (
CIBW_CACHE_PATH,
copy_test_sources,
download,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command, unwrap
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
from cibuildwheel.venv import constraint_flags, find_uv, target_marker_env, virtualenv
@@ -88,7 +116,7 @@ class PythonConfiguration:
version: str
identifier: str
url: str
sha256: str = ""
sha256: str
def all_python_configurations() -> list[PythonConfiguration]:
@@ -136,9 +164,7 @@ def get_python_configurations(
return python_configurations
def install_cpython(
_tmp: Path, version: str, url: str, free_threading: bool, sha256: str = ""
) -> Path:
def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool, sha256: str) -> Path:
ft = "T" if free_threading else ""
installation_path = Path(f"/Library/Frameworks/Python{ft}.framework/Versions/{version}")
with FileLock(CIBW_CACHE_PATH / f"cpython{version}.lock"):
@@ -164,7 +190,7 @@ def install_cpython(
python_filename = url.rsplit("/", maxsplit=1)[-1]
pkg_path = CIBW_CACHE_PATH / "cpython-installer" / python_filename
if not pkg_path.exists():
download(url, pkg_path, sha256=sha256 or None)
download(url, pkg_path, sha256=sha256)
args = []
if version.startswith("3.14"):
args += ["-applyChoiceChangesXML", str(resources.FREE_THREAD_ENABLE_314.resolve())]
@@ -188,22 +214,24 @@ def install_cpython(
return installation_path / "bin" / (f"python{version}t" if free_threading else "python3")
def install_pypy(tmp: Path, url: str, sha256: str = "") -> Path:
pypy_tar_bz2 = url.rsplit("/", 1)[-1]
extension = ".tar.bz2"
assert pypy_tar_bz2.endswith(extension)
installation_path = CIBW_CACHE_PATH / pypy_tar_bz2[: -len(extension)]
def install_pypy(tmp: Path, url: str, sha256: str) -> Path:
pypy_archive = url.rsplit("/", 1)[-1]
# PyPy ships .tar.bz2 for some platforms and .tar.gz for others.
extension = ".tar.bz2" if pypy_archive.endswith(".tar.bz2") else ".tar.gz"
assert pypy_archive.endswith(extension)
installation_path = CIBW_CACHE_PATH / pypy_archive[: -len(extension)]
with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists():
downloaded_tar_bz2 = tmp / pypy_tar_bz2
download(url, downloaded_tar_bz2, sha256=sha256 or None)
downloaded_archive = tmp / pypy_archive
download(url, downloaded_archive, sha256=sha256)
installation_path.parent.mkdir(parents=True, exist_ok=True)
call("tar", "-C", installation_path.parent, "-xf", downloaded_tar_bz2)
downloaded_tar_bz2.unlink()
with remove_on_error(installation_path):
call("tar", "-C", installation_path.parent, "-xf", downloaded_archive)
downloaded_archive.unlink()
return installation_path / "bin" / "pypy3"
def install_graalpy(tmp: Path, url: str, sha256: str = "") -> Path:
def install_graalpy(tmp: Path, url: str, sha256: str) -> Path:
graalpy_archive = url.rsplit("/", 1)[-1]
extension = ".tar.gz"
assert graalpy_archive.endswith(extension)
@@ -211,10 +239,18 @@ def install_graalpy(tmp: Path, url: str, sha256: str = "") -> Path:
with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists():
downloaded_archive = tmp / graalpy_archive
download(url, downloaded_archive, sha256=sha256 or None)
installation_path.mkdir(parents=True)
# GraalPy top-folder name is inconsistent with archive name
call("tar", "-C", installation_path, "--strip-components=1", "-xzf", downloaded_archive)
download(url, downloaded_archive, sha256=sha256)
with remove_on_error(installation_path):
installation_path.mkdir(parents=True)
# GraalPy top-folder name is inconsistent with archive name
call(
"tar",
"-C",
installation_path,
"--strip-components=1",
"-xzf",
downloaded_archive,
)
downloaded_archive.unlink()
return installation_path / "bin" / "graalpy"
@@ -414,6 +450,9 @@ def setup_python(
*constraint_flags(dependency_constraint),
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
@@ -473,6 +512,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.environment,
build_frontend.name,
)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = None if use_uv else get_pip_version(env)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
@@ -498,7 +538,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.build_verbosity,
prepare_config_settings(
build_options.config_settings,
project=".",
project=Path.cwd(),
package=build_options.package_dir,
),
)
@@ -549,10 +589,16 @@ def build(options: Options, tmp_path: Path) -> None:
*extra_flags,
env=build_env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
built_wheel = next(built_wheel_dir.glob("*.whl"))
try:
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
repaired_wheel_dir.mkdir()
+96 -34
View File
@@ -1,5 +1,26 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.util.python_build_standalone",
"cibuildwheel.venv",
"filelock",
"json",
"pathlib",
"shutil",
"subprocess",
"tempfile",
"tomllib",
}
import dataclasses
import functools
import json
@@ -29,6 +50,7 @@ from cibuildwheel.util.file import (
extract_tar,
extract_zip,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command, unwrap, unwrap_preserving_paragraphs
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
@@ -92,10 +114,11 @@ def ensure_node(major_version: str) -> Path:
with TemporaryDirectory() as tmp_path:
archive = Path(tmp_path) / f"{name}.{ext}"
download(url, archive)
if ext == "zip":
extract_zip(archive, path.parent)
else:
extract_tar(archive, path.parent)
with remove_on_error(path):
if ext == "zip":
extract_zip(archive, path.parent)
else:
extract_tar(archive, path.parent)
assert path.exists()
if not IS_WIN:
return path / "bin"
@@ -110,18 +133,19 @@ def install_emscripten(env: dict[str, str], version: str, xbuildenv_cache_path:
with FileLock(CIBW_CACHE_PATH / "emscripten.lock"):
if emscripten_dir.exists():
return emscripten_dir
call(
"pyodide",
"xbuildenv",
"install-emscripten",
"--force",
"--version",
version,
"--path",
str(xbuildenv_cache_path),
env=env,
cwd=CIBW_CACHE_PATH,
)
with remove_on_error(emscripten_dir):
call(
"pyodide",
"xbuildenv",
"install-emscripten",
"--force",
"--version",
version,
"--path",
str(xbuildenv_cache_path),
env=env,
cwd=CIBW_CACHE_PATH,
)
assert emscripten_dir.exists()
return emscripten_dir
@@ -194,6 +218,36 @@ def validate_pyodide_build_version(
raise errors.FatalError(msg)
def validate_pyodide_target_python(
xbuildenv_info: PyodideXBuildEnvInfo, python_configuration: PythonConfiguration
) -> None:
"""
Validate that the resolved Pyodide xbuildenv targets the same Python version
as the identifier being built.
This is to catch the case where a global ``pyodide-version`` is applied to an
identifier whose Python version does not match, such as setting
``pyodide-version = "3Y.0.0"`` (a Python 3.Y environment) while
building ``cp3X-pyodide_wasm32``.
"""
xbuildenv_version = xbuildenv_info["version"]
identifier = python_configuration.identifier
expected_version = python_configuration.version
default_version = python_configuration.default_pyodide_version
xbuildenv_python_minor = ".".join(xbuildenv_info["python"].split(".")[:2])
if xbuildenv_python_minor != expected_version:
msg = unwrap_preserving_paragraphs(f"""
The `pyodide-version` option is set to {xbuildenv_version}, which
provides Python {xbuildenv_python_minor}, but the {identifier} build
needs Python {expected_version}.
Either remove `pyodide-version` so {identifier} uses its default
({default_version}), or stop building {identifier} so that
`pyodide-version` only applies to an identifier it matches.
""")
raise errors.ConfigurationError(msg)
def install_xbuildenv(env: dict[str, str], xbuildenv_cache_path: Path, pyodide_version: str) -> str:
"""Install a particular Pyodide xbuildenv version and set a path to the Pyodide root."""
pyodide_root = xbuildenv_cache_path / pyodide_version / "xbuildenv" / "pyodide-root"
@@ -208,17 +262,18 @@ def install_xbuildenv(env: dict[str, str], xbuildenv_cache_path: Path, pyodide_v
env.pop("PYODIDE_ROOT", None)
# Install the xbuildenv
call(
"pyodide",
"xbuildenv",
"install",
"--path",
str(xbuildenv_cache_path),
pyodide_version,
env=env,
cwd=CIBW_CACHE_PATH,
)
assert pyodide_root.exists()
with remove_on_error(xbuildenv_cache_path / pyodide_version):
call(
"pyodide",
"xbuildenv",
"install",
"--path",
str(xbuildenv_cache_path),
pyodide_version,
env=env,
cwd=CIBW_CACHE_PATH,
)
assert pyodide_root.exists()
return str(pyodide_root)
@@ -312,6 +367,10 @@ def setup_python(
xbuildenv_info=xbuildenv_info,
pyodide_build_version=pyodide_build_version,
)
validate_pyodide_target_python(
xbuildenv_info=xbuildenv_info,
python_configuration=python_configuration,
)
xbuildenv_cache_path = CIBW_CACHE_PATH / f"pyodide-build-{pyodide_build_version}"
@@ -367,10 +426,6 @@ def build(options: Options, tmp_path: Path) -> None:
build_options = options.build_options(config.identifier)
build_frontend = build_options.build_frontend
if build_frontend.name == "pip":
msg = "The pyodide platform doesn't support pip frontend"
raise errors.FatalError(msg)
log.build_start(config.identifier)
identifier_tmp_dir = tmp_path / config.identifier
@@ -392,6 +447,7 @@ def build(options: Options, tmp_path: Path) -> None:
environment=build_options.environment,
user_pyodide_version=build_options.pyodide_version,
)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = get_pip_version(env)
# The Pyodide command line runner mounts all directories in the host
# filesystem into the Pyodide file system, except for the custom
@@ -433,7 +489,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.build_verbosity,
prepare_config_settings(
build_options.config_settings,
project=".",
project=Path.cwd(),
package=build_options.package_dir,
),
)
@@ -446,7 +502,10 @@ def build(options: Options, tmp_path: Path) -> None:
*extra_flags,
env=env,
)
built_wheel = next(built_wheel_dir.glob("*.whl"))
try:
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError()
@@ -466,7 +525,10 @@ def build(options: Options, tmp_path: Path) -> None:
else:
shutil.move(str(built_wheel), repaired_wheel_dir)
repaired_wheel = next(repaired_wheel_dir.glob("*.whl"))
try:
repaired_wheel = next(repaired_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.RepairStepProducedNoWheelError() from None
if repaired_wheel.name in {wheel.name for wheel in built_wheels}:
raise errors.AlreadyBuiltWheelError(repaired_wheel.name)
+52 -69
View File
@@ -1,7 +1,26 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"pathlib",
"platform",
"shutil",
"subprocess",
"textwrap",
"typing",
}
import dataclasses
import json
import os
import platform as platform_module
import shutil
@@ -30,6 +49,7 @@ from cibuildwheel.util.file import (
download,
extract_zip,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command, unwrap
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
@@ -112,7 +132,8 @@ def _ensure_nuget() -> Path:
nuget = CIBW_CACHE_PATH / "nuget.exe"
with FileLock(str(nuget) + ".lock"):
if not nuget.exists():
download("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", nuget)
with remove_on_error(nuget):
download("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", nuget)
return nuget
@@ -128,11 +149,12 @@ def install_cpython(configuration: PythonConfiguration, arch: str | None = None)
with FileLock(str(base_output_dir) + f"-{version}{free_threaded_str}-{arch}.lock"):
if not installation_path.exists():
nuget = _ensure_nuget()
call(nuget, "install", *nuget_args)
with remove_on_error(installation_path.parent):
call(nuget, "install", *nuget_args)
return installation_path / "python.exe"
def install_pypy(tmp: Path, arch: str, url: str, sha256: str = "") -> Path:
def install_pypy(tmp: Path, arch: str, url: str, sha256: str) -> Path:
assert arch == "64"
assert "win64" in url
# Inside the PyPy zip file is a directory with the same name
@@ -143,13 +165,14 @@ def install_pypy(tmp: Path, arch: str, url: str, sha256: str = "") -> Path:
with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists():
pypy_zip = tmp / zip_filename
download(url, pypy_zip, sha256=sha256 or None)
# Extract to the parent directory because the zip file still contains a directory
extract_zip(pypy_zip, installation_path.parent)
download(url, pypy_zip, sha256=sha256)
with remove_on_error(installation_path):
# Extract to the parent directory because the zip file still contains a directory
extract_zip(pypy_zip, installation_path.parent)
return installation_path / "python.exe"
def install_graalpy(tmp: Path, url: str, sha256: str = "") -> Path:
def install_graalpy(tmp: Path, url: str, sha256: str) -> Path:
zip_filename = url.rsplit("/", 1)[-1]
extension = ".zip"
assert zip_filename.endswith(extension)
@@ -157,9 +180,10 @@ def install_graalpy(tmp: Path, url: str, sha256: str = "") -> Path:
with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists():
graalpy_zip = tmp / zip_filename
download(url, graalpy_zip, sha256=sha256 or None)
# Extract to the parent directory because the zip file still contains a directory
extract_zip(graalpy_zip, installation_path.parent)
download(url, graalpy_zip, sha256=sha256)
with remove_on_error(installation_path):
# Extract to the parent directory because the zip file still contains a directory
extract_zip(graalpy_zip, installation_path.parent)
return installation_path / "bin" / "graalpy.exe"
@@ -273,13 +297,14 @@ def setup_python(
base_python = install_cpython(python_configuration, arch=native_arch)
elif implementation_id.startswith("pp"):
assert python_configuration.url is not None
assert python_configuration.sha256
base_python = install_pypy(
tmp, python_configuration.arch, python_configuration.url, python_configuration.sha256
)
elif implementation_id.startswith("gp"):
base_python = install_graalpy(
tmp, python_configuration.url or "", python_configuration.sha256
)
assert python_configuration.url is not None
assert python_configuration.sha256
base_python = install_graalpy(tmp, python_configuration.url, python_configuration.sha256)
else:
msg = "Unknown Python implementation"
raise ValueError(msg)
@@ -323,7 +348,7 @@ def setup_python(
assert (venv_path / "Scripts" / "pip.exe").exists()
where_pip = call("where", "pip", env=env, capture_stdout=True).splitlines()[0].strip()
print(where_pip)
if where_pip.strip() != str(venv_path / "Scripts" / "pip.exe"):
if where_pip != str(venv_path / "Scripts" / "pip.exe"):
msg = "pip available on PATH doesn't match our installed instance. If you have modified PATH, ensure that you don't overwrite cibuildwheel's entry or insert pip above it."
raise errors.FatalError(msg)
call("pip", "--version", env=env)
@@ -376,6 +401,9 @@ def setup_python(
*constraint_flags(dependency_constraint),
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
@@ -384,42 +412,6 @@ def setup_python(
setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env)
setup_rust_cross_compile(tmp, python_configuration, python_libs_base, env)
if implementation_id.startswith("gp311"):
# GraalPy 24 fails to discover compilers, setup the relevant environment
# variables. Adapted from
# https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
# Remove when GraalPy 24.x is dropped.
vcpath = call(
Path(os.environ["PROGRAMFILES(X86)"])
/ "Microsoft Visual Studio"
/ "Installer"
/ "vswhere.exe",
"-products",
"*",
"-latest",
"-property",
"installationPath",
capture_stdout=True,
).strip()
log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}")
vcvars_file = tmp / "vcvars.json"
call(
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
"-no_logo",
"-arch=amd64",
"-host_arch=amd64",
"&&",
"python",
"-c",
# this command needs to be one line for Windows reasons
"import sys, json, pathlib, os; pathlib.Path(sys.argv[1]).write_text(json.dumps(dict(os.environ)))",
vcvars_file,
env=env,
)
with open(vcvars_file, encoding="utf-8") as f:
vcvars = json.load(f)
env.update(vcvars)
return base_python, env
@@ -471,6 +463,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.environment,
build_frontend.name,
)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = None if use_uv else get_pip_version(env)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
@@ -499,27 +492,11 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.build_verbosity,
prepare_config_settings(
build_options.config_settings,
project=".",
project=Path.cwd(),
package=options.globals.package_dir,
),
)
if (
config.identifier.startswith("gp311")
and build_frontend.name == "build"
and "--no-isolation" not in extra_flags
and "-n" not in extra_flags
):
# GraalPy 24 fails to discover its standard library when a venv is created
# from a virtualenv seeded executable. See
# https://github.com/oracle/graalpython/issues/491 and remove this once
# GraalPy 24 is dropped.
log.notice(
"Disabling build isolation to workaround GraalPy bug. If the build fails, consider using pip or build[uv] as build frontend."
)
shell("graalpy -m pip install setuptools wheel", env=env)
extra_flags = [*extra_flags, "-n"]
match build_frontend.name:
case "pip":
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
@@ -565,10 +542,16 @@ def build(options: Options, tmp_path: Path) -> None:
*extra_flags,
env=env,
)
case "pyodide-build":
msg = "The 'pyodide-build' build frontend is not supported on this platform"
raise errors.FatalError(msg)
case _:
assert_never(build_frontend)
built_wheel = next(built_wheel_dir.glob("*.whl"))
try:
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
# repair the wheel
repaired_wheel_dir.mkdir()
+2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"configparser", "contextlib", "dependency_groups"}
import ast
import configparser
import contextlib
@@ -14,6 +14,9 @@ def initialize() -> None:
if not (host_triplet := os.environ.get("CIBW_HOST_TRIPLET")):
return
# Pre-import any modules which would fail to import after the monkey-patching.
import ctypes # noqa: F401, PLC0415 - uses get_config_var("LDLIBRARY")
# os ######################################################################
def cross_os_uname() -> os.uname_result:
return os.uname_result(
@@ -1,11 +0,0 @@
--- a/android.py
+++ b/android.py
@@ -1021,7 +1021,7 @@ def main():
context = parse_args()
# Set the CROSS_BUILD_DIR if an argument was provided
- if context.cross_build_dir:
+ if getattr(context, "cross_build_dir", None):
global CROSS_BUILD_DIR
CROSS_BUILD_DIR = context.cross_build_dir.resolve()
@@ -0,0 +1,121 @@
# This file intentionally has no hashbang line in the source: cibuildwheel will add it
# above this comment when the file is deployed.
import os
import re
import shutil
import sys
from pathlib import Path
from tempfile import gettempdir
from filelock import FileLock
from cibuildwheel.util.file import CIBW_CACHE_PATH, download
# In the future we might pick a different Flang release depending on the NDK version,
# but so far all Python versions use the same NDK version, so there's no need.
RELEASE_URL = "https://github.com/termux/ndk-toolchain-clang-with-flang/releases/download"
RELEASE_VERSION = "r27c"
ARCHS = ["aarch64", "x86_64"]
# The compiler is built for Linux x86_64, so we use Docker on macOS.
DOCKER_IMAGE = "debian:trixie-slim"
def main() -> None:
cache_dir = CIBW_CACHE_PATH / f"flang-android-{RELEASE_VERSION}"
with FileLock(f"{cache_dir}.lock"):
if not cache_dir.exists():
download_flang(cache_dir)
run_flang(cache_dir)
def download_flang(cache_dir: Path) -> None:
tmp_dir = Path(f"{cache_dir}.tmp")
if tmp_dir.exists():
shutil.rmtree(tmp_dir)
tmp_dir.mkdir(parents=True)
for archive_name in [f"package-flang-{arch}.tar.bz2" for arch in ARCHS] + [
"package-flang-host.tar.bz2",
"package-install.tar.bz2",
]:
archive_path = tmp_dir / archive_name
download(f"{RELEASE_URL}/{RELEASE_VERSION}/{archive_name}", archive_path)
shutil.unpack_archive(archive_path, tmp_dir)
archive_path.unlink()
# Merge the extracted trees together, along with the necessary parts of the NDK. Based on
# https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/fortran/__init__.py.
flang_toolchain = tmp_dir / "toolchain"
(tmp_dir / "out/install/linux-x86/clang-dev").rename(flang_toolchain)
ndk_toolchain = Path(os.environ["CC"]).parents[1]
if (clang_ver_flang := clang_ver(flang_toolchain)) != (
clang_ver_ndk := clang_ver(ndk_toolchain)
):
msg = f"Flang uses Clang {clang_ver_flang}, but NDK uses Clang {clang_ver_ndk}"
raise ValueError(msg)
clang_lib_path = f"lib/clang/{clang_ver_ndk}/lib"
shutil.rmtree(flang_toolchain / clang_lib_path)
for src, dst in [
(f"{tmp_dir}/build-{arch}-install", f"sysroot/usr/lib/{arch}-linux-android")
for arch in ARCHS
] + [
(f"{tmp_dir}/build-host-install", ""),
(f"{ndk_toolchain}/{clang_lib_path}", clang_lib_path),
(f"{ndk_toolchain}/sysroot", "sysroot"),
]:
shutil.copytree(src, flang_toolchain / dst, symlinks=True, dirs_exist_ok=True)
flang_toolchain.rename(cache_dir)
shutil.rmtree(tmp_dir)
def clang_ver(toolchain: Path) -> str:
versions = [p.name for p in (toolchain / "lib/clang").iterdir()]
assert len(versions) == 1
return versions[0]
def run_flang(cache_dir: Path) -> None:
match = re.fullmatch(r".+/(.+)-clang", os.environ["CC"])
assert match is not None
target = match[1]
# In a future Flang version the executable name will change to "flang"
# (https://blog.llvm.org/posts/2025-03-11-flang-new/).
flang_args = [f"{cache_dir}/bin/flang-new", f"--target={target}", *sys.argv[1:]]
if sys.platform == "linux":
args = flang_args
elif sys.platform == "darwin":
args = ["docker", "run", "--rm", "--platform", "linux/amd64"]
# Docker on macOS only allows certain directories to be mounted as volumes
# by default, but they include all the locations we're likely to need.
for path in [
# Location of CIBW_CACHE_PATH (containing the Fortran compiler), and
# probably the project directory.
Path.home(),
# Temporary directories created by build backends and cibuildwheel itself.
# This is controlled by the TMPDIR environment variable, which is set to
# an unpredictable subdirectory of /var/folders. /var is itself a symlink
# to /private/var.
Path(gettempdir()),
Path(gettempdir()).resolve(),
]:
args += ["-v", f"{path}:{path}"]
args += ["--workdir", str(Path.cwd())]
args += ["--entrypoint", flang_args[0], DOCKER_IMAGE, *flang_args[1:]]
else:
msg = f"unknown platform: {sys.platform}"
raise ValueError(msg)
os.execvp(args[0], args)
if __name__ == "__main__":
main()
+54 -58
View File
@@ -21,7 +21,6 @@ python_configurations = [
{ identifier = "pp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },
{ identifier = "pp310-manylinux_x86_64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
{ identifier = "pp311-manylinux_x86_64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" },
{ identifier = "gp311_242-manylinux_x86_64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
{ identifier = "gp312_250-manylinux_x86_64", version = "3.12", path_str = "/opt/python/graalpy312-graalpy250_312_native" },
{ identifier = "cp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/cp310-cp310" },
@@ -71,7 +70,6 @@ python_configurations = [
{ identifier = "pp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },
{ identifier = "pp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
{ identifier = "pp311-manylinux_aarch64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" },
{ identifier = "gp311_242-manylinux_aarch64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
{ identifier = "gp312_250-manylinux_aarch64", version = "3.12", path_str = "/opt/python/graalpy312-graalpy250_312_native" },
{ identifier = "pp39-manylinux_i686", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },
{ identifier = "pp310-manylinux_i686", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
@@ -155,30 +153,28 @@ python_configurations = [
{ identifier = "cp312-macosx_x86_64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.10/python-3.12.10-macos11.pkg", sha256 = "8373e58da4ea146b3eb1c1f9834f19a319440b6b679b06050b1f9ee3237aa8e4" },
{ identifier = "cp312-macosx_arm64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.10/python-3.12.10-macos11.pkg", sha256 = "8373e58da4ea146b3eb1c1f9834f19a319440b6b679b06050b1f9ee3237aa8e4" },
{ identifier = "cp312-macosx_universal2", version = "3.12", url = "https://www.python.org/ftp/python/3.12.10/python-3.12.10-macos11.pkg", sha256 = "8373e58da4ea146b3eb1c1f9834f19a319440b6b679b06050b1f9ee3237aa8e4" },
{ identifier = "cp313-macosx_x86_64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.13/python-3.13.13-macos11.pkg", sha256 = "a909cb655af5db67d5a90b3603437a1d58bec3446d624e4034e278ac62023cc9" },
{ identifier = "cp313-macosx_arm64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.13/python-3.13.13-macos11.pkg", sha256 = "a909cb655af5db67d5a90b3603437a1d58bec3446d624e4034e278ac62023cc9" },
{ identifier = "cp313-macosx_universal2", version = "3.13", url = "https://www.python.org/ftp/python/3.13.13/python-3.13.13-macos11.pkg", sha256 = "a909cb655af5db67d5a90b3603437a1d58bec3446d624e4034e278ac62023cc9" },
{ identifier = "cp314-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp314-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp314-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp314t-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp314t-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp314t-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-macos11.pkg", sha256 = "b28a8dc33c456dd06c97024697d63ca916cfb494594c06fa3e4ef4d41fa82335" },
{ identifier = "cp315-macosx_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "cp315-macosx_arm64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "cp315-macosx_universal2", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "cp315t-macosx_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "cp315t-macosx_arm64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "cp315t-macosx_universal2", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-macos11.pkg", sha256 = "d9e6de70d8bb02c9300b9d8e8b56aadb8dd426073d97e6225ac5319b3eb6d84e" },
{ identifier = "pp39-macosx_x86_64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_x86_64.tar.bz2", sha256 = "fda015431621e7e5aa16359d114f2c45a77ed936992c1efff86302e768a6b21c" },
{ identifier = "pp39-macosx_arm64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_arm64.tar.bz2", sha256 = "88f824e7a2d676440d09bc90fc959ae0fd3557d7e2f14bfbbe53d41d159a47fe" },
{ identifier = "pp310-macosx_x86_64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-macos_x86_64.tar.bz2", sha256 = "2c5e5c2a33ac882551d7f28b98d19d486b8995aa50824a73b4edcc6aeec35c63" },
{ identifier = "pp310-macosx_arm64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-macos_arm64.tar.bz2", sha256 = "3db8a03fc496164801646844d7f3b12baa0adb3ad9a0b7cb124521bc2e168a36" },
{ identifier = "pp311-macosx_x86_64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-macos_x86_64.tar.bz2", sha256 = "c95363c4e87235d11a6cec8128239c291b1eb67a752778fbcfe029a71da82b5e" },
{ identifier = "pp311-macosx_arm64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-macos_arm64.tar.bz2", sha256 = "4747b3aceba4c1c6104cddc0fe5ea302101d32955f0957347b9ecc4fbd7aed05" },
{ identifier = "gp311_242-macosx_x86_64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-macos-amd64.tar.gz", sha256 = "" },
{ identifier = "gp311_242-macosx_arm64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-macos-aarch64.tar.gz", sha256 = "f4a2ae01bae0fa53ec0d19f86d73c6dcc2a162d245552030183b84bfdd8f7635" },
{ identifier = "gp312_250-macosx_x86_64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.1/graalpy-25.0.1-macos-amd64.tar.gz", sha256 = "" },
{ identifier = "cp313-macosx_x86_64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.14/python-3.13.14-macos11.pkg", sha256 = "8e58affb218c155a1dfdc27b291f817129669f8760e7a297adb2e4439ba5d2e8" },
{ identifier = "cp313-macosx_arm64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.14/python-3.13.14-macos11.pkg", sha256 = "8e58affb218c155a1dfdc27b291f817129669f8760e7a297adb2e4439ba5d2e8" },
{ identifier = "cp313-macosx_universal2", version = "3.13", url = "https://www.python.org/ftp/python/3.13.14/python-3.13.14-macos11.pkg", sha256 = "8e58affb218c155a1dfdc27b291f817129669f8760e7a297adb2e4439ba5d2e8" },
{ identifier = "cp314-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp314-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp314-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp314t-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp314t-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp314t-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-macos11.pkg", sha256 = "d3c9fff52214847e4fab03e9eaf53dd2a8e51e3534aa0b61f201b749f86bef28" },
{ identifier = "cp315-macosx_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "cp315-macosx_arm64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "cp315-macosx_universal2", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "cp315t-macosx_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "cp315t-macosx_arm64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "cp315t-macosx_universal2", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-macos11.pkg", sha256 = "57e0b1095f5dda52a8ff8b3b73140a52dfb3b76bdcf9e0284f2dbe10f7ee92ea" },
{ identifier = "pp39-macosx_x86_64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_x86_64.tar.gz", sha256 = "7ea762a1b0af7545a74cd4260bb3fd2812813deffef2ef8d2fddd5e03fa63ef1" },
{ identifier = "pp39-macosx_arm64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_arm64.tar.gz", sha256 = "b09ce3a865c1c0f4e58c0ee4f70511f1b27dfc1f7148f4b6060cfdfd581c9e82" },
{ identifier = "pp310-macosx_x86_64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-macos_x86_64.tar.gz", sha256 = "63f9d30cdd9e47cfe279be941975ac3d24e46c79756cd1d1bd2c551c27d8b32c" },
{ identifier = "pp310-macosx_arm64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-macos_arm64.tar.gz", sha256 = "72a74cf645e43608f7d88831581fb0f8e1f963fb38f0793bacd37d5018a9aeb8" },
{ identifier = "pp311-macosx_x86_64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-macos_x86_64.tar.gz", sha256 = "798279b0f233893ae22754290aedf35a1aea1ec9013a8ad8110f166d85944c91" },
{ identifier = "pp311-macosx_arm64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-macos_arm64.tar.gz", sha256 = "f837b3c203d60d7e25a31e267671a07ba0c9b9ac8081ad225571fb06fccf1b7b" },
{ identifier = "gp312_250-macosx_x86_64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.1/graalpy-25.0.1-macos-amd64.tar.gz", sha256 = "10b0721d52397f0cc85f038900318da2203711cbcfae7899e3faed49d3dc6221" },
{ identifier = "gp312_250-macosx_arm64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.3/graalpy-25.0.3-macos-aarch64.tar.gz", sha256 = "387d9f5b376860842bea4d55aae5820974f3f3b68fc36c77ae863a061a888857" },
]
@@ -192,29 +188,28 @@ python_configurations = [
{ identifier = "cp311-win_amd64", version = "3.11.9" },
{ identifier = "cp312-win32", version = "3.12.10" },
{ identifier = "cp312-win_amd64", version = "3.12.10" },
{ identifier = "cp313-win32", version = "3.13.13" },
{ identifier = "cp313-win_amd64", version = "3.13.13" },
{ identifier = "cp314-win32", version = "3.14.5" },
{ identifier = "cp314t-win32", version = "3.14.5" },
{ identifier = "cp314-win_amd64", version = "3.14.5" },
{ identifier = "cp314t-win_amd64", version = "3.14.5" },
{ identifier = "cp315-win32", version = "3.15.0-b1" },
{ identifier = "cp315t-win32", version = "3.15.0-b1" },
{ identifier = "cp315-win_amd64", version = "3.15.0-b1" },
{ identifier = "cp315t-win_amd64", version = "3.15.0-b1" },
{ identifier = "cp313-win32", version = "3.13.14" },
{ identifier = "cp313-win_amd64", version = "3.13.14" },
{ identifier = "cp314-win32", version = "3.14.6" },
{ identifier = "cp314t-win32", version = "3.14.6" },
{ identifier = "cp314-win_amd64", version = "3.14.6" },
{ identifier = "cp314t-win_amd64", version = "3.14.6" },
{ identifier = "cp315-win32", version = "3.15.0-rc1" },
{ identifier = "cp315t-win32", version = "3.15.0-rc1" },
{ identifier = "cp315-win_amd64", version = "3.15.0-rc1" },
{ identifier = "cp315t-win_amd64", version = "3.15.0-rc1" },
{ identifier = "cp39-win_arm64", version = "3.9.10" },
{ identifier = "cp310-win_arm64", version = "3.10.11" },
{ identifier = "cp311-win_arm64", version = "3.11.9" },
{ identifier = "cp312-win_arm64", version = "3.12.10" },
{ identifier = "cp313-win_arm64", version = "3.13.13" },
{ identifier = "cp314-win_arm64", version = "3.14.5" },
{ identifier = "cp314t-win_arm64", version = "3.14.5" },
{ identifier = "cp315-win_arm64", version = "3.15.0-b1" },
{ identifier = "cp315t-win_arm64", version = "3.15.0-b1" },
{ identifier = "cp313-win_arm64", version = "3.13.14" },
{ identifier = "cp314-win_arm64", version = "3.14.6" },
{ identifier = "cp314t-win_arm64", version = "3.14.6" },
{ identifier = "cp315-win_arm64", version = "3.15.0-rc1" },
{ identifier = "cp315t-win_arm64", version = "3.15.0-rc1" },
{ identifier = "pp39-win_amd64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-win64.zip", sha256 = "06ec12a5e964dc0ad33e6f380185a4d295178dce6d6df512f508e7aee00a1323" },
{ identifier = "pp310-win_amd64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-win64.zip", sha256 = "c0d07bba6c8fb4e5804f4a8b3f8ef07cc3d89f6ad1db42a45ffb9be60bbb7cc2" },
{ identifier = "pp311-win_amd64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-win64.zip", sha256 = "948b8ea58dea5b9917210fe4afd242c788fbfaba1c3f1a25e696a404f703389a" },
{ identifier = "gp311_242-win_amd64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-windows-amd64.zip", sha256 = "9606134284d4d95b2f9d69c3087cd3e9e488f46355b419f5e66588a3281df6a3" },
{ identifier = "gp312_250-win_amd64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.3/graalpy-25.0.3-windows-amd64.zip", sha256 = "2ae5c42b93e08d9e106a017634a3442b272ccae6d08ace157244de0449e937d4" },
]
@@ -222,28 +217,29 @@ python_configurations = [
python_configurations = [
{ identifier = "cp312-pyodide_wasm32", version = "3.12", default_pyodide_version = "0.27.7", node_version = "v22", sha256 = "0c2e7db42efa5d1dac38b50f8b3d659a1e3885d0a233494831b8206281307d52" },
{ identifier = "cp313-pyodide_wasm32", version = "3.13", default_pyodide_version = "0.29.4", node_version = "v22", sha256 = "a29fc4a076408a18fc29eb4b280f80c6dddc95c19514c874c29e590d0931c02a" },
{ identifier = "cp314-pyodide_wasm32", version = "3.14", default_pyodide_version = "314.0.0a2", node_version = "v24", sha256 = "ac7bbcdf289ab3ae25621c436b1d013099ef6bec644ad0538dae5d65552c5c95" },
{ identifier = "cp314-pyodide_wasm32", version = "3.14", default_pyodide_version = "314.0.4", node_version = "v24", sha256 = "257ceae085eaa1423c2ab49794d7a72bf36ddad475d126fa929791b9a8ab7289" },
{ identifier = "cp315-pyodide_wasm32", version = "3.15", default_pyodide_version = "315.0.0a2", node_version = "v24", sha256 = "d7c0d6ddf0fce807668d7413d0e0f20fbc7922128ba8361ed71d9cff048cb96a" },
]
[android]
python_configurations = [
{ identifier = "cp313-android_arm64_v8a", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.13/python-3.13.13-aarch64-linux-android.tar.gz", sha256 = "a21250c246b36eb704be096be51e40ab24cafa3ae1d7ca4c396e6bf780cf87cf" },
{ identifier = "cp313-android_x86_64", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.13/python-3.13.13-x86_64-linux-android.tar.gz", sha256 = "b021b76df2c8d64e41c76d18a2d91f27652356bd932c06f9076bac1b664c0e37" },
{ identifier = "cp314-android_arm64_v8a", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-aarch64-linux-android.tar.gz", sha256 = "f008321abf837fcaec569df143283ece0e764b18d8c75763200160553f906af1" },
{ identifier = "cp314-android_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.5/python-3.14.5-x86_64-linux-android.tar.gz", sha256 = "36184e31464b2b959d92c81ded8d025834342cc080623bced282a2a9a57bd47c" },
{ identifier = "cp315-android_arm64_v8a", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-aarch64-linux-android.tar.gz", sha256 = "9a25e5499d639d4f59bc766ad36c9eddd892232a9f9224c2fa4ef55dc1d49ff3" },
{ identifier = "cp315-android_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-x86_64-linux-android.tar.gz", sha256 = "86f492e92340028c8c7efedde6760b40f5e645062d0ef17af0d0bf4d18b127f2" },
{ identifier = "cp313-android_arm64_v8a", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.14/python-3.13.14-aarch64-linux-android.tar.gz", sha256 = "2541c4fa77b6543504c97fa90a71c745225b5800fe25bc8c73a6516b594d0cbc" },
{ identifier = "cp313-android_x86_64", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.14/python-3.13.14-x86_64-linux-android.tar.gz", sha256 = "9d96f7e077677b6651b2e756034ed41ab4479f5f8bf3168a814f458bc2ac137e" },
{ identifier = "cp314-android_arm64_v8a", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-aarch64-linux-android.tar.gz", sha256 = "38bbe77d3167b5cd554e03b1021324926f09f3825202b065951dd7638e9c37e5" },
{ identifier = "cp314-android_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-x86_64-linux-android.tar.gz", sha256 = "e04eb26607627e68d148f89de793372f54a345c91b13628567f24abcdd3bfa3e" },
{ identifier = "cp315-android_arm64_v8a", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-aarch64-linux-android.tar.gz", sha256 = "7d6fb28a69368841656f919a08141b0e3720837ac67987388037ee9d2a5c5492" },
{ identifier = "cp315-android_x86_64", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-x86_64-linux-android.tar.gz", sha256 = "f048f5c60b538efc64e4c26399a0a21202ce430949d5b2c10369d624548a5dc3" },
]
[ios]
python_configurations = [
{ identifier = "cp313-ios_arm64_iphoneos", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b13/Python-3.13-iOS-support.b13.tar.gz", sha256 = "d1f95f95137a4b91dc0cbe9b99ddfc0a78918dde883c7fbe7147074a5e715274" },
{ identifier = "cp313-ios_x86_64_iphonesimulator", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b13/Python-3.13-iOS-support.b13.tar.gz", sha256 = "d1f95f95137a4b91dc0cbe9b99ddfc0a78918dde883c7fbe7147074a5e715274" },
{ identifier = "cp313-ios_arm64_iphonesimulator", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b13/Python-3.13-iOS-support.b13.tar.gz", sha256 = "d1f95f95137a4b91dc0cbe9b99ddfc0a78918dde883c7fbe7147074a5e715274" },
{ identifier = "cp314-ios_arm64_iphoneos", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b9/Python-3.14-iOS-support.b9.tar.gz", sha256 = "8e4123b543bf17fdae2e2c6c033434487752438431014eb12e6d833aa35927a8" },
{ identifier = "cp314-ios_x86_64_iphonesimulator", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b9/Python-3.14-iOS-support.b9.tar.gz", sha256 = "8e4123b543bf17fdae2e2c6c033434487752438431014eb12e6d833aa35927a8" },
{ identifier = "cp314-ios_arm64_iphonesimulator", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b9/Python-3.14-iOS-support.b9.tar.gz", sha256 = "8e4123b543bf17fdae2e2c6c033434487752438431014eb12e6d833aa35927a8" },
{ identifier = "cp315-ios_arm64_iphoneos", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-iOS-XCframework.tar.gz", sha256 = "abd43fc362bb6e40a5233a499aa3fa96bf49306ca10b4cbcb27418778e429eb8" },
{ identifier = "cp315-ios_x86_64_iphonesimulator", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-iOS-XCframework.tar.gz", sha256 = "abd43fc362bb6e40a5233a499aa3fa96bf49306ca10b4cbcb27418778e429eb8" },
{ identifier = "cp315-ios_arm64_iphonesimulator", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b1-iOS-XCframework.tar.gz", sha256 = "abd43fc362bb6e40a5233a499aa3fa96bf49306ca10b4cbcb27418778e429eb8" },
{ identifier = "cp313-ios_arm64_iphoneos", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b14/Python-3.13-iOS-support.b14.tar.gz", sha256 = "8b5cb76ef8d8a2946052479358eeec9d54b4496cb60920e175ec1489b5cf7963" },
{ identifier = "cp313-ios_x86_64_iphonesimulator", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b14/Python-3.13-iOS-support.b14.tar.gz", sha256 = "8b5cb76ef8d8a2946052479358eeec9d54b4496cb60920e175ec1489b5cf7963" },
{ identifier = "cp313-ios_arm64_iphonesimulator", version = "3.13", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.13-b14/Python-3.13-iOS-support.b14.tar.gz", sha256 = "8b5cb76ef8d8a2946052479358eeec9d54b4496cb60920e175ec1489b5cf7963" },
{ identifier = "cp314-ios_arm64_iphoneos", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b10/Python-3.14-iOS-support.b10.tar.gz", sha256 = "200ef60eb67be0483ceb638daa9048f84f41a9a952707a5ad4c3198037c7b583" },
{ identifier = "cp314-ios_x86_64_iphonesimulator", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b10/Python-3.14-iOS-support.b10.tar.gz", sha256 = "200ef60eb67be0483ceb638daa9048f84f41a9a952707a5ad4c3198037c7b583" },
{ identifier = "cp314-ios_arm64_iphonesimulator", version = "3.14", url = "https://github.com/beeware/Python-Apple-support/releases/download/3.14-b10/Python-3.14-iOS-support.b10.tar.gz", sha256 = "200ef60eb67be0483ceb638daa9048f84f41a9a952707a5ad4c3198037c7b583" },
{ identifier = "cp315-ios_arm64_iphoneos", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-iOS-XCframework.tar.gz", sha256 = "178bf7bef9cd0f18b27cacb98b14332a5ba44c9427543ffb71f8809bc1f11c3c" },
{ identifier = "cp315-ios_x86_64_iphonesimulator", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-iOS-XCframework.tar.gz", sha256 = "178bf7bef9cd0f18b27cacb98b14332a5ba44c9427543ffb71f8809bc1f11c3c" },
{ identifier = "cp315-ios_arm64_iphonesimulator", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0rc1-iOS-XCframework.tar.gz", sha256 = "178bf7bef9cd0f18b27cacb98b14332a5ba44c9427543ffb71f8809bc1f11c3c" },
]
+185 -12
View File
@@ -18,9 +18,64 @@
"pyodide-prerelease",
"pypy",
"pypy-eol"
]
],
"description": "A Python version or flavor to enable."
},
"description": "A Python version or flavor to enable."
"build-frontend-no-pyodide": {
"default": "default",
"description": "Set the tool to use to build, either \"build\" (default), \"build[uv]\", \"uv\", or \"pip\"",
"oneOf": [
{
"enum": [
"pip",
"build",
"build[uv]",
"uv",
"default"
]
},
{
"type": "string",
"pattern": "^pip; ?args:"
},
{
"type": "string",
"pattern": "^build; ?args:"
},
{
"type": "string",
"pattern": "^build\\[uv\\]; ?args:"
},
{
"type": "string",
"pattern": "^uv; ?args:"
},
{
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"enum": [
"pip",
"build",
"build[uv]",
"uv"
]
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
],
"title": "CIBW_BUILD_FRONTEND"
}
},
"additionalProperties": false,
"description": "cibuildwheel's settings.",
@@ -136,7 +191,7 @@
},
"build-frontend": {
"default": "default",
"description": "Set the tool to use to build, either \"build\" (default), \"build[uv]\", \"uv\", or \"pip\"",
"description": "Set the tool to use to build, either \"build\" (default), \"build[uv]\", \"uv\", or \"pip\" (\"pyodide-build\" for pyodide)",
"oneOf": [
{
"enum": [
@@ -144,6 +199,7 @@
"build",
"build[uv]",
"uv",
"pyodide-build",
"default"
]
},
@@ -163,6 +219,10 @@
"type": "string",
"pattern": "^uv; ?args:"
},
{
"type": "string",
"pattern": "^pyodide-build; ?args:"
},
{
"type": "object",
"additionalProperties": false,
@@ -175,7 +235,8 @@
"pip",
"build",
"build[uv]",
"uv"
"uv",
"pyodide-build"
]
},
"args": {
@@ -460,6 +521,34 @@
],
"title": "CIBW_XBUILD_TOOLS"
},
"xbuild-files": {
"description": "Platform-specific files in the build environment",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"patternProperties": {
".+": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
}
}
],
"title": "CIBW_XBUILD_FILES"
},
"pyodide-version": {
"type": "string",
"description": "Specify the version of Pyodide to use",
@@ -679,6 +768,9 @@
"xbuild-tools": {
"$ref": "#/$defs/inherit"
},
"xbuild-files": {
"$ref": "#/$defs/inherit"
},
"before-test": {
"$ref": "#/$defs/inherit"
},
@@ -807,6 +899,9 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
@@ -860,7 +955,7 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"$ref": "#/$defs/build-frontend-no-pyodide"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -931,6 +1026,9 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
@@ -996,7 +1094,7 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"$ref": "#/$defs/build-frontend-no-pyodide"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -1013,11 +1111,27 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
"repair-wheel-command": {
"$ref": "#/properties/repair-wheel-command"
"description": "Execute a shell command to repair each built wheel.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"title": "CIBW_REPAIR_WHEEL_COMMAND",
"default": "delvewheel repair -w {dest_dir} -v {wheel}"
},
"test-command": {
"$ref": "#/properties/test-command"
@@ -1065,7 +1179,7 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"$ref": "#/$defs/build-frontend-no-pyodide"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -1082,6 +1196,9 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
@@ -1147,7 +1264,41 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"default": "pyodide-build",
"description": "On the pyodide platform, the build frontend must be \"pyodide-build\"",
"oneOf": [
{
"enum": [
"pyodide-build",
"default"
]
},
{
"type": "string",
"pattern": "^pyodide-build; ?args:"
},
{
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"enum": [
"pyodide-build"
]
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
],
"title": "CIBW_BUILD_FRONTEND"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -1164,6 +1315,9 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
@@ -1216,7 +1370,7 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"$ref": "#/$defs/build-frontend-no-pyodide"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -1233,11 +1387,27 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
"repair-wheel-command": {
"$ref": "#/properties/repair-wheel-command"
"description": "Execute a shell command to repair each built wheel.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"title": "CIBW_REPAIR_WHEEL_COMMAND",
"default": "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"
},
"test-command": {
"$ref": "#/properties/test-command"
@@ -1285,7 +1455,7 @@
"$ref": "#/properties/before-test"
},
"build-frontend": {
"$ref": "#/properties/build-frontend"
"$ref": "#/$defs/build-frontend-no-pyodide"
},
"build-verbosity": {
"$ref": "#/properties/build-verbosity"
@@ -1302,6 +1472,9 @@
"xbuild-tools": {
"$ref": "#/properties/xbuild-tools"
},
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": {
"$ref": "#/properties/pyodide-version"
},
@@ -1,29 +1,36 @@
# This file was autogenerated by uv via the following command:
# nox -s update_constraints
annotated-types==0.7.0
# via pydantic
auditwheel-emscripten==0.2.4
attrs==26.1.0
# via
# cattrs
# pyodide-build
# pyodide-lock
auditwheel-emscripten==0.2.5
# via pyodide-build
build==1.5.0
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
certifi==2026.5.20
cattrs==26.1.0
# via
# pyodide-build
# pyodide-lock
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
click==8.1.8
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
# pyodide-cli
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via requests
leb128==1.0.9
# via auditwheel-emscripten
@@ -31,38 +38,31 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# auditwheel-emscripten
# build
# pyodide-build
# wheel
pip==26.1.1
pip==26.2.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.9.6
platformdirs==4.11.0
# via
# pyodide-build
# python-discovery
# virtualenv
pydantic==2.13.4
# via
# pyodide-build
# pyodide-lock
pydantic-core==2.46.4
# via pydantic
pygments==2.20.0
# via rich
pyodide-build==0.34.4
pyodide-build==0.39.0
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0
# via
# auditwheel-emscripten
# pyodide-build
pyodide-lock==0.1.3
pyodide-lock==0.2.0
# via pyodide-build
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via pyodide-build
@@ -72,16 +72,11 @@ rich==15.0.0
# pyodide-cli
ruamel-yaml==0.19.1
# via pyodide-build
typing-extensions==4.15.0
# via
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.2
# via pydantic
typing-extensions==4.16.0
# via cattrs
urllib3==2.7.0
# via requests
virtualenv==21.3.3
virtualenv==21.7.1
# via
# build
# pyodide-build
@@ -1,29 +1,36 @@
# This file was autogenerated by uv via the following command:
# nox -s update_constraints
annotated-types==0.7.0
# via pydantic
auditwheel-emscripten==0.2.4
attrs==26.1.0
# via
# cattrs
# pyodide-build
# pyodide-lock
auditwheel-emscripten==0.2.5
# via pyodide-build
build==1.5.0
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
certifi==2026.5.20
cattrs==26.1.0
# via
# pyodide-build
# pyodide-lock
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
click==8.1.8
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
# pyodide-cli
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via requests
leb128==1.0.9
# via auditwheel-emscripten
@@ -31,38 +38,31 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# auditwheel-emscripten
# build
# pyodide-build
# wheel
pip==26.1.1
pip==26.2.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.9.6
platformdirs==4.11.0
# via
# pyodide-build
# python-discovery
# virtualenv
pydantic==2.13.4
# via
# pyodide-build
# pyodide-lock
pydantic-core==2.46.4
# via pydantic
pygments==2.20.0
# via rich
pyodide-build==0.34.4
pyodide-build==0.39.0
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0
# via
# auditwheel-emscripten
# pyodide-build
pyodide-lock==0.1.3
pyodide-lock==0.2.0
# via pyodide-build
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via pyodide-build
@@ -72,16 +72,11 @@ rich==15.0.0
# pyodide-cli
ruamel-yaml==0.19.1
# via pyodide-build
typing-extensions==4.15.0
# via
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.2
# via pydantic
typing-extensions==4.16.0
# via cattrs
urllib3==2.7.0
# via requests
virtualenv==21.3.3
virtualenv==21.7.1
# via
# build
# pyodide-build
@@ -1,29 +1,36 @@
# This file was autogenerated by uv via the following command:
# nox -s update_constraints
annotated-types==0.7.0
# via pydantic
auditwheel-emscripten==0.2.4
attrs==26.1.0
# via
# cattrs
# pyodide-build
# pyodide-lock
auditwheel-emscripten==0.2.5
# via pyodide-build
build==1.5.0
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
certifi==2026.5.20
cattrs==26.1.0
# via
# pyodide-build
# pyodide-lock
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
click==8.1.8
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
# pyodide-cli
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via requests
leb128==1.0.9
# via auditwheel-emscripten
@@ -31,38 +38,31 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# auditwheel-emscripten
# build
# pyodide-build
# wheel
pip==26.1.1
pip==26.2.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.9.6
platformdirs==4.11.0
# via
# pyodide-build
# python-discovery
# virtualenv
pydantic==2.13.4
# via
# pyodide-build
# pyodide-lock
pydantic-core==2.46.4
# via pydantic
pygments==2.20.0
# via rich
pyodide-build==0.34.4
pyodide-build==0.39.0
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0
# via
# auditwheel-emscripten
# pyodide-build
pyodide-lock==0.1.3
pyodide-lock==0.2.0
# via pyodide-build
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via pyodide-build
@@ -72,16 +72,11 @@ rich==15.0.0
# pyodide-cli
ruamel-yaml==0.19.1
# via pyodide-build
typing-extensions==4.15.0
# via
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.2
# via pydantic
typing-extensions==4.16.0
# via cattrs
urllib3==2.7.0
# via requests
virtualenv==21.3.3
virtualenv==21.7.1
# via
# build
# pyodide-build
@@ -0,0 +1,86 @@
# This file was autogenerated by uv via the following command:
# nox -s update_constraints
attrs==26.1.0
# via
# cattrs
# pyodide-build
# pyodide-lock
auditwheel-emscripten==0.2.5
# via pyodide-build
build==1.5.0
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
cattrs==26.1.0
# via
# pyodide-build
# pyodide-lock
certifi==2026.7.22
# via requests
charset-normalizer==3.4.9
# via requests
click==8.1.8
# via
# -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build
# pyodide-cli
distlib==0.4.3
# via virtualenv
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.18
# via requests
leb128==1.0.9
# via auditwheel-emscripten
markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.3
# via
# auditwheel-emscripten
# build
# pyodide-build
# wheel
pip==26.2.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.11.0
# via
# pyodide-build
# virtualenv
pygments==2.20.0
# via rich
pyodide-build==0.39.0
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0
# via
# auditwheel-emscripten
# pyodide-build
pyodide-lock==0.2.0
# via pyodide-build
pyproject-hooks==1.2.0
# via build
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via pyodide-build
rich==15.0.0
# via
# pyodide-build
# pyodide-cli
ruamel-yaml==0.19.1
# via pyodide-build
typing-extensions==4.16.0
# via cattrs
urllib3==2.7.0
# via requests
virtualenv==21.7.1
# via
# build
# pyodide-build
wheel==0.47.0
# via
# auditwheel-emscripten
# pyodide-build
@@ -10,27 +10,29 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
exceptiongroup==1.3.1
# via cattrs
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -44,41 +46,47 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
tomli==2.4.1
# via build
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -90,7 +98,7 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
zipp==4.1.0
# via importlib-metadata
@@ -10,25 +10,27 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,40 +42,45 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1; implementation_name != "graalpy" or platform_system != "Windows"
pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows"
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -83,5 +90,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
@@ -10,25 +10,28 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2; implementation_name != "graalpy"
filelock==3.29.7; implementation_name == "graalpy"
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,40 +43,47 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1; implementation_name != "graalpy" or platform_system != "Windows"
pip==26.2.1; implementation_name != "graalpy"
pip==26.1.2; implementation_name == "graalpy" and platform_system != "Windows"
pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows"
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -83,5 +93,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
@@ -10,25 +10,27 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,39 +42,45 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -82,5 +90,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
@@ -10,25 +10,27 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,39 +42,45 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -82,5 +90,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
@@ -10,25 +10,27 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,39 +42,45 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -82,5 +90,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
+21 -11
View File
@@ -10,19 +10,21 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.4.2
# via -r cibuildwheel/resources/constraints.in
build==1.4.4
# via -r cibuildwheel/resources/constraints.in
cattrs==25.3.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
exceptiongroup==1.3.1
# via cattrs
@@ -30,12 +32,14 @@ filelock==3.19.1
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
importlib-metadata==8.7.1
# via build
# via
# build
# pkgconf
kaitaistruct==0.11
# via abi3audit
macholib==1.16.4
@@ -47,26 +51,32 @@ mdurl==0.1.2
packaging==25.0
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.0.1
# via -r cibuildwheel/resources/constraints.in
pkgconf==2.4.3.post2
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.4.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.32.5
# via
@@ -78,7 +88,7 @@ rich==14.2.0
# via abi3audit
tomli==2.4.1
# via build
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -90,7 +100,7 @@ urllib3==2.6.3
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
zipp==3.23.1
# via importlib-metadata
+5
View File
@@ -4,3 +4,8 @@ delocate
delvewheel
virtualenv
abi3audit
# Android
auditwheel
patchelf
pkgconf
+24 -16
View File
@@ -10,25 +10,27 @@ attrs==26.1.0
# via
# cattrs
# requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0
# via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0
# via requests-cache
certifi==2026.5.20
certifi==2026.7.22
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.4.9
# via requests
delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in
delvewheel==1.12.1
delvewheel==1.13.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.4.0
distlib==0.4.3
# via virtualenv
filelock==3.29.0
filelock==3.32.2
# via
# python-discovery
# virtualenv
idna==3.16
idna==3.18
# via
# requests
# url-normalize
@@ -40,39 +42,45 @@ markdown-it-py==4.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
packaging==26.2
packaging==26.3
# via
# abi3audit
# auditwheel
# build
# delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26
# via
# abi3audit
# delvewheel
pip==26.1.1
pip==26.2.1
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.9.6
pkgconf==3.0.1.post0
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.11.0
# via
# python-discovery
# requests-cache
# virtualenv
pyelftools==0.32
# via abi3audit
pyelftools==0.33
# via
# abi3audit
# auditwheel
pygments==2.20.0
# via rich
pyproject-hooks==1.2.0
# via build
python-discovery==1.3.1
python-discovery==1.5.1
# via virtualenv
requests==2.34.2
# via
# abi3audit
# requests-cache
requests-cache==1.3.2
requests-cache==1.3.3
# via abi3audit
rich==15.0.0
# via abi3audit
typing-extensions==4.15.0
typing-extensions==4.16.0
# via
# cattrs
# delocate
@@ -82,5 +90,5 @@ urllib3==2.7.0
# via
# requests
# requests-cache
virtualenv==21.3.3
virtualenv==21.7.1
# via -r cibuildwheel/resources/constraints.in
+12
View File
@@ -1,3 +1,6 @@
# These are the defaults used by cibuildwheel itself. They should match the values in
# generate_schema.py, which are used by external tools for validation and IDE support.
[tool.cibuildwheel]
build = "*"
skip = ""
@@ -52,6 +55,13 @@ musllinux-s390x-image = "musllinux_1_2"
musllinux-armv7l-image = "musllinux_1_2"
musllinux-riscv64-image = "musllinux_1_2"
[tool.cibuildwheel.xbuild-files]
numpy = [
"numpy/_core/include/numpy/_numpyconfig.h",
"numpy/_core/include/numpy/numpyconfig.h",
"numpy/_core/lib/libnpymath.a",
"numpy/random/lib/libnpyrandom.a",
]
[tool.cibuildwheel.linux]
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
@@ -63,8 +73,10 @@ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest
repair-wheel-command = "delvewheel repair -w {dest_dir} -v {wheel}"
[tool.cibuildwheel.android]
repair-wheel-command = "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"
[tool.cibuildwheel.ios]
[tool.cibuildwheel.pyodide]
audit-command = ""
build-frontend = "pyodide-build"
+2 -2
View File
@@ -1,4 +1,4 @@
url = "https://nodejs.org/dist/"
v24 = "v24.16.0"
v22 = "v22.22.3"
v24 = "v24.19.0"
v22 = "v22.23.2"
v20 = "v20.20.2"
+34 -34
View File
@@ -1,54 +1,54 @@
[x86_64]
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_x86_64:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_x86_64@sha256:c163a278006f45883c117b4166b93cdc7b574b62e58292ed9e52879579841d77 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64@sha256:012f4a50472412f18bb2b450c1cce7158434cfae4ae878591c2748a13a30c2be # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64@sha256:db817cd4c670f1191d74db6a94a0b115954af78861db7da660de4e93ebf2984c # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_x86_64@sha256:f130bd3e3aebb39abcdec28a89f987f0d31b52d74bac5852318303698e9a5033 # 2026.08.04-1
[i686]
manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_i686:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_i686:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_i686@sha256:abfc526a4f9d9692ed6d53b60ffd6be764aa7a4dc1d61522a1ce5ea64138aa53 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686@sha256:605a71b7fa720562ad76147860e33d97b2a884ca9d5a454b2f7f353caec40ded # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_i686@sha256:82e74fcb11aa1d425260804292b8a25533f37eda280570b2441a465dc159351a # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_i686@sha256:2ccf31ab3685cf8952f2d9251f79a29c7ffcb663bbc58c10b2317a15a86ac96d # 2026.08.04-1
[aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_aarch64:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_aarch64@sha256:5d366450eeff9abe09cc93db50fd2c9832bafaf473daa7a911d8b184424bbefd # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64@sha256:52e4da6e9348db7cd0b529a827623b62b7c1fe867ba515ae752fa13d41f7f46e # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64@sha256:86585a1adfa6cdb4e3aea2f5bf11d6fffa37acf17aa902605d7237c55d3c88ce # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_aarch64@sha256:1fa8dcacab5e13769abb36028f98bd2c0a1af4dbde492505f774d7f0ce01e87f # 2026.08.04-1
[ppc64le]
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_ppc64le:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_ppc64le:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le@sha256:405ac40dffd7a76b4864a185d0440c6449c855eaffd1a20b56af9e4cc15318a6 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le@sha256:ad99a0b35b8820b0ccd1d117e23097da224df11c98f19e2783735d5b7e717526 # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_ppc64le@sha256:bc61f200bea02d2a507bb292d6210297bd12abc71fa1e8e1f05b1755495b8518 # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_ppc64le@sha256:0acbe90fc63807d3ce52249d1d21e5625fe105aee7f3de60583b8485d82401c8 # 2026.08.04-1
[s390x]
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_s390x:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_s390x:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_s390x@sha256:3797dba7137e416c67ca1f45222dd382a2bfdaee8c751e95a79503adf38071e7 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x@sha256:43b1c58ab1a37f3bf45d65026c968be18f2a4dddd4f923291d1122b3e42380da # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_s390x@sha256:b9bba263ab1309ddd2b41560f8ea15138fdb31fa31daf5858878d00b19d57d77 # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_s390x@sha256:aec126e37ce315e724217342bb62533cbfeae88b4ed5aa2a8bfd5ee4a4a1ca77 # 2026.08.04-1
[pypy_x86_64]
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_x86_64@sha256:c163a278006f45883c117b4166b93cdc7b574b62e58292ed9e52879579841d77 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64@sha256:012f4a50472412f18bb2b450c1cce7158434cfae4ae878591c2748a13a30c2be # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64@sha256:db817cd4c670f1191d74db6a94a0b115954af78861db7da660de4e93ebf2984c # 2026.08.04-1
[pypy_i686]
manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_i686:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_i686@sha256:abfc526a4f9d9692ed6d53b60ffd6be764aa7a4dc1d61522a1ce5ea64138aa53 # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686@sha256:605a71b7fa720562ad76147860e33d97b2a884ca9d5a454b2f7f353caec40ded # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_i686@sha256:82e74fcb11aa1d425260804292b8a25533f37eda280570b2441a465dc159351a # 2026.08.04-1
[pypy_aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2026.05.27-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2026.05.27-1
manylinux2014 = quay.io/pypa/manylinux2014_aarch64@sha256:5d366450eeff9abe09cc93db50fd2c9832bafaf473daa7a911d8b184424bbefd # 2026.08.04-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64@sha256:52e4da6e9348db7cd0b529a827623b62b7c1fe867ba515ae752fa13d41f7f46e # 2026.08.04-1
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64@sha256:86585a1adfa6cdb4e3aea2f5bf11d6fffa37acf17aa902605d7237c55d3c88ce # 2026.08.04-1
[armv7l]
manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l:2026.05.27-1
manylinux_2_35 = quay.io/pypa/manylinux_2_35_armv7l:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2026.05.27-1
manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l@sha256:bbd7f67c0fc2a9541ed462a41bd9abbfa696801483533ba44ec5fe3120e8cda6 # 2026.08.04-1
manylinux_2_35 = quay.io/pypa/manylinux_2_35_armv7l@sha256:1335af18598960ecc4b57ccf239cacbca847af9f197e65e495ba376d0178385a # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l@sha256:fd4998e62ec4476d76d7b180b523e21ac7557d7f41f1b1e7d02ced21a3eee8b5 # 2026.08.04-1
[riscv64]
manylinux_2_39 = quay.io/pypa/manylinux_2_39_riscv64:2026.05.27-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_riscv64:2026.05.27-1
manylinux_2_39 = quay.io/pypa/manylinux_2_39_riscv64@sha256:41197d59628c256b0fde14a5dd5bb306e17665c515a8385e43cc72c1da1d7866 # 2026.08.04-1
musllinux_1_2 = quay.io/pypa/musllinux_1_2_riscv64@sha256:aaf12357d794dc375e797dce7fd71e92013bc46f269bc4cffe4da1f188080afb # 2026.08.04-1
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
default = { version = "21.3.3", url = "https://github.com/pypa/get-virtualenv/releases/download/21.3.3/virtualenv.pyz", sha256 = "d3a7f4ee4c820c4247fe14ec1a478e19ef8f63f716c0f15bc10fab4d70ad9b69" }
default = { version = "21.7.1", url = "https://github.com/pypa/get-virtualenv/releases/download/21.7.1/virtualenv.pyz", sha256 = "d63ac10e610738c3dcfa51ee0799e6b69ce2964d76cab734542684baf0ed3a5f" }
+2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.util", "json"}
import json
from cibuildwheel.util import resources
+3 -14
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"bracex", "fnmatch", "itertools", "packaging", "packaging.version"}
import dataclasses
import itertools
from enum import StrEnum
@@ -90,7 +92,7 @@ class BuildSelector:
return False
# filter out groups that are not enabled
if EnableGroup.CPythonPrerelease not in self.enable and fnmatch(build_id, "cp315*"):
if EnableGroup.CPythonPrerelease not in self.enable and fnmatch(build_id, "cp316*"):
return False
is_pypy_eol = fnmatch(build_id, "pp3?-*") or fnmatch(build_id, "pp310-*")
is_pypy = fnmatch(build_id, "pp*") and not is_pypy_eol
@@ -102,19 +104,6 @@ class BuildSelector:
return False
if EnableGroup.PyodideEoL not in self.enable and fnmatch(build_id, "cp312-pyodide_*"):
return False
# NOTE: Disable this when we don't have any Pyodide prereleases (e.g., 314.0.0a1+)
# When doing this, also:
# 1. update Pyodide tests in unit_test/build_selector_test.py and unit_test/options_test.py accordingly.
# 2. update Python versions for Pyodide identifiers in cibuildwheel/selector.py.
# 3. update constraints as necessary via bin/generate_pyodide_constraints.py and add/delete
# Pyodide constraints files in cibuildwheel/resources/constraints/ as necessary.
# When disabling, update the pattern to match the experimental Python version in case
# it is bumped to Python 3.15 (likely cp315-pyodide_* but could remain as 3.14 as well).
# This depends on the CPython version being used in the Pyodide runtime at the time.
if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
build_id, "cp314-pyodide_*"
):
return False
should_build = selector_matches(self.build_config, build_id)
should_skip = selector_matches(self.skip_config, build_id)
+2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.errors", "shlex", "shutil", "subprocess"}
import os
import shlex
import shutil
+47 -4
View File
@@ -1,12 +1,29 @@
from __future__ import annotations
__lazy_modules__ = {
"certifi",
"cibuildwheel.errors",
"hashlib",
"shutil",
"ssl",
"tarfile",
"typing",
"urllib",
"urllib.error",
"urllib.request",
"zipfile",
}
import hashlib
import os
import shutil
import ssl
import tarfile
import time
import urllib.error
import urllib.request
from contextlib import contextmanager
from pathlib import Path, PurePath
from typing import Final
from zipfile import ZipFile
@@ -18,7 +35,7 @@ from cibuildwheel.errors import FatalError
TYPE_CHECKING = False
if TYPE_CHECKING:
from collections.abc import Callable
from collections.abc import Callable, Generator
DEFAULT_CIBW_CACHE_PATH: Final[Path] = user_cache_path(appname="cibuildwheel", appauthor="pypa")
CIBW_CACHE_PATH: Final[Path] = Path(
@@ -26,6 +43,22 @@ CIBW_CACHE_PATH: Final[Path] = Path(
).resolve()
@contextmanager
def remove_on_error(path: Path) -> Generator[None, None, None]:
try:
yield
except BaseException as original_exception:
try:
if path.is_dir() and not path.is_symlink():
shutil.rmtree(path)
elif path.exists() or path.is_symlink():
path.unlink()
except BaseException as cleanup_exception:
msg = f"Failed to remove {path}. Please remove it manually."
raise BaseExceptionGroup(msg, [original_exception, cleanup_exception]) from None
raise
def ensure_cache_sentinel(cache_path: Path) -> None:
"""Create a sentinel file to mark a cibuildwheel cache directory.
@@ -55,20 +88,28 @@ def download(url: str, dest: Path, *, sha256: str | None = None) -> None:
# so we use certifi (this sounds odd but requests also does this by default)
cafile = os.environ.get("SSL_CERT_FILE", certifi.where())
context = ssl.create_default_context(cafile=cafile)
repeat_num = 3
# exponential backoff, so that a network outage of about a minute is survivable
repeat_num = 6
for i in range(repeat_num):
try:
with urllib.request.urlopen(url, context=context) as response:
dest.write_bytes(response.read())
break
except urllib.error.HTTPError as error:
# a client error, such as a bad URL, will not fix itself
if i == repeat_num - 1 or 400 <= error.code < 500:
raise
time.sleep(3 * 2**i)
except OSError:
if i == repeat_num - 1:
raise
time.sleep(3)
time.sleep(3 * 2**i)
if sha256:
computed = hashlib.sha256(dest.read_bytes()).hexdigest()
with dest.open("rb") as f:
computed = hashlib.file_digest(f, "sha256").hexdigest()
if computed != sha256:
dest.unlink(missing_ok=True)
msg = f"SHA256 mismatch for {url}: expected {sha256!r}, got {computed!r}"
@@ -99,6 +140,8 @@ def extract_tar(tar_src: Path, dest: Path) -> None:
See: https://docs.python.org/3/library/tarfile.html#tarfile.tar_filter for filter details
"""
with tarfile.open(tar_src) as tar_:
# getattr shim needed while Python 3.11.0-3.11.3 are supported;
# once the minimum is 3.11.4+/3.12, replace with: tar_.extractall(dest, filter="tar")
tar_.extraction_filter = getattr(tarfile, "tar_filter", (lambda member, _: member))
tar_.extractall(dest)
+4 -2
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
__lazy_modules__ = {"collections", "itertools", "re", "shlex", "textwrap"}
import dataclasses
import itertools
import re
@@ -109,7 +111,7 @@ def parse_key_value_string(
if kw_arg_names is None:
kw_arg_names = []
all_field_names = [*positional_arg_names, *kw_arg_names]
all_field_names = None if ("*" in kw_arg_names) else [*positional_arg_names, *kw_arg_names]
shlexer = shlex.shlex(key_value_string, posix=True, punctuation_chars=";")
shlexer.commenters = ""
@@ -126,7 +128,7 @@ def parse_key_value_string(
# check to see if the option name is specified
field_name, sep, first_value = field[0].partition(":")
if sep:
if field_name not in all_field_names:
if (all_field_names is not None) and (field_name not in all_field_names):
msg = f"Failed to parse {key_value_string!r}. Unknown field name {field_name!r}"
raise ValueError(msg)
+8
View File
@@ -1,5 +1,13 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"packaging",
"packaging.utils",
"shlex",
}
import shlex
from dataclasses import dataclass, field
from pathlib import Path, PurePath
+39 -7
View File
@@ -1,15 +1,27 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.util.file",
"cibuildwheel.util.resources",
"filelock",
"fnmatch",
"hashlib",
"json",
"platform",
"subprocess",
}
import fnmatch
import functools
import hashlib
import json
import platform
import subprocess
import typing
from filelock import FileLock
from cibuildwheel.util.file import download, extract_tar
from cibuildwheel.util.file import download, extract_tar, remove_on_error
from cibuildwheel.util.resources import PYTHON_BUILD_STANDALONE_RELEASES
TYPE_CHECKING = False
@@ -42,6 +54,26 @@ class PythonBuildStandaloneError(Exception):
"""Errors related to python-build-standalone."""
def _is_musl_libc() -> bool:
"""
Detect whether the host uses musl libc (e.g. Alpine Linux).
``platform.libc_ver()`` only ever reports glibc, so we shell out to ``ldd``,
which prints "musl libc" on musl-based systems (and "GNU libc"/"GLIBC" on
glibc systems). If ``ldd`` is unavailable, we fall back to assuming glibc.
"""
try:
ldd = subprocess.run(
["ldd", "--version"],
capture_output=True,
text=True,
check=False,
)
except OSError:
return False
return "musl" in (ldd.stdout + ldd.stderr).lower()
def _get_platform_identifiers() -> tuple[str, str, str | None]:
"""
Detects the current platform and returns architecture, platform, and libc
@@ -67,7 +99,7 @@ def _get_platform_identifiers() -> tuple[str, str, str | None]:
# Map OS + Libc
if system == "Linux":
platform_identifier = "unknown-linux"
libc_identifier = "musl" if "musl" in (platform.libc_ver() or ("", "")) else "gnu"
libc_identifier = "musl" if _is_musl_libc() else "gnu"
elif system == "Darwin":
platform_identifier = "apple-darwin"
elif system == "Windows":
@@ -122,7 +154,8 @@ def _download_or_get_from_cache(
asset_cache_path = cache_dir / asset_filename
if asset_cache_path.is_file():
if sha256:
computed = hashlib.sha256(asset_cache_path.read_bytes()).hexdigest()
with asset_cache_path.open("rb") as f:
computed = hashlib.file_digest(f, "sha256").hexdigest()
if computed != sha256:
print(
f"Cached python_build_standalone SHA256 mismatch for {asset_cache_path}; redownloading."
@@ -136,7 +169,8 @@ def _download_or_get_from_cache(
return asset_cache_path
print(f"Downloading python_build_standalone: {asset_url} to {asset_cache_path}")
download(asset_url, asset_cache_path, sha256=sha256 or None)
with remove_on_error(asset_cache_path):
download(asset_url, asset_cache_path, sha256=sha256 or None)
return asset_cache_path
@@ -196,9 +230,7 @@ def create_python_build_standalone_environment(
)
python_base_dir = temp_dir / "pbs"
if python_base_dir.exists():
msg = f"python-build-standalone directory already exists: {python_base_dir}"
raise PythonBuildStandaloneError(msg)
assert not python_base_dir.exists()
extract_tar(archive_path, python_base_dir)
return _find_python_executable(python_base_dir)
+14 -2
View File
@@ -1,6 +1,9 @@
from __future__ import annotations
__lazy_modules__ = {"tomllib"}
import functools
import os
import tomllib
from pathlib import Path
@@ -16,7 +19,9 @@ FREE_THREAD_ENABLE_314: Final[Path] = PATH / "free-threaded-enable-314.xml"
FREE_THREAD_ENABLE_315: Final[Path] = PATH / "free-threaded-enable-315.xml"
NODEJS: Final[Path] = PATH / "nodejs.toml"
DEFAULTS: Final[Path] = PATH / "defaults.toml"
PINNED_DOCKER_IMAGES: Final[Path] = PATH / "pinned_docker_images.cfg"
PINNED_DOCKER_IMAGES: Final[Path] = Path(
os.environ.get("CIBW_INTERNAL_PINNED_DOCKER_IMAGES", str(PATH / "pinned_docker_images.cfg"))
)
BUILD_PLATFORMS: Final[Path] = PATH / "build-platforms.toml"
CONSTRAINTS: Final[Path] = PATH / "constraints.txt"
VIRTUALENV: Final[Path] = PATH / "virtualenv.toml"
@@ -31,7 +36,14 @@ IOS_SUPPORT_FILES: Final[Path] = PATH / "ios-support"
def read_all_configs() -> dict[str, list[dict[str, str]]]:
with BUILD_PLATFORMS.open("rb") as f:
loaded_file = tomllib.load(f)
return {k: list[dict[str, str]](v["python_configurations"]) for k, v in loaded_file.items()}
configs = {k: list[dict[str, str]](v["python_configurations"]) for k, v in loaded_file.items()}
for platform, python_configs in configs.items():
for config in python_configs:
if "url" in config and not config.get("sha256"):
identifier = config["identifier"]
msg = f"{platform} Python configuration {identifier!r} is missing a sha256"
raise ValueError(msg)
return configs
def read_python_configs(config: PlatformName) -> list[dict[str, str]]:
+33 -5
View File
@@ -1,5 +1,20 @@
from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"contextlib",
"filelock",
"packaging",
"packaging.markers",
"packaging.requirements",
"packaging.version",
"pathlib",
"shutil",
"tomllib",
}
import contextlib
import functools
import os
@@ -16,7 +31,7 @@ from packaging.version import Version
from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call
from cibuildwheel.util.file import CIBW_CACHE_PATH, download
from cibuildwheel.util.file import CIBW_CACHE_PATH, download, remove_on_error
TYPE_CHECKING = False
if TYPE_CHECKING:
@@ -53,11 +68,12 @@ def _ensure_virtualenv(version: str) -> tuple[Path, Version]:
configuration = loaded_file.get(key, loaded_file["default"])
version = str(configuration["version"])
url = str(configuration["url"])
sha256 = str(configuration.get("sha256", ""))
sha256 = str(configuration["sha256"])
path = CIBW_CACHE_PATH / f"virtualenv-{version}.pyz"
with FileLock(str(path) + ".lock"):
if not path.exists():
download(url, path, sha256=sha256 or None)
with remove_on_error(path):
download(url, path, sha256=sha256)
return (path, Version(version))
@@ -84,7 +100,7 @@ def _parse_pip_constraint_for_virtualenv(
If it can't get an exact version, the real constraint will be handled by the
{macos|windows}.setup_python function.
If marker_env is provided, marker-bearing constraints are evaluated against it;
otherwise, marker-bearing constraints are skipped.
otherwise, they are evaluated against the host's default environment.
"""
env: dict[str, str] = (
marker_env if marker_env is not None else cast("dict[str, str]", default_environment())
@@ -136,6 +152,10 @@ def virtualenv(
venv. Otherwise, pip is installed.
"""
# the unresolved path, so e.g. the python.org framework bin directory is
# used rather than the internal location of the real binary
base_python_bin_dir = None if _IS_WIN else python.parent
# virtualenv may fail if this is a symlink.
python = python.resolve()
@@ -173,7 +193,7 @@ def virtualenv(
python,
venv_path,
)
venv_env = activate_virtualenv(venv_path, env=env)
venv_env = activate_virtualenv(venv_path, env=env, base_python_bin_dir=base_python_bin_dir)
if not use_uv and pip_version == "embed":
call(
"python",
@@ -192,11 +212,19 @@ def virtualenv(
def activate_virtualenv(
venv_path: Path,
env: dict[str, str] | None = None,
base_python_bin_dir: Path | None = None,
) -> dict[str, str]:
"""
Return a copy of the environment with the virtualenv at `venv_path` activated.
If given, `base_python_bin_dir` is placed on PATH right after the venv, so
that scripts installed alongside the base interpreter that aren't copied
into the venv (such as python3-config, see #2021) resolve to the matching
interpreter.
"""
paths = [str(venv_path), str(venv_path / "Scripts")] if _IS_WIN else [str(venv_path / "bin")]
if base_python_bin_dir is not None:
paths.append(str(base_python_bin_dir))
venv_env = os.environ.copy() if env is None else env.copy()
venv_env["PATH"] = os.pathsep.join([*paths, venv_env["PATH"]])
venv_env["VIRTUAL_ENV"] = str(venv_path)
+47 -51
View File
@@ -1,6 +1,6 @@
# Maintaining Pyodide support
Last updated: May 2026
Last updated: August 2026
This page describes how to update cibuildwheel's Pyodide platform code when either:
@@ -11,17 +11,26 @@ This page describes how to update cibuildwheel's Pyodide platform code when eith
Pyodide has three types of releases that matter to cibuildwheel:
- **Stable** the most recent full Pyodide release (e.g., `0.29.x` / cp313). This is enabled by default with no special `CIBW_ENABLE` flag needed.
- **Prerelease** an alpha/beta/rc Pyodide release that uses the _next_ CPython version (e.g., `314.0.0a1` / cp314). Users must opt in with `CIBW_ENABLE: pyodide-prerelease` to build against this version. This may or may not be available at any given time, depending on the Pyodide release cycle.
- **End-of-life (EoL)** older Pyodide stable releases that are no longer the current stable. These are kept available behind `CIBW_ENABLE: pyodide-eol` so that users who still need to build for older Pyodide versions can do so.
- **Stable** the most recent full Pyodide release.
This is enabled by default with no special `CIBW_ENABLE` flag needed.
- **Prerelease** an alpha/beta/rc Pyodide release that uses the _next_ CPython
version. Users must opt in with `CIBW_ENABLE:
cpython-prerelease` to build against this version. This may or may not be
available at any given time, depending on the Pyodide release cycle.
- **End-of-life (EoL)** older Pyodide stable releases that are no longer the
current stable. These are kept available behind `CIBW_ENABLE: pyodide-eol` so
that users who still need to build for older Pyodide versions can do so.
The guards in `cibuildwheel/selector.py` enforce this distinction. The constraints files under `cibuildwheel/resources/` pin the exact tool versions that go with each build.
The guards in `cibuildwheel/selector.py` enforce this distinction. The
constraints files under `cibuildwheel/resources/` pin the exact tool versions
that go with each build.
---
## When a new Pyodide prerelease becomes available
For example, consider a scenario when Pyodide ships a new `315.0.0a1` with cp315 support.
For example, consider a scenario when Pyodide ships a new `315.0.0a1` with cp315
support.
### 1. Add the new Python configuration
@@ -31,61 +40,39 @@ In `cibuildwheel/resources/build-platforms.toml`, add an entry under `[pyodide]`
{ identifier = "cp315-pyodide_wasm32", version = "3.15", default_pyodide_version = "315.0.0a1", node_version = "v24", sha256 = "SHA256" },
```
`version` is the CPython version string, `default_pyodide_version` is the Pyodide release to use when the user does not pin one explicitly (use the latest available alpha/beta for a prerelease entry), and `node_version` is the minimum Node.js major required by that Pyodide release — check the [pyodide-build FAQ](https://pyodide-build.readthedocs.io/en/latest/faq.html#what-node-js-version-do-i-need) for a rudimentary idea of what the correct value is. `sha256` is the checksum of the Pyodide xbuildenv tarball.
`version` is the CPython version string, `default_pyodide_version` is the
Pyodide release to use when the user does not pin one explicitly (use the latest
available alpha/beta for a prerelease entry), and `node_version` is the minimum
Node.js major required by that Pyodide release — check the
[pyodide-build FAQ](https://pyodide-build.readthedocs.io/en/latest/faq.html#what-node-js-version-do-i-need)
for a rudimentary idea of what the correct value is. `sha256` is the checksum of
the Pyodide xbuildenv tarball.
### 2. Update the prerelease guards in the selector
### 2. Generate and pin a constraints file
In `cibuildwheel/selector.py`, update the patterns in the `PyodidePrerelease` guards to match the new identifier:
```python
if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
build_id, "cp315-pyodide_*"
):
return False
```
### 3. Generate and pin a constraints file
Run the `update_constraints` `nox` session, which reads `build-platforms.toml` and regenerates all Pyodide constraints files automatically:
Run the `update_constraints` `nox` session, which reads `build-platforms.toml`
and regenerates all Pyodide constraints files automatically:
```bash
nox -s update_constraints
```
### 4. Update tests
### 3. Update tests
Update the unit tests so the new identifier is accepted by the selector with `PyodidePrerelease` enabled and rejected without it. Pyodide-specific integration tests may also need their hardcoded expected-wheel lists extended.
## When a Pyodide prerelease becomes stable
Pyodide uses a versioning scheme where the stable release for a given CPython version is named `[PythonMajorMinor].0.0`, so the first stable release shipping cp314 will be **`314.0.0`**. See [pyodide/pyodide#6084](https://github.com/pyodide/pyodide/issues/6084) for a rationale of this versioning scheme.
### 1. Update the stable entries, and remove (or replace) the prerelease entry
In `build-platforms.toml`, update the former prerelease entry's `default_pyodide_version` to the new stable release (e.g. `314.0.0`) and remove the prerelease marker from the identifier if present. Remove previous prerelease entries if they are now obsolete, or update them to the next prerelease if one is available. Move the previous stable version behind `pyodide-eol` rather than dropping it outright (see below).
### 2. Disable or update the prerelease guards
In `selector.py`:
- **If a new prerelease is available**: update the `fnmatch` pattern to the next identifier (e.g. `cp315-pyodide_*`) as described above.
- **If there is no new prerelease**: comment out the `PyodidePrerelease` logic.
### 3. Update the constraints file
Run `nox -s update_constraints` to regenerate the constraints file for the newly stable version. If the entry was already in `build-platforms.toml` as a prerelease, its constraints file already exists, and this step just refreshes it against the stable Pyodide release and updates the dependencies' versions.
### 4. Update tests
Update the unit tests so the newly stable identifier is accepted by the selector without needing `PyodidePrerelease` in the enable set. Pyodide-specific integration tests may also need their hardcoded expected-wheel lists extended.
Update the unit tests so the new identifier is accepted by the selector with
`CPythonPrerelease` enabled and rejected without it. Pyodide-specific
integration tests may also need their hardcoded expected-wheel lists extended.
## When an old Pyodide version is to be moved to end-of-life
When a Pyodide version is superseded by a new stable release, move it behind the `pyodide-eol` enable flag. We want to allow users who still build for older Pyodide ABIs time to upgrade.
When a Pyodide version is superseded by a new stable release, move it behind the
`pyodide-eol` enable flag. We want to allow users who still build for older
Pyodide ABIs time to upgrade.
### 1. Add the `pyodide-eol` guard in the selector
In `cibuildwheel/selector.py`, add (or update) the `PyodideEoL` guard to include the old identifier:
In `cibuildwheel/selector.py`, add (or update) the `PyodideEoL` guard to include
the old identifier:
```python
if EnableGroup.PyodideEoL not in self.enable and fnmatch(build_id, "cp312-pyodide_*"):
@@ -94,15 +81,23 @@ if EnableGroup.PyodideEoL not in self.enable and fnmatch(build_id, "cp312-pyodid
### 2. Update tests
Update the unit tests so the EoL identifier requires `PyodideEoL` to be included in the enable set. The default (no `CIBW_ENABLE`) should exclude it.
Update the unit tests so the EoL identifier requires `PyodideEoL` to be included
in the enable set. The default (no `CIBW_ENABLE`) should exclude it.
## When an old Pyodide version is to be fully retired
Retirement is not expected to happen on a routine basis. It is only warranted when the Pyodide ecosystem itself has evolved to the point where an older ABI version is considered obsolete for example, if the surrounding toolchain, packaging standards, or runtime infrastructure have moved on so substantially that building for the older version no longer makes practical sense. Any retirement is to be discussed and agreed upon by Pyodide maintainers before proceeding.
Retirement is not expected to happen on a routine basis. It is only warranted
when the Pyodide ecosystem itself has evolved to the point where an older ABI
version is considered obsolete for example, if the surrounding toolchain,
packaging standards, or runtime infrastructure have moved on so substantially
that building for the older version no longer makes practical sense. Any
retirement is to be discussed and agreed upon by Pyodide maintainers before
proceeding.
### 1. Remove the Python configuration
Delete the entry from `build-platforms.toml` and remove the `PyodideEoL` guard for that identifier in `selector.py`.
Delete the entry from `build-platforms.toml` and remove the `PyodideEoL` guard
for that identifier in `selector.py`.
### 2. Delete the constraints file
@@ -110,4 +105,5 @@ Remove `cibuildwheel/resources/constraints-pyodideXYZ.txt`.
### 3. Update tests
Remove references to the old identifier from the unit tests, integration tests, and drop any expected-wheel entries for it from the test helper.
Remove references to the old identifier from the unit tests, integration tests,
and drop any expected-wheel entries for it from the test helper.
+85 -10
View File
@@ -1,36 +1,111 @@
---
title: Changelog
ref: changelog
---
# Changelog
### v4.0.0rc1
### v4.2.0
_14 May 2026_
_4 August 2026_
- 🌟 CPython 3.15 wheels are now built by default - without the `"cpython-prerelease"` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) set. It's time to build and upload these wheels to PyPI! This release includes CPython 3.15.0rc1, which is guaranteed to be ABI compatible with the final release. (#2944)
- ✨ Adds Pyodide 3.15 support with the `cp315-pyodide_wasm32` build identifier, using Pyodide 315.0.0a2. These are also stable wrt. the final release. (#2958)
- 🐛 Retries a failed download six times with exponential backoff, so short network outages no longer stop a build. A `4xx` response is still reported at once. (#2953)
- 🐛 Accepts `default` as a [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) value on Pyodide, and accepts `pyodide-build` in the top-level table and in overrides (#2951)
- 🛠 Holds pip back on GraalPy, where newer pip breaks the build (#2955)
- 🛠 Updates Pyodide to 314.0.4 (#2949, #2952)
- 🛠 Updates dependencies and container pins (#2952, #2960)
- 💼 Updates CI action pins (#2948, #2954)
- 🧪 Uses pp311 for the abi3 test, and deletes `test_overridden_pip_constraint`, which is not necessary since #2583 (#2956, #2957)
### v4.1.1
_24 July 2026_
- ✨ Adds `pyodide-build` as a separate [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend), now the default frontend for Pyodide, with verbosity flags handling. Any other frontend is ignored with a warning on Pyodide. (#2609, #2945)
- 🔐 Uses digests instead of tags for pinned container images, strengthening supply-chain security. The human-readable tags remain as comments in `pinned_docker_images.cfg`. (#2915)
- 🐛 Fixes platform-specific [`test-runtime`](https://cibuildwheel.pypa.io/en/stable/options/#test-runtime) environment variables (e.g. `CIBW_TEST_RUNTIME_ANDROID`) not being honored (#2941)
- 🐛 Fixes quoting of [`test-requires`](https://cibuildwheel.pypa.io/en/stable/options/#test-requires) and [`audit-requires`](https://cibuildwheel.pypa.io/en/stable/options/#audit-requires) so PEP 508 specifiers containing spaces work (#2913)
- 🐛 Makes [`archs`](https://cibuildwheel.pypa.io/en/stable/options/#archs) parsing case-insensitive and platform-aware, so e.g. `arm64` works on Windows (#2920)
- 🐛 Uses an absolute path for the `{project}` placeholder in [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) (#2934)
- 🐛 Validates the [`pyodide-version`](https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version) option against the build identifier with a clear error (#2925)
- 🐛 Fixes PyPy installs on macOS after PyPy switched its downloads from `.tar.bz2` to `.tar.gz` (#2939)
- 🐛 Makes a matching `python3-config` available in the build and test venvs on macOS (#2922)
- 🛠 Updates dependencies and container pins (#2917, #2935, #2939)
- 🛠 Updates Android tests to current Python versions and the new test repository URL (#2933)
- 🛠 Drops the `orjson` dependency, no longer used by mypy 2+ (#2923)
- 📚 Builds the docs with properdocs, a MkDocs fork (#2946)
- 📚 Adds the missing `cp314-pyodide_wasm32` entry to the build identifier table (#2947)
- 📚 Removes outdated notes about the `pip wheel` build frontend and ClearLinux (#2926)
- 💼 Adds a "CI: PyPy EoL" PR label to run PyPy EoL tests on PRs (#2930)
- 💼 Updates CI action pins and pre-commit hooks (#2914, #2932, #2938, #2940, #2942, #2943)
### v4.1.0
_12 June 2026_
- ✨ Updates Pyodide to the final 314.0.0 release, so Pyodide 3.14 wheels now build by default without the `pyodide-prerelease` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag. (#2906)
- 🐛 Raises clear errors when a build produces no wheel, instead of failing later with a confusing message (#2909)
- 🛠 Speeds up CLI startup through lazy imports on Python 3.15 (#2797)
- 📚 Adds an FAQ section on caching cibuildwheel's downloaded tools with `CIBW_CACHE_PATH` (#2842)
- 📚 Documentation improvements: clarifies which shell is used for command options, clarifies environment variable precedence, and fixes a dead Pyodide env info link (#2904, #2905, #2911)
### v4.0.0
_7 June 2026_
See @henryiii's [release post](https://iscinumpy.dev/post/cibuildwheel-4-0-0/) for more info on new features!
- 🌟 Adds wheel auditing with `abi3audit` as a default after the repair step, with new [`audit-requires`](https://cibuildwheel.pypa.io/en/stable/options/#audit-requires) and [`audit-command`](https://cibuildwheel.pypa.io/en/stable/options/#audit-command) options (#2805)
- 🌟 Adds `pyemscripten` platform tag support (PEP 783), updates Pyodide to 314.0.0a1, and adds a `pyodide-eol` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag for building end-of-life Pyodide versions (#2812, #2848)
- 🌟 Adds `pyemscripten` platform tag support (PEP 783), updates Pyodide to 314.0.0a2, and adds a `pyodide-eol` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) flag for building end-of-life Pyodide versions (#2812, #2848)
- 🌟 Sets up `delvewheel` as the default [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) for Windows, so extension module DLLs are now bundled automatically. Skip by setting it to empty if not needed. (#2831)
- ✨ Adds CPython 3.15 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/stable/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.15.0b1. (#2833, #2850)
- ✨ Adds CPython 3.15 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/stable/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.15.0b2. (#2833, #2850)
_While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.14 will be available in cibuildwheel without the flag._ (#2390)
_While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.15 will be available in cibuildwheel without the flag._
- ✨ Adds CPython 3.15 support for iOS and Android (#2857, #2858)
- ✨ Adds Android improvements for building NumPy and related packages, including auditwheel support, pkg-config and Fortran configuration, and the [`xbuild-files`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-files) option (#2695)
- ✨ Adds `CIBUILDWHEEL_BUILD_IDENTIFIER` environment variable set to the current build identifier (e.g. `cp311-manylinux_x86_64`) during per-build steps (#2872)
- ✨ Adds `{project}` and `{package}` placeholders to [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) (#2827)
- ⚠️ Drops support for Python 3.8 (#2686)
- ⚠️ Removes the experimental CPython 3.13 free-threading builds and the `cpython-freethreading` [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) option. CPython 3.14+ free-threading support remains available without the enable flag. (#2684)
- ⚠️ Drops support for Cirrus CI, which is shutting down June 1, 2026 (#2817)
- ⚠️ Drops GraalPy 3.11 (gp311) support, as agreed in #2741, and removes GraalPy 24-only workarounds (#2895)
- 🔐 Adds SHA256 verification for direct downloads of Python interpreters, virtualenv, and python-build-standalone assets (#2873)
- 🔐 Adds tarfile extraction filter for safe archive extraction (#2856)
- 🐛 Fixes `UV_PYTHON` not being set for [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) on Linux when using `uv` as the [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) (#2830)
- 🐛 Fixes detection of musl libc when downloading python-build-standalone, which previously always selected the gnu asset on musl hosts like Alpine (#2889)
- 🐛 Fixes [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) expansion when `{project}` or `{package}` contains spaces or backslashes (#2886)
- 🐛 Prevents deadlock when `linux32` fails and forwards platform args to the sanity check (#2880, #2888)
- 🐛 Fixes container resource leaks on start failure and during teardown (#2879, #2887)
- 🐛 Removes potential partial cache-population in case of error (#2892)
- 🐛 Raises a clear error when `ANDROID_API_LEVEL` is not an integer (#2891)
- 🐛 Replaces assert with proper exception in python-build-standalone (#2859)
- 🐛 Uses ConfigurationError when `package_dir` is outside cwd instead of a generic Exception (#2898)
- 🛠 Updates dependencies and container pins (#2893, #2882, #2874, #2868, #2862, #2884, #2845, #2837, #2818, #2810, #2838, #2813)
- 🛠 Updates Android to Python 3.13.13 and 3.14.4 (#2821)
- 🛠 Applies Pyodide-specific patches to the Emscripten toolchain installation (#2800)
- 🛠 Updates dependencies and container pins (#2845, #2837, #2821, #2818, #2810, #2838, #2813)
- 🛠 Uses `python -V -V` for Windows build diagnostics (#2832)
- 🛠 Simplifies pinned container image lookup (#2897)
- 🛠 Minor fixups across error messages, OCI container, and options (#2860)
- 💼 Adds PEP 723 metadata for `bin/` scripts and drops the `bin` dependency group (#2819)
- 💼 Improves Azure test reliability with retries and caching (#2890)
- 💼 Fixes Windows GitLab CI test running (#2870)
- 💼 Updates CI action pins and dev dependencies (#2902, #2867, #2851, #2843, #2826, #2823, #2820, #2807)
- 💼 Adds agent and copilot setup files (#2861)
- 💼 Uses `if TYPE_CHECKING:` blocks (#2866, #2864)
- 🧪 Fixes Android tests using the `uv` frontend (#2809)
- 🧪 Fixes the update-dependencies workflow to use `uv` to run `nox` (#2808)
- 🧪 Adds unit tests for `OCIContainer._get_platform_args` (#2878)
- 📚 Updates documentation for delvewheel as the default Windows [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command), including the build diagram, schema defaults, and legal note (#2877, #2853, #2891)
- 📚 Documents platform-specific [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) configuration (#2834)
- 📚 Updates the "How it works" diagram with details of Android, iOS, and Pyodide builds (#2816)
- 📚 Adds Pyodide icon and regenerates working examples data for Android, iOS, and Pyodide (#2815, #2811)
- 📚 Adds intersphinx support for external documentation linking (#2871)
- 📚 Adds instructions for building CUDA wheels and fixes manylinux container references in FAQ (#2896, #2900)
- 📚 Links back to source in docs (#2806)
- 💼 Adds PEP 723 metadata for `bin/` scripts and drops the `bin` dependency group (#2819)
- 💼 Updates CI action pins and dev dependencies (#2851, #2843, #2826, #2823, #2820, #2807)
- 🧪 Fixes Android tests using the `uv` frontend (#2809)
- 🧪 Fixes the update-dependencies workflow to use `uv` to run `nox` (#2808)
- 📚 Removes outdated numpy info (#2855)
### v3.4.1
+1
View File
@@ -1,5 +1,6 @@
---
title: Configuring a CI service
ref: ci-services
---
## Configuring a CI service
+13 -6
View File
@@ -1,3 +1,8 @@
---
title: Configuration
ref: configuration
---
# Configuration methods
cibuildwheel can either be configured using environment variables, or from
@@ -58,11 +63,13 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
You can configure cibuildwheel with a config file, such as `pyproject.toml`.
Options have the same names as the environment variable overrides, but are
placed in `[tool.cibuildwheel]` and are lower case, with dashes, following
common [TOML](https://toml.io) practice. Anything placed in subsections `linux`, `windows`,
`macos`, or `pyodide` will only affect those platforms. Lists can be used
instead of strings for items that are naturally a list. Multiline strings also
work just like in the environment variables. Environment variables will take
precedence if defined.
common [TOML](https://toml.io) practice. Anything placed in subsections
named after a platform will only affect those platforms. Platform-specific
values replace the corresponding global value for that platform; table options
are not merged key by key. Lists can be used instead of strings for items that
are naturally a list. Multiline strings also work just like in the environment
variables. Environment variable overrides, such as `CIBW_TEST_COMMAND` and
`CIBW_TEST_COMMAND_LINUX`, will take precedence if defined.
The example above using environment variables could have been written like this:
@@ -173,7 +180,7 @@ on Python 3.11, and will have `environment = {FOO="BAZ", "PYTHON"="MONTY", "HAM"
In the TOML configuration, you can choose how tables and lists are inherited.
By default, all values are overridden completely (`"none"`) but sometimes you'd
rather `"append"` or `"prepend"` to an existing list or table. You can do this
with the `inherit` table in overrides. For example, if you want to add an environment
with the `inherit` table in overrides. For example, if you want to add an environment
variable for CPython 3.11, without `inherit` you'd have to repeat all the
original environment variables in the override. With `inherit`, it's just:
+2 -1
View File
@@ -1,5 +1,6 @@
---
title: Contributing
ref: contributing
---
# Contributing
@@ -26,7 +27,7 @@ Other notes:
### cibuildwheel's relationship with build errors
cibuildwheel doesn't really do anything itself - it's always deferring to other tools (pip, wheel, auditwheel, delocate, docker). Without cibuildwheel, the process is really fragmented. Different tools, across different OSs need to be stitched together in just the right way to make it work.
cibuildwheel doesn't really do anything itself - it's always deferring to other tools (pip, wheel, auditwheel, delocate, delvewheel, docker). Without cibuildwheel, the process is really fragmented. Different tools, across different OSs need to be stitched together in just the right way to make it work.
We're not responsible for errors in those tools, for fixing errors/crashes there. But cibuildwheel's job is providing users with an 'integrated' user experience across those tools. We provide an abstraction. The user says 'build me some wheels', not 'open the docker container, build a wheel with pip, fix up the symbols with auditwheel' etc. However, errors have a habit of breaking abstractions. And this is where users get confused, because the mechanism of cibuildwheel is laid bare, and they must understand a little bit how it works to debug.
+1
View File
@@ -1,5 +1,6 @@
---
title: Modern C++ standards
ref: cpp-standards
---
# Modern C++ standards
Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 101 KiB

+1
View File
@@ -1,5 +1,6 @@
---
title: Delivering to PyPI
ref: deliver-to-pypi
---
# Delivering to PyPI
+14 -3
View File
@@ -179,19 +179,30 @@
},
},
{
label: 'Repair wheel',
label: 'Repair using auditwheel',
href: 'options/#repair-wheel-command',
platforms: ['android'],
style: 'block',
tooltip: {
title: 'CIBW_REPAIR_WHEEL_COMMAND',
tag: 'Customisable step',
description: 'By default, bundles libc++ into the wheel if any shared library links against it, using patchelf. Can be overridden with a custom repair command.'
description: 'Bundle shared libraries by running auditwheel on each built wheel.'
},
},
{
label: 'Repair using delvewheel',
href: 'options/#repair-wheel-command',
platforms: ['windows'],
style: 'block',
tooltip: {
title: 'CIBW_REPAIR_WHEEL_COMMAND',
tag: 'Customisable step',
description: 'Bundle shared libraries by running delvewheel on each built wheel.'
},
},
{
href: 'options/#repair-wheel-command',
platforms: ['windows', 'ios', 'pyodide'],
platforms: ['ios', 'pyodide'],
style: 'dot',
tooltip: {
title: 'CIBW_REPAIR_WHEEL_COMMAND',
+104 -4
View File
@@ -1,5 +1,6 @@
---
title: Tips and tricks
ref: faq
---
# Tips and tricks
@@ -101,6 +102,51 @@ Meson generally works well with cibuildwheel, but there are a few things to be a
- If you need to build 32-bit Windows wheels, you need to activate a 32-bit compiler toolchain before starting cibuildwheel. Many users use [ilammy/msvc-dev-cmd](https://github.com/ilammy/msvc-dev-cmd) for this purpose.
### Caching cibuildwheel's downloaded tools {: #caching}
To speed up builds, cibuildwheel caches the tools it downloads — CPython/PyPy installers, [`virtualenv`][virtualenv], [python-build-standalone][pbs] archives used on Android/iOS, etc. The active cache folder is printed in the preamble of every run:
```
Cache folder: /Users/Matt/Library/Caches/cibuildwheel
```
By default it lives under the OS user-cache directory:
| Platform | Default cache folder |
| ------------ | --------------------------------------------- |
| Linux | `~/.cache/cibuildwheel` |
| macOS / iOS | `~/Library/Caches/cibuildwheel` |
| Windows | `%LOCALAPPDATA%\pypa\cibuildwheel\Cache` |
Set the `CIBW_CACHE_PATH` environment variable to point cibuildwheel at a different folder. On CI you'll typically want a workflow-defined path so that the runner's cache action can persist it between runs.
#### Persisting the cache on GitHub Actions
```yaml
- uses: actions/cache@v5
with:
path: ${{ runner.temp }}/cibw-cache
key: cibw-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
cibw-${{ runner.os }}-
- uses: pypa/cibuildwheel@v3.4.1
env:
CIBW_CACHE_PATH: ${{ runner.temp }}/cibw-cache
```
The `restore-keys` fallback lets a slightly stale cache still be reused if `pyproject.toml` changes. Adjust the cache key to whatever set of inputs determines what cibuildwheel will download (e.g. include a hash of `pyproject.toml`'s `[tool.cibuildwheel]` section, or pin on a Python build-tools version).
For platform-specific notes (e.g. caching the official python.org installers on macOS, or NuGet CPython downloads on Windows), see the [platforms documentation](platforms.md).
If the cache becomes stale or corrupt, run `cibuildwheel --clean-cache` (or simply delete the folder) before re-running.
!!! warning "Cache poisoning security risk"
Use of caching in a release pipeline means the cache folder is now a possible security risk - an attacker could [poison the cache](https://hivesecurity.gitlab.io/blog/github-actions-cache-poisoning-supply-chain/) with executables they have compromised. If you use this for release builds, consider who has access to modify the cache. Specifically be careful if your repo has any workflows using `pull_request_target`, even if they appear unrelated.
[virtualenv]: https://virtualenv.pypa.io/
[pbs]: https://gregoryszorc.com/docs/python-build-standalone/main/
### Automatic updates using Dependabot {: #automatic-updates}
Selecting a moving target (like the latest release) is generally a bad idea in CI. If something breaks, you can't tell whether it was your code or an upstream update that caused the breakage, and in a worst-case scenario, it could occur during a release.
@@ -112,7 +158,7 @@ There are two suggested methods for keeping cibuildwheel up to date that instead
If you use GitHub Actions for builds, you can use cibuildwheel as an action:
```yaml
uses: pypa/cibuildwheel@v4.0.0rc1
uses: pypa/cibuildwheel@v4.2.0
```
This is a composite step that just runs cibuildwheel using pipx. You can set command-line options as `with:` parameters, and use `env:` as normal.
@@ -137,7 +183,7 @@ The second option, and the only one that supports other CI systems, is using a `
```bash
# requirements-cibw.txt
cibuildwheel==4.0.0rc1
cibuildwheel==4.2.0
```
Then your install step would have `python -m pip install -r requirements-cibw.txt` in it. Your `.github/dependabot.yml` file could look like this:
@@ -220,6 +266,60 @@ Your build might need some compiler flags to be set through environment variable
Consider incorporating these into your package, for example, in `setup.py` using [`extra_compile_args` or
`extra_link_args`](https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#setuptools.Extension).
### Building wheels with CUDA on Linux
On Linux, you can build binary wheels with CUDA to take advantage of NVIDIA GPUs for hardware acceleration.
Specify the custom Docker containers with CUDA Toolkit as follows:
```yaml
CIBW_MANYLINUX_X86_64_IMAGE: >-
quay.io/manylinux_cuda/manylinux_2_28_x86_64_cuda13_1:latest
CIBW_MANYLINUX_AARCH64_IMAGE: >-
quay.io/manylinux_cuda/manylinux_2_28_aarch64_cuda13_1:latest
```
Currently, we support the following CUDA manylinux containers:
* `quay.io/manylinux_cuda/manylinux_2_28_x86_64_cuda12_9:latest`
* `quay.io/manylinux_cuda/manylinux_2_28_aarch64_cuda12_9:latest`
* `quay.io/manylinux_cuda/manylinux_2_28_x86_64_cuda13_1:latest`
* `quay.io/manylinux_cuda/manylinux_2_28_aarch64_cuda13_1:latest`
* `quay.io/manylinux_cuda/manylinux_2_34_x86_64_cuda12_9:latest`
* `quay.io/manylinux_cuda/manylinux_2_34_aarch64_cuda12_9:latest`
* `quay.io/manylinux_cuda/manylinux_2_34_x86_64_cuda13_1:latest`
* `quay.io/manylinux_cuda/manylinux_2_34_aarch64_cuda13_1:latest`
A typical GitHub Actions workflow will look like this:
```yaml
jobs:
build-wheels:
name: Build wheels
runs-on: ${{ matrix.target.runner }}
strategy:
matrix:
manylinux-base: [manylinux_2_28, manylinux_2_34]
cuda-version: [12_9, 13_1]
target:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@v3
env:
CIBW_MANYLINUX_X86_64_IMAGE: >-
quay.io/manylinux_cuda/${{ matrix.manylinux-base }}_x86_64_cuda${{ matrix.cuda-version }}:latest
CIBW_MANYLINUX_AARCH64_IMAGE: >-
quay.io/manylinux_cuda/${{ matrix.manylinux-base }}_aarch64_cuda${{ matrix.cuda-version }}:latest
CIBW_BUILD: cp312-manylinux_${{ matrix.target.arch }}
```
## Troubleshooting
If your wheel didn't compile, you might have a mistake in your config.
@@ -234,7 +334,7 @@ Sometimes a build will fail due to a missing dependency.
**If you need a build tool** (e.g. cmake, automake, ninja), you can install it through a package manager like apt/yum, brew or choco, using the [`before-all`](options.md#before-all) option.
**If your build is linking into a native library dependency**, you can build/install that in [`before-all`](options.md#before-all). However, on Linux, Mac (and Windows if you're using [delvewheel]), the library that you install will be bundled into the wheel in the [repair step]. So take care to ensure that
**If your build is linking into a native library dependency**, you can build/install that in [`before-all`](options.md#before-all). However, on Linux, Mac, and Windows (which uses [delvewheel] by default since cibuildwheel 4.0), the library that you install will be bundled into the wheel in the [repair step]. So take care to ensure that
- the bundled library doesn't accidentally increase the minimum system requirements (such as the minimum macOS version)
- the bundled library matches the architecture of the wheel you're building when cross-compiling
@@ -302,7 +402,7 @@ Solutions to this vary, but the simplest is to use pipx:
# most runners have pipx preinstalled, but in case you don't
python3 -m pip install pipx
pipx run cibuildwheel==4.0.0rc1 --output-dir wheelhouse
pipx run cibuildwheel==4.2.0 --output-dir wheelhouse
pipx run twine upload wheelhouse/*.whl
```
+1
View File
@@ -1,5 +1,6 @@
---
title: Home
ref: index
---
# cibuildwheel
+91 -35
View File
@@ -1,3 +1,8 @@
---
title: Options
ref: options
---
# Options
<div class="options-toc"></div>
@@ -59,12 +64,11 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
| Python 3.11 | cp311-macosx_x86_64<br/>cp311-macosx_universal2<br/>cp311-macosx_arm64 | cp311-win_amd64<br/>cp311-win32<br/>cp311-win_arm64 | cp311-manylinux_x86_64<br/>cp311-manylinux_i686<br/>cp311-musllinux_x86_64<br/>cp311-musllinux_i686 | cp311-manylinux_aarch64<br/>cp311-manylinux_ppc64le<br/>cp311-manylinux_s390x<br/>cp311-manylinux_armv7l<br/>cp311-manylinux_riscv64<br/>cp311-musllinux_aarch64<br/>cp311-musllinux_ppc64le<br/>cp311-musllinux_s390x<br/>cp311-musllinux_armv7l<br/>cp311-musllinux_riscv64 | | | |
| Python 3.12 | cp312-macosx_x86_64<br/>cp312-macosx_universal2<br/>cp312-macosx_arm64 | cp312-win_amd64<br/>cp312-win32<br/>cp312-win_arm64 | cp312-manylinux_x86_64<br/>cp312-manylinux_i686<br/>cp312-musllinux_x86_64<br/>cp312-musllinux_i686 | cp312-manylinux_aarch64<br/>cp312-manylinux_ppc64le<br/>cp312-manylinux_s390x<br/>cp312-manylinux_armv7l<br/>cp312-manylinux_riscv64<br/>cp312-musllinux_aarch64<br/>cp312-musllinux_ppc64le<br/>cp312-musllinux_s390x<br/>cp312-musllinux_armv7l<br/>cp312-musllinux_riscv64 | | | cp312-pyodide_wasm32 |
| Python 3.13 | cp313-macosx_x86_64<br/>cp313-macosx_universal2<br/>cp313-macosx_arm64 | cp313-win_amd64<br/>cp313-win32<br/>cp313-win_arm64 | cp313-manylinux_x86_64<br/>cp313-manylinux_i686<br/>cp313-musllinux_x86_64<br/>cp313-musllinux_i686 | cp313-manylinux_aarch64<br/>cp313-manylinux_ppc64le<br/>cp313-manylinux_s390x<br/>cp313-manylinux_armv7l<br/>cp313-manylinux_riscv64<br/>cp313-musllinux_aarch64<br/>cp313-musllinux_ppc64le<br/>cp313-musllinux_s390x<br/>cp313-musllinux_armv7l<br/>cp313-musllinux_riscv64 | cp313-android_arm64_v8a<br/>cp313-android_x86_64 | cp313-ios_arm64_iphoneos<br/>cp313-ios_arm64_iphonesimulator<br/>cp313-ios_x86_64_iphonesimulator | cp313-pyodide_wasm32 |
| Python 3.14 | cp314-macosx_x86_64<br/>cp314-macosx_universal2<br/>cp314-macosx_arm64<br><br>cp314t-macosx_x86_64<br/>cp314t-macosx_universal2<br/>cp314t-macosx_arm64 | cp314-win_amd64<br/>cp314-win32<br/>cp314-win_arm64<br><br>cp314t-win_amd64<br/>cp314t-win32<br/>cp314t-win_arm64 | cp314-manylinux_x86_64<br/>cp314-manylinux_i686<br/>cp314-musllinux_x86_64<br/>cp314-musllinux_i686<br><br>cp314t-manylinux_x86_64<br/>cp314t-manylinux_i686<br/>cp314t-musllinux_x86_64<br/>cp314t-musllinux_i686 | cp314-manylinux_aarch64<br/>cp314-manylinux_ppc64le<br/>cp314-manylinux_s390x<br/>cp314-manylinux_armv7l<br/>cp314-manylinux_riscv64<br/>cp314-musllinux_aarch64<br/>cp314-musllinux_ppc64le<br/>cp314-musllinux_s390x<br/>cp314-musllinux_armv7l<br/>cp314-musllinux_riscv64<br><br>cp314t-manylinux_aarch64<br/>cp314t-manylinux_ppc64le<br/>cp314t-manylinux_s390x<br/>cp314t-manylinux_armv7l<br/>cp314t-manylinux_riscv64<br/>cp314t-musllinux_aarch64<br/>cp314t-musllinux_ppc64le<br/>cp314t-musllinux_s390x<br/>cp314t-musllinux_armv7l<br/>cp314t-musllinux_riscv64 | cp314-android_arm64_v8a<br/>cp314-android_x86_64 | cp314-ios_arm64_iphoneos<br/>cp314-ios_arm64_iphonesimulator<br/>cp314-ios_x86_64_iphonesimulator | |
| Python 3.15 | cp315-macosx_x86_64<br/>cp315-macosx_universal2<br/>cp315-macosx_arm64<br><br>cp315t-macosx_x86_64<br/>cp315t-macosx_universal2<br/>cp315t-macosx_arm64 | cp315-win_amd64<br/>cp315-win32<br/>cp315-win_arm64<br><br>cp315t-win_amd64<br/>cp315t-win32<br/>cp315t-win_arm64 | cp315-manylinux_x86_64<br/>cp315-manylinux_i686<br/>cp315-musllinux_x86_64<br/>cp315-musllinux_i686<br><br>cp315t-manylinux_x86_64<br/>cp315t-manylinux_i686<br/>cp315t-musllinux_x86_64<br/>cp315t-musllinux_i686 | cp315-manylinux_aarch64<br/>cp315-manylinux_ppc64le<br/>cp315-manylinux_s390x<br/>cp315-manylinux_armv7l<br/>cp315-manylinux_riscv64<br/>cp315-musllinux_aarch64<br/>cp315-musllinux_ppc64le<br/>cp315-musllinux_s390x<br/>cp315-musllinux_armv7l<br/>cp315-musllinux_riscv64<br><br>cp315t-manylinux_aarch64<br/>cp315t-manylinux_ppc64le<br/>cp315t-manylinux_s390x<br/>cp315t-manylinux_armv7l<br/>cp315t-manylinux_riscv64<br/>cp315t-musllinux_aarch64<br/>cp315t-musllinux_ppc64le<br/>cp315t-musllinux_s390x<br/>cp315t-musllinux_armv7l<br/>cp315t-musllinux_riscv64 | cp315-android_arm64_v8a<br/>cp315-android_x86_64 | cp315-ios_arm64_iphoneos<br/>cp315-ios_arm64_iphonesimulator<br/>cp315-ios_x86_64_iphonesimulator | |
| Python 3.14 | cp314-macosx_x86_64<br/>cp314-macosx_universal2<br/>cp314-macosx_arm64<br><br>cp314t-macosx_x86_64<br/>cp314t-macosx_universal2<br/>cp314t-macosx_arm64 | cp314-win_amd64<br/>cp314-win32<br/>cp314-win_arm64<br><br>cp314t-win_amd64<br/>cp314t-win32<br/>cp314t-win_arm64 | cp314-manylinux_x86_64<br/>cp314-manylinux_i686<br/>cp314-musllinux_x86_64<br/>cp314-musllinux_i686<br><br>cp314t-manylinux_x86_64<br/>cp314t-manylinux_i686<br/>cp314t-musllinux_x86_64<br/>cp314t-musllinux_i686 | cp314-manylinux_aarch64<br/>cp314-manylinux_ppc64le<br/>cp314-manylinux_s390x<br/>cp314-manylinux_armv7l<br/>cp314-manylinux_riscv64<br/>cp314-musllinux_aarch64<br/>cp314-musllinux_ppc64le<br/>cp314-musllinux_s390x<br/>cp314-musllinux_armv7l<br/>cp314-musllinux_riscv64<br><br>cp314t-manylinux_aarch64<br/>cp314t-manylinux_ppc64le<br/>cp314t-manylinux_s390x<br/>cp314t-manylinux_armv7l<br/>cp314t-manylinux_riscv64<br/>cp314t-musllinux_aarch64<br/>cp314t-musllinux_ppc64le<br/>cp314t-musllinux_s390x<br/>cp314t-musllinux_armv7l<br/>cp314t-musllinux_riscv64 | cp314-android_arm64_v8a<br/>cp314-android_x86_64 | cp314-ios_arm64_iphoneos<br/>cp314-ios_arm64_iphonesimulator<br/>cp314-ios_x86_64_iphonesimulator | cp314-pyodide_wasm32 |
| Python 3.15 | cp315-macosx_x86_64<br/>cp315-macosx_universal2<br/>cp315-macosx_arm64<br><br>cp315t-macosx_x86_64<br/>cp315t-macosx_universal2<br/>cp315t-macosx_arm64 | cp315-win_amd64<br/>cp315-win32<br/>cp315-win_arm64<br><br>cp315t-win_amd64<br/>cp315t-win32<br/>cp315t-win_arm64 | cp315-manylinux_x86_64<br/>cp315-manylinux_i686<br/>cp315-musllinux_x86_64<br/>cp315-musllinux_i686<br><br>cp315t-manylinux_x86_64<br/>cp315t-manylinux_i686<br/>cp315t-musllinux_x86_64<br/>cp315t-musllinux_i686 | cp315-manylinux_aarch64<br/>cp315-manylinux_ppc64le<br/>cp315-manylinux_s390x<br/>cp315-manylinux_armv7l<br/>cp315-manylinux_riscv64<br/>cp315-musllinux_aarch64<br/>cp315-musllinux_ppc64le<br/>cp315-musllinux_s390x<br/>cp315-musllinux_armv7l<br/>cp315-musllinux_riscv64<br><br>cp315t-manylinux_aarch64<br/>cp315t-manylinux_ppc64le<br/>cp315t-manylinux_s390x<br/>cp315t-manylinux_armv7l<br/>cp315t-manylinux_riscv64<br/>cp315t-musllinux_aarch64<br/>cp315t-musllinux_ppc64le<br/>cp315t-musllinux_s390x<br/>cp315t-musllinux_armv7l<br/>cp315t-musllinux_riscv64 | cp315-android_arm64_v8a<br/>cp315-android_x86_64 | cp315-ios_arm64_iphoneos<br/>cp315-ios_arm64_iphonesimulator<br/>cp315-ios_x86_64_iphonesimulator | cp315-pyodide_wasm32 |
| PyPy3.9 v7.3 | pp39-macosx_x86_64<br/>pp39-macosx_arm64 | pp39-win_amd64 | pp39-manylinux_x86_64<br/>pp39-manylinux_i686 | pp39-manylinux_aarch64 | | | |
| PyPy3.10 v7.3 | pp310-macosx_x86_64<br/>pp310-macosx_arm64 | pp310-win_amd64 | pp310-manylinux_x86_64<br/>pp310-manylinux_i686 | pp310-manylinux_aarch64 | | | |
| PyPy3.11 v7.3 | pp311-macosx_x86_64<br/>pp311-macosx_arm64 | pp311-win_amd64 | pp311-manylinux_x86_64<br/>pp311-manylinux_i686 | pp311-manylinux_aarch64 | | | |
| GraalPy 3.11 v24.2 | gp311_242-macosx_x86_64<br/>gp311_242-macosx_arm64 | gp311_242-win_amd64 | gp311_242-manylinux_x86_64 | gp311_242-manylinux_aarch64 | | |
| GraalPy 3.12 v25.0 | gp312_250-macosx_x86_64<br/>gp312_250-macosx_arm64 | gp312_250-win_amd64 | gp312_250-manylinux_x86_64 | gp312_250-manylinux_aarch64 | | |
The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to cibuildwheel.
@@ -353,13 +357,11 @@ values are:
- `cpython-prerelease`: Enables beta versions of Pythons if any are available
(May-July, approximately).
(May-July, approximately). This also covers Pyodide versions built against a
beta CPython, which is the case for the current Pyodide prerelease.
- `pypy`: Enable PyPy.
- `pypy-eol`: Enable PyPy versions that have passed end of life (if still available).
- `graalpy`: Enable GraalPy.
- `pyodide-prerelease`: Pyodide versions that haven't released yet, if one is
available. Safe if you are shipping a site with an early build, not for
general distribution.
- `pyodide-eol`: Enable Pyodide versions that are no longer the current stable
release (if still available).
- `all`: Enable all of the above.
@@ -477,7 +479,11 @@ files (from workspaces) are not supported.
are building GraalPy wheels, use `build` or `pip` as the build frontend
instead of `build[uv]` or `uv`.
On Android and Pyodide, the "pip" frontend is not supported.
On Android, the "pip" frontend is not supported.
On Pyodide, `pyodide-build` is the default and only supported frontend; setting
another frontend produces a warning and uses `pyodide-build` instead. See
[Pyodide build frontend support](platforms.md#pyodide-build-frontend) for details.
You can specify extra arguments to pass to the build frontend using the
optional `args` option.
@@ -589,6 +595,12 @@ You must use this variable to pass variables to Linux builds, since they execute
You can use `$PATH` syntax to insert other variables, or the `$(pwd)` syntax to insert the output of other shell commands.
Variables are evaluated in the order they appear. Any variable referenced before it is set will evaluate to an empty string.
The environment seen by the build and test steps starts with the build
environment. On Linux, this is the container environment, plus any variables
passed through with [`environment-pass`](#environment-pass). On other platforms,
the host environment is already available. Assignments in `environment` are
evaluated after that base environment and replace any duplicate variable names.
To specify more than one environment variable, separate the assignments by spaces.
Platform-specific environment variables are also available:<br/>
@@ -669,6 +681,9 @@ Platform-specific environment variables are also available:<br/>
!!! note
cibuildwheel always defines the environment variable `CIBUILDWHEEL=1`. This can be useful for [building wheels with optional extensions](faq.md#optional-extensions).
!!! note
For each per-build step (`before_build`, the build itself, `repair_command`, `before_test`, `test_command`), cibuildwheel also sets `CIBUILDWHEEL_BUILD_IDENTIFIER` to the current build identifier (e.g. `cp311-manylinux_x86_64`). This can be used in scripts to distinguish different builds.
!!! note
To do its work, cibuildwheel sets the variables `VIRTUALENV_PIP`, `DIST_EXTRA_CONFIG`, `SETUPTOOLS_EXT_SUFFIX`, `PIP_DISABLE_PIP_VERSION_CHECK`, `PIP_ROOT_USER_ACTION`, and it extends the variables `PATH` and `PIP_CONSTRAINT`. Your assignments to these options might be replaced or extended.
@@ -721,6 +736,17 @@ The placeholder `{package}` can be used here; it will be replaced by the path to
On Windows and macOS, the version of Python available inside `before-all` is whatever is available on the host machine. On Linux, a modern Python version is available on PATH.
!!! note "Shell selection"
Shell command options such as `before-all`, `before-build`,
`repair-wheel-command`, and `before-test` are executed by a platform shell.
Linux builds run inside the build container and invoke the container's `sh -c`.
On macOS and Windows, cibuildwheel calls Python's
`subprocess.run(..., shell=True)`, which normally means `/bin/sh` on macOS
and `cmd.exe` on Windows. If you need a specific interpreter, invoke it
explicitly, for example `python scripts/prepare.py` or
`bash scripts/prepare.sh`.
This option has special behavior in the overrides section in `pyproject.toml`.
On linux, overriding it triggers a new container launch. It cannot be overridden
on macOS and Windows.
@@ -783,9 +809,9 @@ instead.
### `before-build` {: #before-build env-var toml}
> Execute a shell command preparing each wheel's build
A shell command to run before building the wheel. This option allows you to run a command in **each** Python environment before the `pip wheel` command. This is useful if you need to set up some dependency so it's available during the build.
A shell command to run before building the wheel. This option allows you to run a command in **each** Python environment before the wheel is built. This is useful if you need to set up some dependency so it's available during the build.
If dependencies are required to build your wheel (for example if you include a header from a Python module), instead of using this command, we recommend adding requirements to a `pyproject.toml` file's `build-system.requires` array instead. This is reproducible, and users who do not get your wheels (such as Alpine or ClearLinux users) will still benefit.
If dependencies are required to build your wheel (for example if you include a header from a Python module), instead of using this command, we recommend adding requirements to a `pyproject.toml` file's `build-system.requires` array instead. This is reproducible, and users who do not get your wheels (such as BSD operating system variants) will still benefit.
The active Python binary can be accessed using `python`, and pip with `pip`; cibuildwheel makes sure the right version of Python and pip will be executed. The placeholder `{package}` can be used here; it will be replaced by the path to the package being built by cibuildwheel.
@@ -916,15 +942,44 @@ Platform-specific environment variables are also available on platforms that use
```
### `xbuild-files` {: #xbuild-files env-var toml}
> Platform-specific files in the build environment
When cross-compiling a package for Android, any dependencies in its [`build-system.requires`](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) are installed for the build platform. However, some dependencies contain platform-specific files such as headers and static libraries, which must correspond to the target platform.
This option maps a [normalized](https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization) package name to a list of paths within that package. If the package is present in the build environment, then a matching version will be downloaded for the target platform, and used to overwrite the given paths within the build environment.
The default value of this option includes [paths from popular packages](configuration.md#configuration-file).
Platform-specific environment variables are also available:<br/>
`CIBW_XBUILD_FILES_ANDROID`
#### Examples
!!! tab examples "pyproject.toml"
```toml
[tool.cibuildwheel.xbuild-files]
package1 = ["some/header.h", "some/library.a"]
package2 = ["other/header.h"]
```
!!! tab examples "Environment variables"
```yaml
CIBW_XBUILD_FILES: "package1: some/header.h some/library.a; package2: other/header.h"
```
### `repair-wheel-command` {: #repair-wheel-command env-var toml}
> Execute a shell command to repair each built wheel
Default:
- on Linux: `'auditwheel repair -w {dest_dir} {wheel}'`
- on Windows: `'delvewheel repair -w {dest_dir} -v {wheel}'`
- on macOS: `'delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}'`
- on Android: There is no default command, but cibuildwheel will add `libc++` to the
wheel if anything links against it. Setting a command will replace this behavior.
- on Android: `'auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}'`
- on Pyodide: You can use `pyodide auditwheel repair --libdir /path/to/libraries --output-dir {dest_dir} {wheel}` command to repair the wheel.
Unlike other platforms, this command is not set by default as you need to explicitly
specify the library directory. You might not want to use the libraries in the system
@@ -934,11 +989,15 @@ Default:
A shell command to repair a built wheel by copying external library dependencies into the wheel tree and relinking them.
The command is run on each built wheel (except for pure Python ones) before testing it.
!!! note
Since cibuildwheel 4.0, `delvewheel` is the default `repair-wheel-command` on Windows, so extension-module DLLs are bundled automatically. If a wheel has a platform tag but contains no extension module (for example, a package that sets a platform tag but ships a pre-built DLL itself), `delvewheel` may error. In that case, set `repair-wheel-command = ""` to skip the repair step.
The following placeholders must be used inside the command and will be replaced by cibuildwheel:
- `{wheel}` for the absolute path to the built wheel
- `{dest_dir}` for the absolute path of the directory where to create the repaired wheel
- `{delocate_archs}` (macOS only) comma-separated list of architectures in the wheel.
- `{ldpaths}` (Android only) colon-separated list of directories to search for external libraries, set by cibuildwheel to include any necessary locations in the NDK. You can add more directories by appending them with a colon separator after the placeholder, or by setting the `AUDITWHEEL_LD_LIBRARY_PATH` environment variable.
You can use the `{package}` or `{project}` placeholders in your `repair-wheel-command` to refer to the package being built or the project root, respectively.
@@ -947,24 +1006,14 @@ The command is run in a shell, so you can run multiple commands like `cmd1 && cm
Platform-specific environment variables are also available:<br/>
`CIBW_REPAIR_WHEEL_COMMAND_MACOS` | `CIBW_REPAIR_WHEEL_COMMAND_WINDOWS` | `CIBW_REPAIR_WHEEL_COMMAND_LINUX` | `CIBW_REPAIR_WHEEL_COMMAND_ANDROID` | `CIBW_REPAIR_WHEEL_COMMAND_IOS` | `CIBW_REPAIR_WHEEL_COMMAND_PYODIDE`
!!! tip
cibuildwheel doesn't yet ship a default repair command for Windows.
**If that's an issue for you, check out [delvewheel]** - a new package that aims to do the same as auditwheel or delocate for Windows.
Because delvewheel is still relatively early-stage, cibuildwheel does not yet run it by default. However, we'd recommend giving it a try! See the examples below for usage.
[Delvewheel]: https://github.com/adang1345/delvewheel
#### Examples
!!! tab examples "pyproject.toml"
```toml
# Use delvewheel on windows
# Don't repair Windows wheels
[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
repair-wheel-command = ""
# Don't repair macOS wheels
[tool.cibuildwheel.macos]
@@ -992,9 +1041,8 @@ Platform-specific environment variables are also available:<br/>
!!! tab examples "Environment variables"
```yaml
# Use delvewheel on windows
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
# Don't repair Windows wheels
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
# Don't repair macOS wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
@@ -1624,6 +1672,10 @@ Platform-specific environment variables are also available:<br/>
# Install specific versions of test dependencies
[tool.cibuildwheel]
test-requires = ["pytest==8.2.2", "packaging==24.1"]
# Dependency specifiers with environment markers are supported
[tool.cibuildwheel]
test-requires = ["pytest", "pyzstd; python_version >= '3.14'"]
```
In configuration files, you can use an array, and the items will be joined with a space.
@@ -1636,6 +1688,10 @@ Platform-specific environment variables are also available:<br/>
# Install specific versions of test dependencies
CIBW_TEST_REQUIRES: pytest==8.2.2 packaging==24.1
# Use shell-style quoting around specifiers containing spaces, such as
# those with environment markers
CIBW_TEST_REQUIRES: "pytest 'pyzstd; python_version >= \"3.14\"'"
```
@@ -1856,14 +1912,14 @@ will not produce more logging about the build itself. Other levels only affect
the build frontend output, which is usually things like resolving and
downloading dependencies. The settings are:
| | build | pip | uv | desc |
|-------------|-------|--------|-------|----------------------------------------|
| -2 | `-qq` | `-qq` | `-qq` | even more quiet, where supported |
| -1 | `-q` | `-q` | `-q` | quiet mode, where supported |
| 0 (default) | | | | default for build tool |
| 1 | | `-v` | | print backend output |
| 2 | `-v` | `-vv` | `-v` | print log messages e.g. resolving info |
| 3 | `-vv` | `-vvv` | `-vv` | print even more debug info |
| | build | pip | uv | pyodide-build | desc |
|-------------|-------|--------|-------|---------------|----------------------------------------|
| -2 | `-qq` | `-qq` | `-qq` | | even more quiet, where supported |
| -1 | `-q` | `-q` | `-q` | | quiet mode, where supported |
| 0 (default) | | | | | default for build tool |
| 1 | | `-v` | | `-v` | print backend output |
| 2 | `-v` | `-vv` | `-v` | `-vv` | print log messages e.g. resolving info |
| 3 | `-vv` | `-vvv` | `-vv` | | print even more debug info |
Settings that are not supported for a specific frontend will log a warning.
The default build frontend is `build`, which does show build backend output by
+10 -8
View File
@@ -1,5 +1,6 @@
---
title: Platforms
ref: platforms
---
# Platforms
@@ -168,7 +169,7 @@ You must target pyodide with `--platform pyodide` (or use `--only` on the identi
### Choosing a Pyodide version {: #pyodide-choosing-a-version}
It is also possible to target a specific Pyodide version by setting the [`pyodide-version`](options.md#pyodide-version) option to the desired version. Users are responsible for setting an appropriate Pyodide version according to the `pyodide-build` version. A list is available in Pyodide's [cross-build environments metadata file](https://github.com/pyodide/pyodide/blob/main/pyodide-cross-build-environments.json), which can be viewed more easily by installing `pyodide-build` from PyPI and using `pyodide xbuildenv search --all` to see a compatibility table.
It is also possible to target a specific Pyodide version by setting the [`pyodide-version`](options.md#pyodide-version) option to the desired version. Users are responsible for setting an appropriate Pyodide version according to the `pyodide-build` version. A list is available in Pyodide's [cross-build environments metadata file](https://pyodide.github.io/pyodide/api/v2/pyodide-cross-build-environments.json), which can be viewed more easily by installing `pyodide-build` from PyPI and using `pyodide xbuildenv search --all` to see a compatibility table.
If there are pre-releases available for a newer Pyodide version, the `pyodide-prerelease` [`enable`](options.md#enable) can be used to include pre-release versions. To build for older Pyodide versions that are no longer the current stable, use the `pyodide-eol` [`enable`](options.md#enable).
@@ -187,6 +188,11 @@ repair-wheel-command = "pyodide auditwheel repair --libdir /path/to/libraries --
The `--libdir` option specifies the directory containing cross-compiled shared libraries for WASM. You should not use the system library directories (e.g. `/usr/lib`), as those libraries are not built for WebAssembly.
### Build frontend support {: #pyodide-build-frontend}
The pyodide platform builds wheels by shelling out to `pyodide build`, via the `pyodide-build` [`build-frontend`](options.md#build-frontend), which itself is a meta build frontend and passes through commands to pypa/build with specialised handling. This is the only supported frontend for this platform, and is used by default. A global [`build-frontend`](options.md#build-frontend) setting naming another frontend is ignored with a warning on this platform.
[`build-verbosity`](options.md#build-verbosity) is passed through to `pyodide build` as `-v`/`-vv`. It is capped at `-vv`. `pyodide build` has no `-vvv` flag.
## Android {: android}
@@ -219,13 +225,9 @@ It also requires the following commands to be on the `PATH`:
Android builds will honor the `ANDROID_API_LEVEL` environment variable to set the
minimum supported [API level](https://developer.android.com/tools/releases/platforms)
for generated wheels. This will default to the minimum API level of the selected Python
version.
If the [`repair-wheel-command`](options.md#repair-wheel-command) adds any libraries to
the wheel, then `ANDROID_API_LEVEL` must be at least 24. This is already the default
when building for Python 3.14 and later, but you may need to set it when building for
Python 3.13.
for generated wheels. This defaults to 24, which is supported by [99% of active
devices](https://dl.google.com/android/studio/metadata/distributions.json), and is the first
version to support RUNPATH, which auditwheel needs in order to graft external libraries.
### Build frontend support
+1
View File
@@ -1,5 +1,6 @@
---
title: 'Getting started'
ref: setup
---
# Getting started
+19 -18
View File
@@ -1,5 +1,6 @@
---
title: Working examples
ref: working-examples
---
<!-- START bin/projects.py -->
@@ -10,8 +11,8 @@ title: Working examples
|-----------------------------------|----|----|:------|
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an analytical in-process SQL database management system |
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The fundamental package for scientific computing with Python. |
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | The venerable Matplotlib, a Python library with C++ portions |
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
@@ -47,9 +48,9 @@ title: Working examples
| [Implicit][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes GPU support for linux wheels |
| [vispy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Main repository for Vispy |
| [coverage.py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The coverage tool for Python |
| [Line Profiler][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Line-by-line profiling for Python |
| [PyCryptodome][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A self-contained cryptographic library for Python |
| [PyAV][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Pythonic bindings for FFmpeg's libraries. |
| [PyCryptodome][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A self-contained cryptographic library for Python |
| [Line Profiler][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Line-by-line profiling for Python |
| [PyYAML][] | ![github icon][] | ![apple icon][] | Canonical source repository for PyYAML |
| [pikepdf][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python library for reading and writing PDF, powered by QPDF |
| [numexpr][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Fast numerical array expression evaluator for Python, NumPy, Pandas, PyTables and more |
@@ -66,8 +67,8 @@ title: Working examples
| [google neuroglancer][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | WebGL-based viewer for volumetric data |
| [Parselmouth][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python interface to the Praat software package, using pybind11, C++17 and CMake, with the core Praat static library built only once and shared between wheels. |
| [H3-py][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Python bindings for H3, a hierarchical hexagonal geospatial indexing system |
| [AutoPy][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [time-machine][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Time mocking library using only the CPython C API. |
| [AutoPy][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [DeepForest][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | An Efficient, Scalable and Optimized Python Framework for Deep Forest (2021.2.1) |
| [mosec][] | ![github icon][] | ![linux icon][] ![apple icon][] | A machine learning model serving framework powered by Rust |
| [Picologging][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A high-performance logging library for Python. |
@@ -76,13 +77,13 @@ title: Working examples
| [pybind11 cmake_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | Example pybind11 module built with a CMake-based build system |
| [KDEpy][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Kernel Density Estimation in Python |
| [dd-trace-py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Uses custom alternate arch emulation on GitHub |
| [tgcalls][] | ![github icon][] | ![apple icon][] ![windows icon][] | Python `pybind11` binding to Telegram's WebRTC library with third party dependencies like `OpenSSL`, `MozJPEG`, `FFmpeg`, etc. |
| [sourmash][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] ![pyodide icon][] | Quickly search, compare, and analyze genomic and metagenomic data sets. |
| [tgcalls][] | ![github icon][] | ![apple icon][] ![windows icon][] | Python `pybind11` binding to Telegram's WebRTC library with third party dependencies like `OpenSSL`, `MozJPEG`, `FFmpeg`, etc. |
| [python-rapidjson][] | ![travisci icon][] ![gitlab icon][] | ![windows icon][] ![linux icon][] | Python wrapper around rapidjson |
| [pybind11 python_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | Example pybind11 module built with a Python-based build system |
| [Confluent client for Kafka][] | ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | setup in `tools/wheels/build-wheels.bat` |
| [python-snappy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Python bindings for the snappy google library |
| [abess][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A fast best-subset selection library. It uses cibuildwheel to build a large project with C++ extensions. |
| [Confluent client for Kafka][] | ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | setup in `tools/wheels/build-wheels.bat` |
| [jq.py][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | Python bindings for jq |
| [cyvcf2][] | ![github icon][] | ![apple icon][] ![linux icon][] | cython + htslib == fast VCF and BCF processing |
| [matrixprofile][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone. |
@@ -91,18 +92,18 @@ title: Working examples
| [pillow-heif][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Bindings to libheif library with third party dependencies. Fully automated CI for tests and publishing including Apple Silicon builds. |
| [keyvi][] | ![github icon][] | ![linux icon][] ![apple icon][] | FST based key value index highly optimized for size and lookup performance, utilizes ccache action for improved runtime |
| [PyGLM][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Fast OpenGL Mathematics (GLM) for Python |
| [iDynTree][] | ![github icon][] | ![linux icon][] | Uses manylinux_2_24 |
| [power-grid-model][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python/C++ library for distribution power system analysis |
| [iDynTree][] | ![github icon][] | ![linux icon][] | Uses manylinux_2_24 |
| [TgCrypto][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [Imagecodecs (fork)][] | ![azurepipelines icon][] | ![apple icon][] ![linux icon][] | Over 20 external dependencies in compiled libraries, custom docker image, `libomp`, `openblas` and `install_name_tool` for macOS. |
| [streaming-form-data][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Streaming parser for multipart/form-data written in Cython |
| [pybase64][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![android icon][] ![ios icon][] ![pyodide icon][] | setuptools backend with custom CMake step for external sources. SBOM embedded via a custom repair step. |
| [Imagecodecs (fork)][] | ![azurepipelines icon][] | ![apple icon][] ![linux icon][] | Over 20 external dependencies in compiled libraries, custom docker image, `libomp`, `openblas` and `install_name_tool` for macOS. |
| [boost-histogram][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | Supports full range of wheels, including PyPy and alternate archs. |
| [bx-python][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | A library that includes Cython extensions. |
| [Python-WebRTC][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | a Python extension that provides bindings to WebRTC M92 |
| [pybind11 scikit_build_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | An example combining scikit-build and pybind11 |
| [fathon][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | python package for DFA (Detrended Fluctuation Analysis) and related algorithms |
| [Arbor][] | ![github icon][] | ![apple icon][] ![linux icon][] | Arbor is a multi-compartment neuron simulation library; compatible with next-generation accelerators; best-practices applied to research software; focused on community-driven development. Includes a [small script](https://github.com/arbor-sim/arbor/blob/master/scripts/patchwheel.py) patching `rpath` in bundled libraries. |
| [fathon][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | python package for DFA (Detrended Fluctuation Analysis) and related algorithms |
| [clang-format][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Scikit-build wrapper around LLVM's CMake, all platforms, generic wheels. |
| [polaroid][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Full range of wheels for setuptools rust, with auto release and PyPI deploy. |
| [ninja][] | ![github icon][] ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Multitagged binary builds for all supported platforms, using cibw 2 config configuration. |
@@ -121,8 +122,8 @@ title: Working examples
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
[duckdb]: https://github.com/duckdb/duckdb
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
[NumPy]: https://github.com/numpy/numpy
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
[NCNN]: https://github.com/Tencent/ncnn
[Matplotlib]: https://github.com/matplotlib/matplotlib
[Tornado]: https://github.com/tornadoweb/tornado
@@ -158,9 +159,9 @@ title: Working examples
[Implicit]: https://github.com/benfred/implicit
[vispy]: https://github.com/vispy/vispy
[coverage.py]: https://github.com/nedbat/coveragepy
[Line Profiler]: https://github.com/pyutils/line_profiler
[PyCryptodome]: https://github.com/Legrandin/pycryptodome
[PyAV]: https://github.com/PyAV-Org/PyAV
[PyCryptodome]: https://github.com/Legrandin/pycryptodome
[Line Profiler]: https://github.com/pyutils/line_profiler
[PyYAML]: https://github.com/yaml/pyyaml
[pikepdf]: https://github.com/pikepdf/pikepdf
[numexpr]: https://github.com/pydata/numexpr
@@ -177,8 +178,8 @@ title: Working examples
[google neuroglancer]: https://github.com/google/neuroglancer
[Parselmouth]: https://github.com/YannickJadoul/Parselmouth
[H3-py]: https://github.com/uber/h3-py
[AutoPy]: https://github.com/autopilot-rs/autopy
[time-machine]: https://github.com/adamchainz/time-machine
[AutoPy]: https://github.com/autopilot-rs/autopy
[DeepForest]: https://github.com/LAMDA-NJU/Deep-Forest
[mosec]: https://github.com/mosecorg/mosec
[Picologging]: https://github.com/microsoft/picologging
@@ -187,13 +188,13 @@ title: Working examples
[pybind11 cmake_example]: https://github.com/pybind/cmake_example
[KDEpy]: https://github.com/tommyod/KDEpy
[dd-trace-py]: https://github.com/DataDog/dd-trace-py
[tgcalls]: https://github.com/MarshalX/tgcalls
[sourmash]: https://github.com/sourmash-bio/sourmash
[tgcalls]: https://github.com/MarshalX/tgcalls
[python-rapidjson]: https://github.com/python-rapidjson/python-rapidjson
[pybind11 python_example]: https://github.com/pybind/python_example
[Confluent client for Kafka]: https://github.com/confluentinc/confluent-kafka-python
[python-snappy]: https://github.com/intake/python-snappy
[abess]: https://github.com/abess-team/abess
[Confluent client for Kafka]: https://github.com/confluentinc/confluent-kafka-python
[jq.py]: https://github.com/mwilliamson/jq.py
[cyvcf2]: https://github.com/brentp/cyvcf2
[matrixprofile]: https://github.com/matrix-profile-foundation/matrixprofile
@@ -202,18 +203,18 @@ title: Working examples
[pillow-heif]: https://github.com/bigcat88/pillow_heif
[keyvi]: https://github.com/KeyviDev/keyvi
[PyGLM]: https://github.com/Zuzu-Typ/PyGLM
[iDynTree]: https://github.com/robotology/idyntree
[power-grid-model]: https://github.com/PowerGridModel/power-grid-model
[iDynTree]: https://github.com/robotology/idyntree
[TgCrypto]: https://github.com/pyrogram/tgcrypto
[Imagecodecs (fork)]: https://github.com/czaki/imagecodecs_build
[streaming-form-data]: https://github.com/siddhantgoel/streaming-form-data
[pybase64]: https://github.com/mayeut/pybase64
[Imagecodecs (fork)]: https://github.com/czaki/imagecodecs_build
[boost-histogram]: https://github.com/scikit-hep/boost-histogram
[bx-python]: https://github.com/bxlab/bx-python
[Python-WebRTC]: https://github.com/MarshalX/python-webrtc
[pybind11 scikit_build_example]: https://github.com/pybind/scikit_build_example
[fathon]: https://github.com/stfbnc/fathon
[Arbor]: https://github.com/arbor-sim/arbor
[fathon]: https://github.com/stfbnc/fathon
[clang-format]: https://github.com/ssciwr/clang-format-wheel
[polaroid]: https://github.com/daggy1234/polaroid
[ninja]: https://github.com/scikit-build/ninja-python-distributions
+3 -3
View File
@@ -6,7 +6,7 @@ jobs:
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
pip3 install cibuildwheel==4.0.0rc1
pip3 install cibuildwheel==4.2.0
displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels
@@ -20,7 +20,7 @@ jobs:
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
python3 -m pip install cibuildwheel==4.0.0rc1
python3 -m pip install cibuildwheel==4.2.0
displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels
@@ -34,7 +34,7 @@ jobs:
- bash: |
set -o errexit
python -m pip install --upgrade pip
pip install cibuildwheel==4.0.0rc1
pip install cibuildwheel==4.2.0
displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels
+3 -3
View File
@@ -11,7 +11,7 @@ jobs:
- run:
name: Build the Linux wheels.
command: |
python3 -m pip install --user cibuildwheel==4.0.0rc1
python3 -m pip install --user cibuildwheel==4.2.0
cibuildwheel --output-dir wheelhouse
- store_artifacts:
path: wheelhouse/
@@ -28,7 +28,7 @@ jobs:
- run:
name: Build the Linux aarch64 wheels.
command: |
python3 -m pip install --user cibuildwheel==4.0.0rc1
python3 -m pip install --user cibuildwheel==4.2.0
python3 -m cibuildwheel --output-dir wheelhouse
- store_artifacts:
path: wheelhouse/
@@ -44,7 +44,7 @@ jobs:
name: Build the OS X wheels.
command: |
sudo softwareupdate --install-rosetta --agree-to-license # for x86_64/universal2 tests
pip3 install cibuildwheel==4.0.0rc1
pip3 install cibuildwheel==4.2.0
cibuildwheel --output-dir wheelhouse
- store_artifacts:
path: wheelhouse/
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@v4.0.0rc1
uses: pypa/cibuildwheel@v4.2.0
env:
CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
CIBW_ARCHS: ${{ matrix.archs || 'auto' }}
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@v4.0.0rc1
uses: pypa/cibuildwheel@v4.2.0
# env:
# CIBW_SOME_OPTION: value
# ...
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
persist-credentials: false
- name: Build wheels
run: pipx run cibuildwheel==4.0.0rc1
run: pipx run cibuildwheel==4.2.0
- uses: actions/upload-artifact@v4
with:
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v4.0.0rc1
uses: pypa/cibuildwheel@v4.2.0
env:
# configure cibuildwheel on Linux to build native archs ('auto'),
# and to split the remaining architectures between the x86_64 and
+3 -3
View File
@@ -12,7 +12,7 @@ linux:
DOCKER_TLS_CERTDIR: ""
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==4.0.0rc1
- python -m pip install cibuildwheel==4.2.0
- cibuildwheel --output-dir wheelhouse
artifacts:
paths:
@@ -23,7 +23,7 @@ windows:
before_script:
- choco install python -y --allow-downgrade --version 3.12.4
- choco install git.install -y
- py -m pip install cibuildwheel==4.0.0rc1
- py -m pip install cibuildwheel==4.2.0
script:
- py -m cibuildwheel --output-dir wheelhouse --platform windows
artifacts:
@@ -35,7 +35,7 @@ windows:
macos:
image: macos-14-xcode-15
before_script:
- python3 -m pip install cibuildwheel==4.0.0rc1
- python3 -m pip install cibuildwheel==4.2.0
script:
- python3 -m cibuildwheel --output-dir wheelhouse
artifacts:
+1 -1
View File
@@ -14,7 +14,7 @@ linux:
- curl -sSL https://get.docker.com/ | sh
# Warning: This is extremely slow, be careful with how many wheels you build
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- python -m pip install cibuildwheel==4.0.0rc1
- python -m pip install cibuildwheel==4.2.0
# Assuming your CI runner's default architecture is x86_64...
- cibuildwheel --output-dir wheelhouse --platform linux --archs aarch64
artifacts:
+63 -2
View File
@@ -16,9 +16,11 @@ See sessions with `nox -l`
"""
import os
import re
import shutil
import sys
from pathlib import Path
from typing import Any
import nox
@@ -63,6 +65,59 @@ def tests(session: nox.Session) -> None:
session.run("pytest", "test", "-x", "--durations", "0", "--timeout=2400", "test")
# Packages held back for GraalPy until upstream fixes land. uv pip compile
# can't express a per-implementation split, so the compiled pin is patched:
# GraalPy (matching `graalpy_marker`) gets `held`, everything else
# (`other_marker`) tracks the freshly compiled version.
GRAALPY_HELD_BACK = (
# Newer pip breaks GraalPy on macOS and Windows.
{
"package": "pip",
"held": ("26.1.2", "26.0.1"),
"graalpy_marker": (
'implementation_name == "graalpy" and platform_system != "Windows"',
'implementation_name == "graalpy" and platform_system == "Windows"',
),
"other_marker": 'implementation_name != "graalpy"',
},
# filelock >=3.30 imports errno.ENOTSUP, which GraalPy lacks (fix due ~2026-08).
{
"package": "filelock",
"held": ("3.29.7",),
"graalpy_marker": ('implementation_name == "graalpy"',),
"other_marker": 'implementation_name != "graalpy"',
},
)
def _pin_graalpy_workarounds(output_file: Path) -> None:
text = output_file.read_text()
for pin in GRAALPY_HELD_BACK:
assert isinstance(pin["package"], str)
package = re.escape(pin["package"])
graalpy_pins = "\n".join(
f"{pin['package']}=={pin['held'][i]}; {pin['graalpy_marker'][i]}"
for i in range(len(pin["held"]))
)
text = re.sub(
rf"^{package}==(?P<version>[^\s;]+)$",
f"{pin['package']}==\\g<version>; {pin['other_marker']}\n{graalpy_pins}",
text,
flags=re.MULTILINE,
)
output_file.write_text(text)
def _graalpy_python_versions(build_platforms: dict[str, Any]) -> set[str]:
"""Python minor versions (e.g. "3.12") that ship a GraalPy configuration."""
return {
".".join(config["version"].split(".")[:2])
for platform in build_platforms.values()
for config in platform["python_configurations"]
if config["identifier"].startswith("gp")
}
@nox.session(default=False, tags=["update"])
def update_constraints(session: nox.Session) -> None:
"""
@@ -79,6 +134,9 @@ def update_constraints(session: nox.Session) -> None:
env = os.environ.copy()
env["UV_CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
build_platforms = nox.project.load_toml(resources / "build-platforms.toml")
graalpy_versions = _graalpy_python_versions(build_platforms)
for minor_version in range(9, 16):
python_version = f"3.{minor_version}"
output_file = resources / f"constraints-python{python_version.replace('.', '')}.txt"
@@ -92,13 +150,14 @@ def update_constraints(session: nox.Session) -> None:
f"--output-file={output_file}",
env=env,
)
if python_version in graalpy_versions:
_pin_graalpy_workarounds(output_file)
shutil.copyfile(
resources / "constraints-python315.txt",
resources / "constraints.txt",
)
build_platforms = nox.project.load_toml(resources / "build-platforms.toml")
pyodides = build_platforms["pyodide"]["python_configurations"]
for pyodide in pyodides:
python_version = ".".join(pyodide["version"].split(".")[:2])
@@ -176,7 +235,9 @@ def docs(session: nox.Session) -> None:
"""
pyproject = nox.project.load_toml()
session.install("-e.", *nox.project.dependency_groups(pyproject, "docs"))
session.run("mkdocs", "serve" if session.interactive else "build", "--strict", *session.posargs)
session.run(
"properdocs", "serve" if session.interactive else "build", "--strict", *session.posargs
)
@nox.session(default=False)
+2
View File
@@ -58,3 +58,5 @@ plugins:
j2_variable_end_string: »
on_error_fail: true
on_undefined: strict
- intersphinx:
project: cibuildwheel
+4 -6
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "cibuildwheel"
version = "4.0.0rc1"
version = "4.2.0"
description = "Build Python wheels on CI with minimal configuration."
readme = "README.md"
license = "BSD-2-Clause"
@@ -45,11 +45,7 @@ dependencies = [
"filelock",
"humanize",
"packaging>=20.9",
# patchelf is used for Android
"patchelf; (sys_platform == 'linux' or sys_platform == 'darwin') and (platform_machine == 'x86_64' or platform_machine == 'arm64' or platform_machine == 'aarch64')",
"platformdirs",
"pyelftools>=0.29",
"wheel>=0.33.6",
]
[project.optional-dependencies]
@@ -70,8 +66,10 @@ Homepage = "https://github.com/pypa/cibuildwheel"
docs = [
"jinja2>=3.1.2",
"mkdocs-include-markdown-plugin==7.1.8",
"mkdocs-intersphinx>=0.1.1; python_version >= '3.12'",
"mkdocs-macros-plugin>=1.4.1",
"mkdocs==1.6.1",
"properdocs==1.6.7",
"properdocs-theme-readthedocs",
"pymdown-extensions",
"rich",
]
+64 -27
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
import dataclasses
import json
import os
import subprocess
@@ -12,14 +13,16 @@ from cibuildwheel.ci import detect_ci_provider
from cibuildwheel.options import CommandLineArguments, Options
from cibuildwheel.selector import EnableGroup
from cibuildwheel.typing import PLATFORMS
from cibuildwheel.util.resources import PINNED_DOCKER_IMAGES
from cibuildwheel.venv import find_uv
from . import utils
from .utils import DEFAULT_CIBW_ENABLE, EMULATED_ARCHS, get_platform
from .utils import DEFAULT_CIBW_ENABLE, EMULATED_ARCHS, get_enable_groups, get_platform
TYPE_CHECKING = False
if TYPE_CHECKING:
from collections.abc import Generator
from pathlib import Path
def pytest_addoption(parser: pytest.Parser) -> None:
@@ -74,7 +77,19 @@ def pytest_configure(config: pytest.Config) -> None:
os.environ["CIBW_PLATFORM"] = flag_platform
def docker_warmup(request: pytest.FixtureRequest) -> None:
@dataclasses.dataclass(frozen=True)
class DockerWarmUpImage:
source_name: str
cached_name: str
def get_docker_warmup_images(request: pytest.FixtureRequest) -> list[DockerWarmUpImage] | None:
enable_groups = get_enable_groups()
# Check missing pre-installed interpreters are needed
enable_groups &= {EnableGroup.GraalPy, EnableGroup.PyPyEoL}
if not enable_groups:
return None
machine = request.config.getoption("--run-emulation", default=None)
if machine is None:
archs = {arch.value for arch in Architecture.auto_archs("linux")}
@@ -86,7 +101,7 @@ def docker_warmup(request: pytest.FixtureRequest) -> None:
# Only include architectures where there are missing pre-installed interpreters
archs &= {"x86_64", "i686", "aarch64"}
if not archs:
return
return None
options = Options(
platform="linux",
@@ -96,17 +111,28 @@ def docker_warmup(request: pytest.FixtureRequest) -> None:
)
build_options = options.build_options(None)
assert build_options.manylinux_images is not None
assert build_options.musllinux_images is not None
images = [build_options.manylinux_images[arch] for arch in archs] + [
build_options.musllinux_images[arch] for arch in archs
]
images: list[DockerWarmUpImage] = []
for arch in archs:
source_name = build_options.manylinux_images[arch]
cached_name = source_name
if "@sha256:" in source_name:
cached_name = source_name.rsplit("@sha256:", 1)[0] + ":cibw_cache_fixture"
images.append(DockerWarmUpImage(source_name, cached_name))
if images:
return images
return None
def docker_warmup(images: list[DockerWarmUpImage], docker_warmup_config: Path) -> None:
command = (
"manylinux-interpreters ensure-all &&"
"cpython3.13 -m pip download -d /tmp setuptools wheel pytest"
)
config_content = PINNED_DOCKER_IMAGES.read_text()
for image in images:
config_content = config_content.replace(image.source_name, image.cached_name)
container_id = subprocess.run(
["docker", "create", image, "bash", "-c", command],
["docker", "create", image.source_name, "bash", "-c", command],
text=True,
check=True,
stdout=subprocess.PIPE,
@@ -118,37 +144,48 @@ def docker_warmup(request: pytest.FixtureRequest) -> None:
).stdout.strip()
assert exit_code == "0"
subprocess.run(
["docker", "commit", container_id, image], check=True, stdout=subprocess.DEVNULL
["docker", "commit", container_id, image.cached_name],
check=True,
stdout=subprocess.DEVNULL,
)
finally:
subprocess.run(["docker", "rm", container_id], check=True, stdout=subprocess.DEVNULL)
docker_warmup_config.write_text(config_content)
@pytest.fixture(scope="session", autouse=True)
def docker_warmup_fixture(
request: pytest.FixtureRequest, tmp_path_factory: pytest.TempPathFactory, worker_id: str
) -> None:
) -> Generator[None, None, None]:
# if we're in CI testing linux, let's warm-up docker images
if detect_ci_provider() is None or get_platform() != "linux":
return None
if request.config.getoption("--run-emulation", default=None) is not None:
images = None
elif request.config.getoption("--run-emulation", default=None) is not None:
# emulation tests only run one test in CI, caching the image only slows down the test
return None
images = None
else:
images = get_docker_warmup_images(request)
if images is None:
yield None
return
if worker_id == "master":
# not executing with multiple workers
# it might be unsafe to write to tmp_path_factory.getbasetemp().parent
return docker_warmup(request)
docker_warmup_config = tmp_path_factory.getbasetemp() / "docker_warmup.cfg"
docker_warmup(images, docker_warmup_config)
else:
# get the temp directory shared by all workers
root_tmp_dir = tmp_path_factory.getbasetemp().parent
# get the temp directory shared by all workers
root_tmp_dir = tmp_path_factory.getbasetemp().parent
docker_warmup_config = root_tmp_dir / "docker_warmup.cfg"
with FileLock(str(docker_warmup_config) + ".lock"):
if not docker_warmup_config.is_file():
docker_warmup(images, docker_warmup_config)
fn = root_tmp_dir / "warmup.done"
with FileLock(str(fn) + ".lock"):
if not fn.is_file():
docker_warmup(request)
fn.write_text("done")
return None
with pytest.MonkeyPatch.context() as monkeypatch:
monkeypatch.setenv("CIBW_INTERNAL_PINNED_DOCKER_IMAGES", str(docker_warmup_config))
yield None
@pytest.fixture(params=["pip", "build"])
@@ -157,8 +194,8 @@ def build_frontend_env_nouv(request: pytest.FixtureRequest) -> dict[str, str]:
marks = {m.name for m in request.node.iter_markers()}
platform = "pyodide" if "pyodide" in marks else get_platform()
if platform == "pyodide" and frontend == "pip":
pytest.skip("Can't use pip as build frontend for pyodide platform")
if platform == "pyodide":
pytest.skip("pyodide only supports the pyodide-build frontend")
return {"CIBW_BUILD_FRONTEND": frontend}
@@ -176,10 +213,10 @@ def build_frontend_env(request: pytest.FixtureRequest) -> Generator[dict[str, st
else:
platform = get_platform()
if platform in {"pyodide", "ios", "android"} and frontend == "pip":
if platform == "pyodide":
pytest.skip("pyodide only supports the pyodide-build frontend")
if platform in {"ios", "android"} and frontend == "pip":
pytest.skip(f"Can't use pip as build frontend for {platform}")
if platform == "pyodide" and frontend in {"build[uv]", "uv"}:
pytest.skip("Can't use uv with pyodide yet")
uv_path = find_uv()
if uv_path is None and frontend in {"build[uv]", "uv"}:
pytest.skip("Can't find uv, so skipping uv tests")
+1
View File
@@ -35,6 +35,7 @@ def test_dummy_serial() -> None:
"""
@pytest.mark.flaky(reruns=2, reruns_delay=5)
def test(
tmp_path: Path, build_frontend_env: dict[str, str], capfd: pytest.CaptureFixture[str]
) -> None:
+5 -5
View File
@@ -49,12 +49,12 @@ def test_abi3(tmp_path: Path) -> None:
project_dir,
add_env={
# free_threaded, GraalPy, and PyPy do not have a Py_LIMITED_API equivalent, just build one of those
# pyodide uses cp313 (the stable version) which supports limited API / abi3
# pyodide uses cp314 (the latest stable version) which supports limited API / abi3
# also limit the number of builds for test performance reasons
"CIBW_BUILD": (
"cp313-*"
"cp314-*"
if utils.get_platform() == "pyodide"
else "cp39-* cp310-* pp310-* gp312_250-* cp312-* cp314t-*"
else "cp39-* cp310-* pp311-* gp312_250-* cp312-* cp314t-*"
),
"CIBW_ENABLE": "all",
},
@@ -77,7 +77,7 @@ def test_abi3(tmp_path: Path) -> None:
"cp39-cp39",
"cp310-abi3", # <-- ABI3, works with 3.10 and 3.12
"cp314-cp314t",
"pp310-pypy310_pp73",
"pp311-pypy311_pp73",
"graalpy312-graalpy250_312_native",
],
)
@@ -203,7 +203,7 @@ def test_abi_none(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
"CIBW_TEST_REQUIRES": "pytest",
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} {{project}}/test",
# limit the number of builds for test performance reasons
"CIBW_BUILD": "cp39-* cp{}{}-* cp314t-* pp310-*".format(*utils.SINGLE_PYTHON_VERSION),
"CIBW_BUILD": "cp39-* cp{}{}-* cp314t-* pp311-*".format(*utils.SINGLE_PYTHON_VERSION),
"CIBW_ENABLE": "all",
},
)

Some files were not shown because too many files have changed in this diff Show More