Compare commits

..
Author SHA1 Message Date
copilot-swe-agent[bot] 892871796a Merge remote-tracking branch 'origin/copilot/fix-code-comments' into copilot/fix-code-comments
Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
2026-05-29 03:42:47 +00:00
copilot-swe-agent[bot]andhenryiii 39b605f6e0 Fix PR review comments for cache verification and docs wording
Co-authored-by: henryiii <4616906+henryiii@users.noreply.github.com>
2026-05-29 03:42:23 +00:00
copilot-swe-agent[bot] 3f6f9b3b1f Initial plan 2026-05-29 03:35:59 +00:00
Henry Schreiner f925e8ccef fix: also include pyodide
Assisted-by: CopilotCLI:gpt-5.3-codex
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-05-28 22:36:20 -04:00
Henry SchreinerandCopilot b597cb5aff 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
2026-05-28 17:25:09 -04:00
Henry SchreinerandCopilot 97537fe937 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
2026-05-28 11:03:52 -04:00
107 changed files with 1616 additions and 3681 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
contents: read contents: read
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
@@ -28,7 +28,7 @@ jobs:
python-version: "3.x" python-version: "3.x"
allow-prereleases: true allow-prereleases: true
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install tooling - name: Install tooling
run: | run: |
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
dist: dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
+15 -15
View File
@@ -39,13 +39,13 @@ jobs:
name: Linters (mypy, ruff, etc.) name: Linters (mypy, ruff, etc.)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with: with:
python-version: "3.x" python-version: "3.x"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4 - uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
- name: PyLint checks - name: PyLint checks
run: uvx nox -s pylint -- --output-format=github run: uvx nox -s pylint -- --output-format=github
@@ -55,14 +55,14 @@ jobs:
needs: lint needs: lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
name: Install Python name: Install Python
with: with:
python-version: "3.x" python-version: "3.x"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies - name: Install dependencies
run: uv sync --no-dev --group test run: uv sync --no-dev --group test
- name: Generate a sample project - name: Generate a sample project
@@ -117,7 +117,7 @@ jobs:
test_select: android test_select: android
timeout-minutes: 180 timeout-minutes: 180
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
@@ -126,7 +126,7 @@ jobs:
python-version: ${{ matrix.python_version }} python-version: ${{ matrix.python_version }}
allow-prereleases: true allow-prereleases: true
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Free up disk space - name: Free up disk space
if: runner.os == 'Linux' && matrix.test_select != 'android' if: runner.os == 'Linux' && matrix.test_select != 'android'
@@ -139,7 +139,7 @@ jobs:
# for oci_container unit tests # for oci_container unit tests
- name: Set up QEMU - name: Set up QEMU
if: runner.os == 'Linux' if: runner.os == 'Linux'
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Set up Xcode - name: Set up Xcode
if: ${{ startsWith(matrix.os, 'macos-15') }} if: ${{ startsWith(matrix.os, 'macos-15') }}
@@ -247,13 +247,13 @@ jobs:
outputs: outputs:
archs: ${{ steps.archs.outputs.archs }} archs: ${{ steps.archs.outputs.archs }}
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with: with:
python-version: "3.x" python-version: "3.x"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies - name: Install dependencies
run: uv sync --no-dev --group test run: uv sync --no-dev --group test
- name: Get qemu emulated architectures - name: Get qemu emulated architectures
@@ -272,18 +272,18 @@ jobs:
matrix: matrix:
arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }} arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }}
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with: with:
python-version: "3.x" python-version: "3.x"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies - name: Install dependencies
run: uv sync --no-dev --group test run: uv sync --no-dev --group test
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Run the emulation tests - name: Run the emulation tests
env: env:
@@ -296,14 +296,14 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 180 timeout-minutes: 180
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
name: Install Python 3.12 name: Install Python 3.12
with: with:
python-version: '3.12' python-version: '3.12'
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies - name: Install dependencies
run: uv sync --no-dev --group test run: uv sync --no-dev --group test
@@ -348,7 +348,7 @@ jobs:
- os: macos-15 - os: macos-15
test_select: android test_select: android
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- name: Download a sample project - name: Download a sample project
+2 -2
View File
@@ -37,11 +37,11 @@ jobs:
permission-contents: write permission-contents: write
permission-pull-requests: write permission-pull-requests: write
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with: with:
python-version: "3.14" python-version: "3.14"
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
security-events: write security-events: write
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
persist-credentials: false persist-credentials: false
+12 -13
View File
@@ -1,5 +1,5 @@
linux: linux:
image: python:3.13 image: python:3.12
services: services:
- name: docker:dind - name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"] entrypoint: ["env", "-u", "DOCKER_HOST"]
@@ -14,7 +14,7 @@ linux:
# (comment the below line in a PR to debug a Gitlab-specific issue) # (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 PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
rules: rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/' - if: '$CI_COMMIT_BRANCH == "main"'
variables: variables:
CIBW_ENABLE: "all" CIBW_ENABLE: "all"
script: script:
@@ -25,29 +25,28 @@ linux:
- python ./bin/run_tests.py - python ./bin/run_tests.py
windows: windows:
image: mcr.microsoft.com/windows/servercore:1809
variables: variables:
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code 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: rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/' - if: '$CI_COMMIT_BRANCH == "main"'
variables: variables:
# Everything except graalpy. GraalPy is JVM-based and very slow to CIBW_ENABLE: "all"
# 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: script:
- python -m pip install -U pip - py -m pip install -U pip
- python -m pip install -e. pytest-custom-exit-code --group test - py -m pip install -e. pytest-custom-exit-code --group test
- python bin\run_tests.py - py bin\run_tests.py
tags: tags:
- saas-windows-medium-amd64 - saas-windows-medium-amd64
macos: macos:
image: macos-15-xcode-16 image: macos-14-xcode-15
variables: variables:
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
rules: rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH =~ /^gitlab/' - if: '$CI_COMMIT_BRANCH == "main"'
variables: variables:
CIBW_ENABLE: "all" CIBW_ENABLE: "all"
script: script:
+5 -10
View File
@@ -18,14 +18,14 @@ repos:
exclude: ^cibuildwheel/resources/android/android.patch$ exclude: ^cibuildwheel/resources/android/android.patch$
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: 0671d8ab202c4ac093b78433ae5baf74f3fc7246 # frozen: v0.15.15 rev: 0c7b6c989466a93942def1f84baf36ddfcd60c83 # frozen: v0.15.14
hooks: hooks:
- id: ruff-check - id: ruff-check
args: ["--fix"] args: ["--fix"]
- id: ruff-format - id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: d2823d321df3af8f878f7ee3414dc94d037145b9 # frozen: v2.1.0 rev: fc0f09a29bb495f4a91f00266155d6282d52485d # frozen: v1.20.2
hooks: hooks:
- id: mypy - id: mypy
name: mypy 3.11 on cibuildwheel/ name: mypy 3.11 on cibuildwheel/
@@ -37,7 +37,9 @@ repos:
- dependency-groups>=1.2 - dependency-groups>=1.2
- humanize - humanize
- nox>=2025.2.9 - nox>=2025.2.9
- orjson
- packaging - packaging
- pyelftools
- pygithub - pygithub
- pytest - pytest
- rich - rich
@@ -76,14 +78,6 @@ repos:
files: '^(README\.md|docs/changelog\.md|docs/options\.md|bin/readme.*)$' files: '^(README\.md|docs/changelog\.md|docs/options\.md|bin/readme.*)$'
additional_dependencies: [cogapp>=3.5] additional_dependencies: [cogapp>=3.5]
- repo: https://github.com/henryiii/flake8-lazy
rev: 65b94e97b1091634368592d98072160842265fe4 # frozen: v0.8.2
hooks:
- id: flake8-lazy
args: ["--apply=set"]
files: '^cibuildwheel'
exclude: "^cibuildwheel/resources/"
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2 rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2
hooks: hooks:
@@ -100,6 +94,7 @@ repos:
- id: check-github-workflows - id: check-github-workflows
- id: check-gitlab-ci - id: check-gitlab-ci
- id: check-readthedocs - id: check-readthedocs
- id: check-travis
- id: check-jsonschema - id: check-jsonschema
name: Check projects name: Check projects
args: [--schemafile, docs/data/projects.schema.json] args: [--schemafile, docs/data/projects.schema.json]
+38 -61
View File
@@ -24,23 +24,25 @@ While cibuildwheel itself requires a recent Python version to run (we support th
| | 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 | | | 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.9 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | N/A |
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</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>4</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>4</sup> | N/A | N/A | ✅<sup>3</sup> | | CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | N/A | N/A | ✅<sup>3</sup> |
| CPython 3.13 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | ✅ | | CPython 3.13 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | ✅ | ✅ | ✅ |
| CPython 3.14 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | ✅ | | CPython 3.14 | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>5</sup> | ✅ | ✅ | ✅<sup>4</sup> |
| CPython 3.15<sup>5</sup> | ✅ | ✅ | ✅ | ✅ | ✅<sup>2</sup> | ✅ | ✅ | ✅ | ✅ | ✅ | ✅<sup>4</sup> | ✅ | ✅ | N/A | | 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.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.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 | | 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 | | 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>**1** PyPy & GraalPy are only supported for manylinux wheels.</sup><br>
<sup>**2** Windows arm64 support is experimental.</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>**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** 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>**4** Experimental alpha ABI, do not upload to PyPI yet.</sup><br>
<sup>**5** Python 3.15 requires opt-in using [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable).</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>
- Builds manylinux, musllinux, macOS, Windows, pyemscripten, iOS, and Android wheels - Builds manylinux, musllinux, macOS, Windows, pyemscripten, iOS, and Android wheels
- Supports CPython, PyPy, and GraalPy - Supports CPython, PyPy, and GraalPy
@@ -98,7 +100,7 @@ jobs:
- uses: actions/setup-python@v6 - uses: actions/setup-python@v6
- name: Install cibuildwheel - name: Install cibuildwheel
run: python -m pip install cibuildwheel==4.1.0 run: python -m pip install cibuildwheel==4.0.0rc1
- name: Build wheels - name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse run: python -m cibuildwheel --output-dir wheelhouse
@@ -150,7 +152,6 @@ 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-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 | | | [`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-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 | | | [`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 | | | [`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 | | | [`container-engine`](https://cibuildwheel.pypa.io/en/stable/options/#container-engine) | Specify the container engine to use when building Linux wheels |
@@ -172,7 +173,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 | | | [`build-verbosity`](https://cibuildwheel.pypa.io/en/stable/options/#build-verbosity) | Increase/decrease the output of the build |
<!--[[[end]]] (sum: Of/28Z7Nut) --> <!--[[[end]]] (sum: b7YIjCyCkf) -->
These options can be specified in a pyproject.toml file, or as environment variables, see [configuration docs](https://cibuildwheel.pypa.io/en/latest/configuration/). These options can be specified in a pyproject.toml file, or as environment variables, see [configuration docs](https://cibuildwheel.pypa.io/en/latest/configuration/).
@@ -239,71 +240,33 @@ Changelog
<!-- [[[cog from readme_changelog import mini_changelog; print(mini_changelog()) ]]] --> <!-- [[[cog from readme_changelog import mini_changelog; print(mini_changelog()) ]]] -->
### v4.1.0 ### v4.0.0rc1
_12 June 2026_ _14 May 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 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.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) - 🌟 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)
- 🌟 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) - 🌟 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.0b2. (#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.0b1. (#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.15 will be available in cibuildwheel without the flag._ _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)
- ✨ 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) - ✨ 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) - ⚠️ 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) - ⚠️ 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 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 `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) - 🛠 Updates Android to Python 3.13.13 and 3.14.4 (#2821)
- 🛠 Applies Pyodide-specific patches to the Emscripten toolchain installation (#2800) - 🛠 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) - 🛠 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) - 📚 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) - 📚 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 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) - 📚 Links back to source in docs (#2806)
- 📚 Removes outdated numpy info (#2855) - 💼 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)
### v3.4.1 ### v3.4.1
@@ -334,7 +297,21 @@ _5 January 2026_
- 🛠 Update dependencies and container pins, including updating to CPython 3.14.2. (#2708) - 🛠 Update dependencies and container pins, including updating to CPython 3.14.2. (#2708)
<!-- [[[end]]] (sum: s3fkxPyqwC) --> ### 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) -->
--- ---
+12 -27
View File
@@ -19,54 +19,39 @@ jobs:
- job: tests - job: tests
strategy: strategy:
matrix: matrix:
linux_313: linux_311:
imageName: "ubuntu-latest" imageName: "ubuntu-latest"
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "native" testSelect: "native"
android_313: android_311:
imageName: "ubuntu-latest" imageName: "ubuntu-latest"
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "android" testSelect: "android"
macos_313: macos_311:
imageName: "macos-latest" imageName: "macos-latest"
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "native" testSelect: "native"
ios_313: ios_311:
imageName: "macos-14" # See https://github.com/actions/runner-images/issues/12777 imageName: "macos-14" # See https://github.com/actions/runner-images/issues/12777
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "ios" testSelect: "ios"
android_macos_313: android_macos_311:
imageName: "macos-latest" imageName: "macos-latest"
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "android" testSelect: "android"
windows_313: windows_311:
imageName: "windows-latest" imageName: "windows-latest"
pythonVersion: "3.13" pythonVersion: "3.11"
testSelect: "native" testSelect: "native"
timeoutInMinutes: 180 timeoutInMinutes: 180
pool: pool:
vmImage: $(imageName) 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: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: $(pythonVersion) 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 - task: JavaToolInstaller@0
condition: and(eq(variables['testSelect'], 'android'), eq(variables['Agent.OS'], 'Linux')) condition: and(eq(variables['testSelect'], 'android'), eq(variables['Agent.OS'], 'Linux'))
inputs: inputs:
+29 -37
View File
@@ -15,8 +15,6 @@ parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--schemastore", action="store_true", help="Generate schema_store version") parser.add_argument("--schemastore", action="store_true", help="Generate schema_store version")
args = parser.parse_args() 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 = """ starter = """
$schema: http://json-schema.org/draft-07/schema# $schema: http://json-schema.org/draft-07/schema#
$id: https://github.com/pypa/cibuildwheel/blob/main/cibuildwheel/resources/cibuildwheel.schema.json $id: https://github.com/pypa/cibuildwheel/blob/main/cibuildwheel/resources/cibuildwheel.schema.json
@@ -40,28 +38,6 @@ additionalProperties: false
description: cibuildwheel's settings. description: cibuildwheel's settings.
type: object type: object
properties: properties:
inherit:
type: object
additionalProperties: false
properties:
audit-command: {"$ref": "#/$defs/inherit"}
audit-requires: {"$ref": "#/$defs/inherit"}
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"}
environment: {"$ref": "#/$defs/inherit"}
environment-pass: {"$ref": "#/$defs/inherit"}
repair-wheel-command: {"$ref": "#/$defs/inherit"}
test-command: {"$ref": "#/$defs/inherit"}
test-extras: {"$ref": "#/$defs/inherit"}
test-sources: {"$ref": "#/$defs/inherit"}
test-requires: {"$ref": "#/$defs/inherit"}
test-environment: {"$ref": "#/$defs/inherit"}
test-runtime: {"$ref": "#/$defs/inherit"}
audit-command: audit-command:
description: Execute a shell command to audit each wheel after it is repaired. Use {wheel} for each wheel path, or {abi3_wheel} to only audit abi3 wheels. description: Execute a shell command to audit each wheel after it is repaired. Use {wheel} for each wheel path, or {abi3_wheel} to only audit abi3 wheels.
type: string_array type: string_array
@@ -224,9 +200,6 @@ properties:
xbuild-tools: xbuild-tools:
description: Binaries on the path that should be included in an isolated cross-build environment description: Binaries on the path that should be included in an isolated cross-build environment
type: string_array type: string_array
xbuild-files:
description: Platform-specific files in the build environment
type: string_table_array
pyodide-version: pyodide-version:
type: string type: string
description: Specify the version of Pyodide to use description: Specify the version of Pyodide to use
@@ -337,6 +310,27 @@ items:
additionalProperties: false additionalProperties: false
properties: properties:
select: {} select: {}
inherit:
type: object
additionalProperties: false
properties:
audit-command: {"$ref": "#/$defs/inherit"}
audit-requires: {"$ref": "#/$defs/inherit"}
before-all: {"$ref": "#/$defs/inherit"}
before-build: {"$ref": "#/$defs/inherit"}
xbuild-tools: {"$ref": "#/$defs/inherit"}
before-test: {"$ref": "#/$defs/inherit"}
config-settings: {"$ref": "#/$defs/inherit"}
container-engine: {"$ref": "#/$defs/inherit"}
environment: {"$ref": "#/$defs/inherit"}
environment-pass: {"$ref": "#/$defs/inherit"}
repair-wheel-command: {"$ref": "#/$defs/inherit"}
test-command: {"$ref": "#/$defs/inherit"}
test-extras: {"$ref": "#/$defs/inherit"}
test-sources: {"$ref": "#/$defs/inherit"}
test-requires: {"$ref": "#/$defs/inherit"}
test-environment: {"$ref": "#/$defs/inherit"}
test-runtime: {"$ref": "#/$defs/inherit"}
""" """
) )
@@ -380,16 +374,14 @@ oses = {
"ios": as_object(not_linux), "ios": as_object(not_linux),
} }
for os_name, command in [ oses["linux"]["properties"]["repair-wheel-command"] = {
("linux", "auditwheel repair -w {dest_dir} {wheel}"), **schema["properties"]["repair-wheel-command"],
("windows", "delvewheel repair -w {dest_dir} -v {wheel}"), "default": "auditwheel repair -w {dest_dir} {wheel}",
("macos", "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"), }
("android", "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"), oses["macos"]["properties"]["repair-wheel-command"] = {
]: **schema["properties"]["repair-wheel-command"],
oses[os_name]["properties"]["repair-wheel-command"] = { "default": "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
**schema["properties"]["repair-wheel-command"], }
"default": command,
}
del oses["linux"]["properties"]["dependency-versions"] del oses["linux"]["properties"]["dependency-versions"]
+3 -7
View File
@@ -3,7 +3,6 @@
# /// script # /// script
# dependencies = [ # dependencies = [
# "click", # "click",
# "jinja2",
# ] # ]
# /// # ///
@@ -40,16 +39,13 @@ def generate_project(path: Path, build_backend: BuildBackend) -> None:
sys.path.insert(0, "") sys.path.insert(0, "")
match build_backend: match build_backend:
case "meson": case "meson":
from test.test_projects.meson import new_meson_project # noqa: PLC0415 from test.test_projects.meson import new_meson_project as new_project # noqa: PLC0415
project = new_meson_project()
case "setuptools": case "setuptools":
from test.test_projects.setuptools import new_c_project # noqa: PLC0415 from test.test_projects.setuptools import new_c_project as new_project # noqa: PLC0415
project = new_c_project()
case _: case _:
typing.assert_never(build_backend) typing.assert_never(build_backend)
project = new_project()
project.generate(path) project.generate(path)
+20 -27
View File
@@ -124,22 +124,14 @@ class GraalPyVersions:
response.raise_for_status() response.raise_for_status()
releases = response.json() releases = response.json()
gp_asset_re = re.compile( gp_version_re = re.compile(r"-(\d+\.\d+\.\d+)$")
r"^(?P<prefix>graalpy(?P<cpython>\d+\.\d+)?-(?P<graalpy>\d+\.\d+\.\d+))-"
)
cp_version_re = re.compile(r"Python (\d+\.\d+(?:\.\d+)?)") cp_version_re = re.compile(r"Python (\d+\.\d+(?:\.\d+)?)")
for release in releases: for release in releases:
for asset in release["assets"]: m = gp_version_re.search(release["tag_name"])
m = gp_asset_re.match(asset["name"]) if m:
if m: release["graalpy_version"] = Version(m.group(1))
release["asset_prefix"] = m.group("prefix") m = cp_version_re.search(release["body"])
release["graalpy_version"] = Version(m.group("graalpy")) if m:
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)) release["python_version"] = Version(m.group(1))
self.releases = [r for r in releases if "graalpy_version" in r and "python_version" in r] self.releases = [r for r in releases if "graalpy_version" in r and "python_version" in r]
@@ -166,6 +158,10 @@ class GraalPyVersions:
msg = f"GraalPy {arch} not found for {spec}!" msg = f"GraalPy {arch} not found for {spec}!"
raise RuntimeError(msg) raise RuntimeError(msg)
release = releases[-1]
version = release["python_version"]
gpversion = release["graalpy_version"]
if "macosx" in identifier: if "macosx" in identifier:
arch = "x86_64" if "x86_64" in identifier else "arm64" arch = "x86_64" if "x86_64" in identifier else "arm64"
platform = "macos" platform = "macos"
@@ -178,19 +174,15 @@ class GraalPyVersions:
arch = "amd64" if arch == "x86_64" else "aarch64" arch = "amd64" if arch == "x86_64" else "aarch64"
ext = "zip" if "win" in identifier else "tar.gz" ext = "zip" if "win" in identifier else "tar.gz"
for release in reversed(releases): urls = [
version = release["python_version"] rf["browser_download_url"]
urls = [ for rf in release["assets"]
rf["browser_download_url"] if rf["name"].endswith(f"{platform}-{arch}.{ext}")
for rf in release["assets"] and rf["name"].startswith(f"graalpy-{gpversion.major}")
if rf["name"].endswith(f"{platform}-{arch}.{ext}") ]
and rf["name"].startswith(release["asset_prefix"]) if urls:
]
if not urls:
continue
(url,) = urls (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 = ""
sha256_asset_name = url.rsplit("/", 1)[-1] + ".sha256" sha256_asset_name = url.rsplit("/", 1)[-1] + ".sha256"
sha256_urls = [ sha256_urls = [
@@ -208,7 +200,6 @@ class GraalPyVersions:
url=url, url=url,
sha256=sha256, sha256=sha256,
) )
return None return None
@@ -503,6 +494,8 @@ class AllVersions:
elif "macosx_arm64" in identifier: elif "macosx_arm64" in identifier:
config_update = self.macos_pypy_arm64.update_version_macos(spec) config_update = self.macos_pypy_arm64.update_version_macos(spec)
elif identifier.startswith("gp"): elif identifier.startswith("gp"):
if "macosx_x86_64" in identifier:
return
config_update = self.graalpy.update_version(identifier, spec) config_update = self.graalpy.update_version(identifier, spec)
elif "t-win32" in identifier and identifier.startswith("cp"): elif "t-win32" in identifier and identifier.startswith("cp"):
config_update = self.windows_t_32.update_version_windows(spec) 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: else:
version = local_version version = local_version
url = default["url"] url = default["url"]
sha256 = default["sha256"] sha256 = default.get("sha256", "")
# Compute sha256 if not already stored (new version or first-time population) # Compute sha256 if not already stored (new version or first-time population)
if not sha256: if not sha256:
@@ -117,7 +117,7 @@ def update_virtualenv(force: bool, level: str) -> None:
"sha256": sha256, "sha256": sha256,
} }
result_toml = "".join( result_toml = "".join(
f'{key} = {{ version = "{value["version"]}", url = "{value["url"]}", sha256 = "{value["sha256"]}" }}\n' f'{key} = {{ version = "{value["version"]}", url = "{value["url"]}", sha256 = "{value.get("sha256", "")}" }}\n'
for key, value in configurations.items() for key, value in configurations.items()
) )
+1 -1
View File
@@ -1 +1 @@
__version__ = "4.1.0" __version__ = "4.0.0rc1"
+22 -32
View File
@@ -1,35 +1,9 @@
from __future__ import annotations 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 argparse
import contextlib import contextlib
import dataclasses import dataclasses
import functools import functools
import io
import os import os
import shutil import shutil
import sys import sys
@@ -56,7 +30,7 @@ from cibuildwheel.util.resources import read_all_configs
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from collections.abc import Generator, Iterable, Sequence from collections.abc import Generator, Iterable, Sequence
from typing import Literal from typing import Any, Literal, TextIO
@dataclasses.dataclass @dataclasses.dataclass
@@ -70,6 +44,23 @@ class FileReport:
size: str 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: def main() -> None:
global_options = GlobalOptions() global_options = GlobalOptions()
try: try:
@@ -369,11 +360,10 @@ def build_in_directory(args: CommandLineArguments) -> None:
# Add CIBUILDWHEEL environment variable # Add CIBUILDWHEEL environment variable
os.environ["CIBUILDWHEEL"] = "1" os.environ["CIBUILDWHEEL"] = "1"
# Python block-buffers stdout when it isn't a tty, which de-interleaves # Python is buffering by default when running on the CI platforms, giving
# `print` output and direct fd-1 writes from subprocesses sharing this # problems interleaving subprocess call output with unflushed calls to
# stdout. line_buffering allows each newline to flush all the way to fd-1. # 'print'
if isinstance(sys.stdout, io.TextIOWrapper): sys.stdout = Unbuffered(sys.stdout)
sys.stdout.reconfigure(line_buffering=True)
# create the cache dir before it gets printed & builds performed # create the cache dir before it gets printed & builds performed
CIBW_CACHE_PATH.mkdir(parents=True, exist_ok=True) CIBW_CACHE_PATH.mkdir(parents=True, exist_ok=True)
+4 -22
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"platform", "re", "shutil", "subprocess"}
import platform as platform_module import platform as platform_module
import re import re
import shutil import shutil
@@ -107,29 +105,13 @@ class Architecture(StrEnum):
case "auto32": case "auto32":
result |= cls.bitness_archs(platform=platform, bitness="32") result |= cls.bitness_archs(platform=platform, bitness="32")
case _: case _:
if arch := cls._parse_arch_name(arch_str, platform=platform): try:
result.add(arch) result.add(cls(arch_str))
else: except ValueError as e:
msg = f"Invalid architecture '{arch_str}'" msg = f"Invalid architecture '{arch_str}'"
raise errors.ConfigurationError(msg) raise errors.ConfigurationError(msg) from e
return result 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 @classmethod
def native_arch(cls, platform: PlatformName) -> Self | None: def native_arch(cls, platform: PlatformName) -> Self | None:
native_machine = platform_module.machine() native_machine = platform_module.machine()
-11
View File
@@ -1,16 +1,5 @@
from __future__ import annotations 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 subprocess
import sys import sys
from pathlib import Path from pathlib import Path
-2
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"bashlex", "subprocess"}
import dataclasses import dataclasses
import subprocess import subprocess
-2
View File
@@ -1,5 +1,3 @@
__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers"}
import os import os
import re import re
from enum import Enum from enum import Enum
-2
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"bashlex", "bashlex.errors"}
import dataclasses import dataclasses
from typing import Protocol from typing import Protocol
-18
View File
@@ -4,8 +4,6 @@ a different return code, by defining them all here, we can ensure that they're
semantically clear and unique. semantically clear and unique.
""" """
__lazy_modules__ = {"textwrap"}
import textwrap import textwrap
@@ -111,19 +109,3 @@ class AuditCommandFailedError(FatalError):
def __init__(self, message: str) -> None: def __init__(self, message: str) -> None:
super().__init__(message) super().__init__(message)
self.return_code = 9 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
+1 -3
View File
@@ -4,8 +4,6 @@ These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"io", "json", "urllib", "urllib.error", "urllib.request"}
import json import json
import time import time
import typing import typing
@@ -105,7 +103,7 @@ class PyodideXBuildEnvInfo(typing.TypedDict):
def get_pyodide_xbuildenv_info() -> PyodideXBuildEnvInfo: def get_pyodide_xbuildenv_info() -> PyodideXBuildEnvInfo:
xbuildenv_info_url = ( xbuildenv_info_url = (
"https://pyodide.github.io/pyodide/api/v2/pyodide-cross-build-environments.json" "https://pyodide.github.io/pyodide/api/pyodide-cross-build-environments.json"
) )
with urllib.request.urlopen(xbuildenv_info_url) as response: with urllib.request.urlopen(xbuildenv_info_url) as response:
return typing.cast("PyodideXBuildEnvInfo", json.loads(response.read().decode("utf-8"))) return typing.cast("PyodideXBuildEnvInfo", json.loads(response.read().decode("utf-8")))
+1 -13
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers", "shlex"}
import dataclasses import dataclasses
import shlex import shlex
import typing import typing
@@ -64,17 +62,7 @@ def _split_config_settings(config_settings: str) -> list[str]:
def prepare_config_settings(config_settings: str, *, project: PathOrStr, package: PathOrStr) -> str: def prepare_config_settings(config_settings: str, *, project: PathOrStr, package: PathOrStr) -> str:
# Substitute the {project}/{package} placeholders on each already-split return prepare_command(config_settings, project=project, package=package)
# 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. # Based on build.__main__.main.
+2 -14
View File
@@ -1,17 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.ci",
"contextlib",
"functools",
"hashlib",
"humanize",
"io",
"pathlib",
"re",
"textwrap",
}
import codecs import codecs
import contextlib import contextlib
import dataclasses import dataclasses
@@ -375,11 +363,11 @@ class Logger:
out.write("\n") out.write("\n")
return out.getvalue() return out.getvalue()
@functools.cached_property @property
def colors(self) -> Colors: def colors(self) -> Colors:
return Colors(enabled=self.colors_enabled) return Colors(enabled=self.colors_enabled)
@functools.cached_property @property
def symbols(self) -> Symbols: def symbols(self) -> Symbols:
return Symbols(unicode=self.unicode_enabled) return Symbols(unicode=self.unicode_enabled)
+45 -108
View File
@@ -1,24 +1,5 @@
from __future__ import annotations 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 dataclasses
import io import io
import json import json
@@ -225,6 +206,7 @@ class OCIContainer:
UTILITY_PYTHON = "/opt/python/cp39-cp39/bin/python" UTILITY_PYTHON = "/opt/python/cp39-cp39/bin/python"
process: subprocess.Popen[bytes]
bash_stdin: IO[bytes] bash_stdin: IO[bytes]
bash_stdout: IO[bytes] bash_stdout: IO[bytes]
@@ -244,7 +226,6 @@ class OCIContainer:
self.oci_platform = oci_platform self.oci_platform = oci_platform
self.cwd = cwd self.cwd = cwd
self.name: str | None = None self.name: str | None = None
self.process: subprocess.Popen[bytes] | None = None
self.engine = engine self.engine = engine
self.host_tar_format = "" self.host_tar_format = ""
if sys.platform.startswith("darwin"): if sys.platform.startswith("darwin"):
@@ -276,12 +257,10 @@ class OCIContainer:
# this allows to run local only images # this allows to run local only images
pull = "never" pull = "never"
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
# silently fallback to "--pull=always"
pass pass
return f"--platform={oci_platform.value}", f"--pull={pull}" return f"--platform={oci_platform.value}", f"--pull={pull}"
def __enter__(self) -> Self: def __enter__(self) -> Self:
assert self.process is None
self.name = f"cibuildwheel-{uuid.uuid4()}" self.name = f"cibuildwheel-{uuid.uuid4()}"
_check_engine_version(self.engine) _check_engine_version(self.engine)
@@ -317,17 +296,7 @@ class OCIContainer:
).strip() ).strip()
else: else:
raise raise
if container_machine not in {"i686", "armv7l", "armv8l"}: simulate_32_bit = 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"] shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"]
@@ -349,41 +318,32 @@ class OCIContainer:
check=True, check=True,
) )
try: self.process = subprocess.Popen(
self.process = subprocess.Popen( [
[ self.engine.name,
self.engine.name, "start",
"start", "--attach",
"--attach", "--interactive",
"--interactive", self.name,
self.name, ],
], stdin=subprocess.PIPE,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stdout=subprocess.PIPE, )
)
assert self.process.stdin assert self.process.stdin
assert self.process.stdout assert self.process.stdout
self.bash_stdin = self.process.stdin self.bash_stdin = self.process.stdin
self.bash_stdout = self.process.stdout self.bash_stdout = self.process.stdout
# run a noop command to block until the container is responding # run a noop command to block until the container is responding
self.call(["/bin/true"], cwd="/") 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="/")
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 return self
def __exit__( def __exit__(
@@ -392,52 +352,29 @@ class OCIContainer:
exc_val: BaseException | None, exc_val: BaseException | None,
exc_tb: TracebackType | None, exc_tb: TracebackType | None,
) -> None: ) -> None:
assert self.process is not None self.bash_stdin.write(b"exit 0\n")
try: self.bash_stdin.flush()
# Ask bash to exit cleanly and wait for the `start` process to finish. self.process.wait(timeout=30)
# If the container/bash has already died, the write raises self.bash_stdin.close()
# BrokenPipeError; if bash refuses to exit, `wait` raises self.bash_stdout.close()
# 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": if self.engine.name == "podman":
# This works around what seems to be a race condition in the # This works around what seems to be a race condition in the podman
# podman backend. The full reason is not understood. See PR #966 # backend. The full reason is not understood. See PR #966 for a
# for a discussion on possible causes and attempts to remove this # discussion on possible causes and attempts to remove this line.
# line. For now, this seems to work "well enough". # For now, this seems to work "well enough".
self.process.wait() 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
keep_container = strtobool(os.environ.get("CIBW_DEBUG_KEEP_CONTAINER", "")) assert isinstance(self.name, str)
if not keep_container:
self._remove_container()
def _remove_container(self) -> None: keep_container = strtobool(os.environ.get("CIBW_DEBUG_KEEP_CONTAINER", ""))
assert self.name is not None if not keep_container:
result = subprocess.run( subprocess.run(
[self.engine.name, "rm", "--force", "-v", self.name], [self.engine.name, "rm", "--force", "-v", self.name],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
check=False, check=False,
) )
# only warn when not running in CI self.name = None
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: def copy_into(self, from_path: Path, to_path: PurePath) -> None:
if from_path.is_dir(): if from_path.is_dir():
+57 -163
View File
@@ -1,29 +1,5 @@
from __future__ import annotations 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 collections
import configparser import configparser
import contextlib import contextlib
@@ -50,13 +26,7 @@ from cibuildwheel.projectfiles import get_requires_python_str, resolve_dependenc
from cibuildwheel.selector import BuildSelector, EnableGroup, TestSelector, selector_matches from cibuildwheel.selector import BuildSelector, EnableGroup, TestSelector, selector_matches
from cibuildwheel.typing import PLATFORMS, PlatformName from cibuildwheel.typing import PLATFORMS, PlatformName
from cibuildwheel.util import resources from cibuildwheel.util import resources
from cibuildwheel.util.helpers import ( from cibuildwheel.util.helpers import format_safe, parse_key_value_string, strtobool, unwrap
format_safe,
parse_arbitrary_key_value_string,
parse_key_value_string,
strtobool,
unwrap,
)
from cibuildwheel.util.packaging import DependencyConstraints from cibuildwheel.util.packaging import DependencyConstraints
TYPE_CHECKING = False TYPE_CHECKING = False
@@ -150,7 +120,6 @@ class BuildOptions:
before_all: str before_all: str
before_build: str | None before_build: str | None
xbuild_tools: list[str] | None xbuild_tools: list[str] | None
xbuild_files: dict[str, list[str]]
repair_command: str repair_command: str
manylinux_images: dict[str, str] | None manylinux_images: dict[str, str] | None
musllinux_images: dict[str, str] | None musllinux_images: dict[str, str] | None
@@ -442,28 +411,6 @@ def _stringify_setting(
return setting return setting
def parse_inherit(config: str | dict[str, str] | None) -> dict[str, InheritRule]:
inherit_dict: dict[str, str]
if config is None:
return {}
if isinstance(config, str):
parsed = parse_arbitrary_key_value_string(config, default_value="append")
inherit_dict = {k: "".join(v) for k, v in parsed.items()}
elif isinstance(config, dict):
inherit_dict = config
else:
msg = "'inherit' must be a string or a table"
raise OptionsReaderError(msg)
if not all(v in {"none", "append", "prepend"} for v in inherit_dict.values()):
msg = "'inherit' must contain only {'none', 'append', 'prepend'} values"
raise OptionsReaderError(msg)
return {k: InheritRule[v.upper()] for k, v in inherit_dict.items()}
class OptionsReader: class OptionsReader:
""" """
Gets options from the environment, config or defaults, optionally scoped Gets options from the environment, config or defaults, optionally scoped
@@ -512,18 +459,45 @@ class OptionsReader:
self._validate_platform_option(option_name) self._validate_platform_option(option_name)
self.config_options = config_options self.config_options = config_options
self.config_options_inherit = parse_inherit(config_options.get("inherit"))
self.config_platform_options = config_platform_options self.config_platform_options = config_platform_options
self.config_platform_options_inherit = parse_inherit(config_platform_options.get("inherit"))
self.overrides: list[Override] = []
self.current_identifier: str | None = None self.current_identifier: str | None = None
config_overrides = self.config_options.get("overrides")
if config_overrides is not None:
if not isinstance(config_overrides, list):
msg = "'tool.cibuildwheel.overrides' must be a list"
raise OptionsReaderError(msg)
for config_override in config_overrides:
select = config_override.pop("select", None)
if not select:
msg = "'select' must be set in an override"
raise OptionsReaderError(msg)
if isinstance(select, list):
select = " ".join(select)
inherit = config_override.pop("inherit", {})
if not isinstance(inherit, dict) or not all(
i in {"none", "append", "prepend"} for i in inherit.values()
):
msg = "'inherit' must be a dict containing only {'none', 'append', 'prepend'} values"
raise OptionsReaderError(msg)
inherit_enum = {k: InheritRule[v.upper()] for k, v in inherit.items()}
self.overrides.append(Override(select, config_override, inherit_enum))
def _validate_global_option(self, name: str) -> None: def _validate_global_option(self, name: str) -> None:
""" """
Raises an error if an option with this name is not allowed in the Raises an error if an option with this name is not allowed in the
[tool.cibuildwheel] section of a config file. [tool.cibuildwheel] section of a config file.
""" """
allowed_option_names = self.default_options.keys() | PLATFORMS | {"inherit", "overrides"} allowed_option_names = self.default_options.keys() | PLATFORMS | {"overrides"}
if name not in allowed_option_names: if name not in allowed_option_names:
msg = f"Option {name!r} not supported in a config file." msg = f"Option {name!r} not supported in a config file."
@@ -542,9 +516,7 @@ class OptionsReader:
msg = f"{name!r} is not allowed in {disallowed_platform_options}" msg = f"{name!r} is not allowed in {disallowed_platform_options}"
raise OptionsReaderError(msg) raise OptionsReaderError(msg)
allowed_option_names = ( allowed_option_names = self.default_options.keys() | self.default_platform_options.keys()
self.default_options.keys() | self.default_platform_options.keys() | {"inherit"}
)
if name not in allowed_option_names: if name not in allowed_option_names:
msg = f"Option {name!r} not supported in the {self.platform!r} section" msg = f"Option {name!r} not supported in the {self.platform!r} section"
@@ -565,56 +537,6 @@ class OptionsReader:
return global_options, platform_options return global_options, platform_options
@functools.cached_property
def overrides(self) -> list[Override]:
config_overrides = self.config_options.get("overrides")
overrides: list[Override] = []
if config_overrides is not None:
if not isinstance(config_overrides, list):
msg = "'tool.cibuildwheel.overrides' must be a list"
raise OptionsReaderError(msg)
for config_override in config_overrides:
select = config_override.pop("select", None)
if not select:
msg = "'select' must be set in an override"
raise OptionsReaderError(msg)
if isinstance(select, list):
select = " ".join(select)
inherit = config_override.pop("inherit", {})
overrides.append(Override(select, config_override, parse_inherit(inherit)))
return overrides
@functools.cached_property
def env_inherit(self) -> dict[str, InheritRule]:
env_inherit_str = self.env.get("CIBW_INHERIT", "")
try:
return parse_inherit(env_inherit_str)
except OptionsReaderError as e:
msg = f"Failed to parse CIBW_INHERIT environment variable. {e}"
raise errors.ConfigurationError(msg) from e
@functools.cached_property
def env_platform_inherit(self) -> dict[str, InheritRule]:
env_inherit = self.env_inherit
# find the rules which have -{platform} on the end of their key,
# remove the platform suffix from the key and return the resulting
# rule.
platform_suffix = f"-{self.platform}"
return {
key.removesuffix(platform_suffix): value
for key, value in env_inherit.items()
if key.endswith(platform_suffix)
}
@property @property
def active_config_overrides(self) -> list[Override]: def active_config_overrides(self) -> list[Override]:
if self.current_identifier is None: if self.current_identifier is None:
@@ -638,7 +560,7 @@ class OptionsReader:
env_plat: bool = True, env_plat: bool = True,
option_format: OptionFormat | None = None, option_format: OptionFormat | None = None,
ignore_empty: bool = False, ignore_empty: bool = False,
default_env_rule: InheritRule = InheritRule.NONE, env_rule: InheritRule = InheritRule.NONE,
) -> str: ) -> str:
""" """
Get and return the value for the named option from environment, Get and return the value for the named option from environment,
@@ -662,37 +584,16 @@ class OptionsReader:
# get the option from the default, then the config file, then finally the environment. # get the option from the default, then the config file, then finally the environment.
# platform-specific options are preferred, if they're allowed. # platform-specific options are preferred, if they're allowed.
return _resolve_cascade( return _resolve_cascade(
( (self.default_options.get(name), InheritRule.NONE),
self.default_options.get(name), (self.default_platform_options.get(name), InheritRule.NONE),
InheritRule.NONE, (self.config_options.get(name), InheritRule.NONE),
), (self.config_platform_options.get(name), InheritRule.NONE),
(
self.default_platform_options.get(name),
InheritRule.NONE,
),
(
self.config_options.get(name),
self.config_options_inherit.get(name, InheritRule.NONE),
),
(
self.config_platform_options.get(name),
self.config_platform_options_inherit.get(name, InheritRule.NONE),
),
*[ *[
( (o.options.get(name), o.inherit.get(name, InheritRule.NONE))
o.options.get(name),
o.inherit.get(name, InheritRule.NONE),
)
for o in self.active_config_overrides for o in self.active_config_overrides
], ],
( (self.env.get(envvar), env_rule),
self.env.get(envvar), (self.env.get(plat_envvar) if env_plat else None, env_rule),
self.env_inherit.get(name, default_env_rule),
),
(
self.env.get(plat_envvar) if env_plat else None,
self.env_platform_inherit.get(name, default_env_rule),
),
ignore_empty=ignore_empty, ignore_empty=ignore_empty,
option_format=option_format, option_format=option_format,
) )
@@ -765,10 +666,7 @@ class Options:
allow_empty = args.allow_empty or strtobool(self.env.get("CIBW_ALLOW_EMPTY", "0")) allow_empty = args.allow_empty or strtobool(self.env.get("CIBW_ALLOW_EMPTY", "0"))
enable_groups = self.reader.get( enable_groups = self.reader.get(
"enable", "enable", env_plat=False, option_format=ListFormat(sep=" "), env_rule=InheritRule.APPEND
env_plat=False,
option_format=ListFormat(sep=" "),
default_env_rule=InheritRule.APPEND,
) )
try: try:
enable = { enable = {
@@ -874,13 +772,6 @@ class Options:
if xbuild_tools == ["\u0000"]: if xbuild_tools == ["\u0000"]:
xbuild_tools = None xbuild_tools = None
xbuild_files = parse_arbitrary_key_value_string(
self.reader.get(
"xbuild-files",
option_format=ShlexTableFormat(sep="; ", pair_sep=":", allow_merge=False),
),
)
test_sources = shlex.split( test_sources = shlex.split(
self.reader.get( self.reader.get(
"test-sources", option_format=ListFormat(sep=" ", quote=shlex.quote) "test-sources", option_format=ListFormat(sep=" ", quote=shlex.quote)
@@ -909,11 +800,9 @@ class Options:
msg = f"Failed to parse test runtime config. {e}" msg = f"Failed to parse test runtime config. {e}"
raise errors.ConfigurationError(msg) from e raise errors.ConfigurationError(msg) from e
test_requires = shlex.split( test_requires = self.reader.get(
self.reader.get( "test-requires", option_format=ListFormat(sep=" ")
"test-requires", option_format=ListFormat(sep=" ", quote=shlex.quote) ).split()
)
)
test_extras = self.reader.get("test-extras", option_format=ListFormat(sep=",")) 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_str = self.reader.get("test-groups", option_format=ListFormat(sep=" "))
test_groups = [x for x in test_groups_str.split() if x] test_groups = [x for x in test_groups_str.split() if x]
@@ -982,7 +871,11 @@ class Options:
f"manylinux-{build_platform}-image", ignore_empty=True f"manylinux-{build_platform}-image", ignore_empty=True
) )
self._check_pinned_image(config_value, pinned_images) self._check_pinned_image(config_value, pinned_images)
manylinux_images[build_platform] = pinned_images.get(config_value, config_value) if config_value in pinned_images:
image = pinned_images[config_value]
else:
image = config_value
manylinux_images[build_platform] = image
for build_platform in MUSLLINUX_ARCHS: for build_platform in MUSLLINUX_ARCHS:
pinned_images = all_pinned_container_images[build_platform] pinned_images = all_pinned_container_images[build_platform]
@@ -990,7 +883,11 @@ class Options:
f"musllinux-{build_platform}-image", ignore_empty=True f"musllinux-{build_platform}-image", ignore_empty=True
) )
self._check_pinned_image(config_value, pinned_images) self._check_pinned_image(config_value, pinned_images)
musllinux_images[build_platform] = pinned_images.get(config_value, config_value) if config_value in pinned_images:
image = pinned_images[config_value]
else:
image = config_value
musllinux_images[build_platform] = image
container_engine_str = self.reader.get( container_engine_str = self.reader.get(
"container-engine", "container-engine",
@@ -1010,11 +907,9 @@ class Options:
) )
audit_command = audit_command_str.split(" && ") if audit_command_str else [] audit_command = audit_command_str.split(" && ") if audit_command_str else []
audit_requires = shlex.split( audit_requires = self.reader.get(
self.reader.get( "audit-requires", option_format=ListFormat(sep=" ")
"audit-requires", option_format=ListFormat(sep=" ", quote=shlex.quote) ).split()
)
)
return BuildOptions( return BuildOptions(
globals=self.globals, globals=self.globals,
@@ -1030,7 +925,6 @@ class Options:
before_all=before_all, before_all=before_all,
build_verbosity=build_verbosity, build_verbosity=build_verbosity,
xbuild_tools=xbuild_tools, xbuild_tools=xbuild_tools,
xbuild_files=xbuild_files,
repair_command=repair_command, repair_command=repair_command,
environment=environment, environment=environment,
dependency_constraints=dependency_constraints, dependency_constraints=dependency_constraints,
+186 -186
View File
@@ -1,41 +1,16 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = { import csv
"build", import hashlib
"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 os
import platform import platform
import re import re
import shlex import shlex
import shutil import shutil
import subprocess import subprocess
import sys import sysconfig
from dataclasses import dataclass from dataclasses import dataclass
from os.path import relpath
from pathlib import Path from pathlib import Path
from pprint import pprint from pprint import pprint
from runpy import run_path from runpy import run_path
@@ -44,8 +19,9 @@ from typing import Any
from build import ProjectBuilder from build import ProjectBuilder
from build.env import IsolatedEnv from build.env import IsolatedEnv
from elftools.common.exceptions import ELFError
from elftools.elf.elffile import ELFFile
from filelock import FileLock from filelock import FileLock
from packaging.utils import canonicalize_name
from cibuildwheel import errors, platforms # pylint: disable=cyclic-import from cibuildwheel import errors, platforms # pylint: disable=cyclic-import
from cibuildwheel.architecture import Architecture, arch_synonym from cibuildwheel.architecture import Architecture, arch_synonym
@@ -58,13 +34,7 @@ from cibuildwheel.frontend import (
from cibuildwheel.logger import log from cibuildwheel.logger import log
from cibuildwheel.util import resources from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell from cibuildwheel.util.cmd import call, shell
from cibuildwheel.util.file import ( from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
CIBW_CACHE_PATH,
copy_test_sources,
download,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command from cibuildwheel.util.helpers import prepare_command
from cibuildwheel.util.packaging import find_compatible_wheel from cibuildwheel.util.packaging import find_compatible_wheel
from cibuildwheel.util.python_build_standalone import create_python_build_standalone_environment from cibuildwheel.util.python_build_standalone import create_python_build_standalone_environment
@@ -72,9 +42,10 @@ from cibuildwheel.venv import constraint_flags, find_uv, virtualenv
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from collections.abc import Iterable, Iterator, MutableMapping
from cibuildwheel.options import BuildOptions, Options from cibuildwheel.options import BuildOptions, Options
from cibuildwheel.selector import BuildSelector from cibuildwheel.selector import BuildSelector
from cibuildwheel.typing import PathOrStr
RESOURCES_ANDROID = resources.PATH / "android" RESOURCES_ANDROID = resources.PATH / "android"
ANDROID_TRIPLET = { ANDROID_TRIPLET = {
@@ -101,7 +72,7 @@ class PythonConfiguration:
version: str version: str
identifier: str identifier: str
url: str url: str
sha256: str sha256: str = ""
@property @property
def arch(self) -> str: def arch(self) -> str:
@@ -175,11 +146,9 @@ def build(options: Options, tmp_path: Path) -> None:
build_path.mkdir() build_path.mkdir()
python_dir = setup_target_python(config, build_path) python_dir = setup_target_python(config, build_path)
build_env, android_env = setup_env(config, build_options, build_path, python_dir) build_env, android_env = setup_env(config, build_options, build_path, python_dir)
state = BuildState( state = BuildState(
config, build_options, build_path, python_dir, build_env, android_env config, build_options, build_path, python_dir, build_env, android_env
) )
setup_xbuild_files(state)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier) compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
if compatible_wheel: if compatible_wheel:
@@ -194,7 +163,7 @@ def build(options: Options, tmp_path: Path) -> None:
repaired_wheel = repair_wheel(state, built_wheel) repaired_wheel = repair_wheel(state, built_wheel)
run_audit(tmp_dir=tmp_path, build_options=build_options, wheel=repaired_wheel) run_audit(tmp_dir=tmp_path, build_options=build_options, wheel=repaired_wheel)
test_wheel(state, repaired_wheel) test_wheel(state, repaired_wheel, build_frontend=build_options.build_frontend.name)
output_wheel: Path | None = None output_wheel: Path | None = None
if compatible_wheel is None: if compatible_wheel is None:
@@ -216,8 +185,7 @@ def setup_target_python(config: PythonConfiguration, build_path: Path) -> Path:
python_tgz = CIBW_CACHE_PATH / config.url.rpartition("/")[-1] python_tgz = CIBW_CACHE_PATH / config.url.rpartition("/")[-1]
with FileLock(f"{python_tgz}.lock"): with FileLock(f"{python_tgz}.lock"):
if not python_tgz.exists(): if not python_tgz.exists():
with remove_on_error(python_tgz): download(config.url, python_tgz, sha256=config.sha256 or None)
download(config.url, python_tgz, sha256=config.sha256)
python_dir = build_path / "python" python_dir = build_path / "python"
python_dir.mkdir() python_dir.mkdir()
@@ -227,11 +195,6 @@ def setup_target_python(config: PythonConfiguration, build_path: Path) -> Path:
# updated to Python versions that include the fix. # updated to Python versions that include the fix.
call("patch", "-p1", "-i", RESOURCES_ANDROID / "android.patch", cwd=python_dir) 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 return python_dir
@@ -245,7 +208,13 @@ def setup_env(
* android_env, which uses the environment while simulating running on Android. * android_env, which uses the environment while simulating running on Android.
""" """
log.step("Setting up build environment...") log.step("Setting up build environment...")
use_uv, pip = find_pip(build_options) 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"]
# Create virtual environment # Create virtual environment
python_exe = create_python_build_standalone_environment( python_exe = create_python_build_standalone_environment(
@@ -260,12 +229,8 @@ def setup_env(
) )
create_cmake_toolchain(config, build_path, python_dir, build_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 # Apply custom environment variables, and check environment is still valid
build_env = build_options.environment.as_dictionary(build_env) build_env = build_options.environment.as_dictionary(build_env)
build_env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
build_env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1" build_env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
for command in ["python"] if use_uv else ["python", "pip"]: for command in ["python"] if use_uv else ["python", "pip"]:
command_path = call("which", command, env=build_env, capture_stdout=True).strip() command_path = call("which", command, env=build_env, capture_stdout=True).strip()
@@ -281,14 +246,14 @@ def setup_env(
else: else:
call(command, "--version", env=build_env) call(command, "--version", env=build_env)
# Install build tools
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. # Construct an altered environment which simulates running on Android.
android_env = setup_android_env(config, python_dir, build_env) 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)
# Build-time requirements must be queried within android_env, because # 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 # `get_requires_for_build` can run arbitrary code in setup.py scripts, which may be
@@ -311,12 +276,7 @@ def setup_env(
call(*pip, "install", *pb.build_system_requires, env=build_env) call(*pip, "install", *pb.build_system_requires, env=build_env)
requires_for_build = pb.get_requires_for_build( requires_for_build = pb.get_requires_for_build(
"wheel", "wheel", parse_config_settings(build_options.config_settings)
parse_config_settings(
prepare_config_settings(
build_options.config_settings, project=".", package=build_options.package_dir
)
),
) )
if requires_for_build: if requires_for_build:
call(*pip, "install", *requires_for_build, env=build_env) call(*pip, "install", *requires_for_build, env=build_env)
@@ -384,11 +344,8 @@ def localized_vars(
final = final.replace(orig_prefix, str(prefix)) final = final.replace(orig_prefix, str(prefix))
if key == "ANDROID_API_LEVEL": if key == "ANDROID_API_LEVEL":
try: if api_level := build_env.get(key):
final = int(build_env[key]) final = int(api_level)
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, # 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 # whether they're replaced by environment variables or combined with them. Even
@@ -411,15 +368,15 @@ def localized_vars(
def setup_android_env( def setup_android_env(
config: PythonConfiguration, python_dir: Path, build_env: dict[str, str] config: PythonConfiguration, python_dir: Path, venv_dir: Path, build_env: dict[str, str]
) -> dict[str, str]: ) -> dict[str, str]:
site_packages = find_site_packages(build_env) site_packages = next(venv_dir.glob("lib/python*/site-packages"))
for suffix in ["pth", "py"]: for suffix in ["pth", "py"]:
shutil.copy(RESOURCES_ANDROID / f"_cross_venv.{suffix}", site_packages) shutil.copy(RESOURCES_ANDROID / f"_cross_venv.{suffix}", site_packages)
sysconfigdata_path = Path( sysconfigdata_path = Path(
shutil.copy( shutil.copy(
glob1(python_dir, "prefix/lib/python*/_sysconfigdata_*.py"), next(python_dir.glob("prefix/lib/python*/_sysconfigdata_*.py")),
site_packages, site_packages,
) )
) )
@@ -438,14 +395,10 @@ def setup_android_env(
# * a key=value string, without quotes # * a key=value string, without quotes
for i, token in enumerate(shlex.split(env_output)): for i, token in enumerate(shlex.split(env_output)):
if i % 2 == 0: if i % 2 == 0:
if token != "export": assert token == "export", token
msg = f"Unexpected output from android.py env: expected 'export', got {token!r}"
raise errors.FatalError(msg)
else: else:
key, sep, value = token.partition("=") key, sep, value = token.partition("=")
if sep != "=": assert sep == "=", token
msg = f"Unexpected output from android.py env: expected 'key=value', got {token!r}"
raise errors.FatalError(msg)
android_env[key] = value android_env[key] = value
# localized_vars cleared the CFLAGS and CXXFLAGS in the sysconfigdata, but most # localized_vars cleared the CFLAGS and CXXFLAGS in the sysconfigdata, but most
@@ -462,17 +415,6 @@ def setup_android_env(
# Cargo target linker needs to be specified after CC is set # Cargo target linker needs to be specified after CC is set
setup_rust(config, python_dir, android_env) 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. # Format the environment so it can be pasted into a shell when debugging.
for key, value in sorted(android_env.items()): for key, value in sorted(android_env.items()):
if os.environ.get(key) != value: if os.environ.get(key) != value:
@@ -481,7 +423,11 @@ def setup_android_env(
return android_env return android_env
def setup_rust(config: PythonConfiguration, python_dir: Path, env: dict[str, str]) -> None: def setup_rust(
config: PythonConfiguration,
python_dir: Path,
env: MutableMapping[str, str],
) -> None:
cargo_target = android_triplet(config.identifier) cargo_target = android_triplet(config.identifier)
# CARGO_BUILD_TARGET is the variable used by Cargo and setuptools_rust # CARGO_BUILD_TARGET is the variable used by Cargo and setuptools_rust
@@ -505,83 +451,13 @@ def setup_rust(config: PythonConfiguration, python_dir: Path, env: dict[str, str
shim_path.chmod(0o755) 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: def before_build(state: BuildState) -> None:
if state.options.before_build: if state.options.before_build:
log.step("Running before_build...") log.step("Running before_build...")
shell_prepared( shell_prepared(
state.options.before_build, state.options.before_build,
build_options=state.options, build_options=state.options,
env=state.android_env, env=state.build_env,
) )
@@ -632,10 +508,15 @@ def build_wheel(state: BuildState) -> Path:
env=state.android_env, env=state.android_env,
) )
case x: case x:
msg = f"Android requires the build frontend to be 'build' or 'uv', not {x!r}" msg = f"Invalid build backend {x!r}"
raise errors.FatalError(msg) 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]
built_wheel = glob1(built_wheel_dir, "*.whl")
if built_wheel.name.endswith("none-any.whl"): if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError() raise errors.NonPlatformWheelError()
return built_wheel return built_wheel
@@ -647,20 +528,9 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
repaired_wheel_dir.mkdir() repaired_wheel_dir.mkdir()
if state.options.repair_command: 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( shell(
prepare_command( prepare_command(
state.options.repair_command, state.options.repair_command,
ldpaths=ldpaths,
wheel=built_wheel, wheel=built_wheel,
dest_dir=repaired_wheel_dir, dest_dir=repaired_wheel_dir,
package=state.options.package_dir, package=state.options.package_dir,
@@ -669,15 +539,14 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
env=state.build_env, env=state.build_env,
) )
else: else:
shutil.move(built_wheel, repaired_wheel_dir) repair_default(state.android_env, built_wheel, repaired_wheel_dir)
repaired_wheels = list(repaired_wheel_dir.glob("*.whl")) repaired_wheels = list(repaired_wheel_dir.glob("*.whl"))
if len(repaired_wheels) == 0: if len(repaired_wheels) == 0:
raise errors.RepairStepProducedNoWheelError() raise errors.RepairStepProducedNoWheelError()
if len(repaired_wheels) != 1: if len(repaired_wheels) != 1:
raise errors.RepairStepProducedMultipleWheelsError( msg = f"{repaired_wheel_dir} contains {len(repaired_wheels)} wheels; expected 1"
[rw.name for rw in repaired_wheels], raise errors.FatalError(msg)
)
repaired_wheel = repaired_wheels[0] repaired_wheel = repaired_wheels[0]
if repaired_wheel.name.endswith("none-any.whl"): if repaired_wheel.name.endswith("none-any.whl"):
@@ -685,12 +554,119 @@ def repair_wheel(state: BuildState, built_wheel: Path) -> Path:
return repaired_wheel return repaired_wheel
def test_wheel(state: BuildState, wheel: Path) -> None: 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:
test_command = state.options.test_command test_command = state.options.test_command
if not (test_command and state.options.test_selector(state.config.identifier)): if not (test_command and state.options.test_selector(state.config.identifier)):
return return
log.step("Testing wheel...") 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") native_arch = arch_synonym(platform.machine(), platforms.native_platform(), "android")
if state.config.arch != native_arch: if state.config.arch != native_arch:
log.warning( log.warning(
@@ -703,17 +679,31 @@ def test_wheel(state: BuildState, wheel: Path) -> None:
shell_prepared( shell_prepared(
state.options.before_test, state.options.before_test,
build_options=state.options, build_options=state.options,
env=state.android_env, env=state.build_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. # Install the wheel and test-requires.
site_packages_dir = state.build_path / "site-packages" site_packages_dir = state.build_path / "site-packages"
site_packages_dir.mkdir() site_packages_dir.mkdir()
pip_install_android( call(
state, *pip,
"install",
"--only-binary=:all:",
*platform_args,
"--target",
site_packages_dir, site_packages_dir,
f"{wheel}{state.options.test_extras}", f"{wheel}{state.options.test_extras}",
*state.options.test_requires, *state.options.test_requires,
env=state.android_env,
) )
# Copy test-sources. # Copy test-sources.
@@ -783,3 +773,13 @@ def test_wheel(state: BuildState, wheel: Path) -> None:
*test_args, *test_args,
env=state.build_env, 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,
)
+14 -62
View File
@@ -1,28 +1,5 @@
from __future__ import annotations 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 dataclasses
import os import os
import platform import platform
@@ -48,13 +25,7 @@ from cibuildwheel.logger import log
from cibuildwheel.platforms.macos import install_cpython as install_build_cpython from cibuildwheel.platforms.macos import install_cpython as install_build_cpython
from cibuildwheel.util import resources from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell, split_command from cibuildwheel.util.cmd import call, shell, split_command
from cibuildwheel.util.file import ( from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
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.helpers import prepare_command, unwrap_preserving_paragraphs
from cibuildwheel.util.packaging import find_compatible_wheel from cibuildwheel.util.packaging import find_compatible_wheel
from cibuildwheel.venv import constraint_flags, virtualenv from cibuildwheel.venv import constraint_flags, virtualenv
@@ -75,8 +46,7 @@ class PythonConfiguration:
identifier: str identifier: str
url: str url: str
build_url: str build_url: str
build_sha256: str sha256: str = ""
sha256: str
@property @property
def sdk(self) -> str: def sdk(self) -> str:
@@ -109,7 +79,7 @@ def all_python_configurations() -> list[PythonConfiguration]:
# configuration. # configuration.
macos_python_configs = resources.read_python_configs("macos") macos_python_configs = resources.read_python_configs("macos")
def build_python_config(config_dict: dict[str, str]) -> dict[str, str]: def build_url(config_dict: dict[str, str]) -> str:
# The iOS identifier will be something like cp313-ios_arm64_iphoneos. # The iOS identifier will be something like cp313-ios_arm64_iphoneos.
# Drop the iphoneos suffix, then replace ios with macosx to yield # Drop the iphoneos suffix, then replace ios with macosx to yield
# cp313-macosx_arm64, which will be a macOS build identifier. # cp313-macosx_arm64, which will be a macOS build identifier.
@@ -118,30 +88,18 @@ def all_python_configurations() -> list[PythonConfiguration]:
matching = [ matching = [
config for config in macos_python_configs if config["identifier"] == macos_identifier config for config in macos_python_configs if config["identifier"] == macos_identifier
] ]
if not matching: return matching[0]["url"]
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 # Load the platform configuration
full_python_configs = resources.read_python_configs("ios") full_python_configs = resources.read_python_configs("ios")
# Build the configurations, annotating with macOS URL details. # Build the configurations, annotating with macOS URL details.
python_configurations = [] return [
for item in full_python_configs: PythonConfiguration(
build_config = build_python_config(item) **item,
python_configurations.append( build_url=build_url(item),
PythonConfiguration(
**item,
build_url=build_config["url"],
build_sha256=build_config["sha256"],
)
) )
return python_configurations for item in full_python_configs
]
def get_python_configurations( def get_python_configurations(
@@ -176,10 +134,9 @@ def install_target_cpython(tmp: Path, config: PythonConfiguration, free_threadin
with FileLock(str(installation_path) + ".lock"): with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists(): if not installation_path.exists():
downloaded_tar_gz = tmp / ios_python_tar_gz downloaded_tar_gz = tmp / ios_python_tar_gz
download(config.url, downloaded_tar_gz, sha256=config.sha256) download(config.url, downloaded_tar_gz, sha256=config.sha256 or None)
with remove_on_error(installation_path): installation_path.mkdir(parents=True, exist_ok=True)
installation_path.mkdir(parents=True) call("tar", "-C", installation_path, "-xf", downloaded_tar_gz)
call("tar", "-C", installation_path, "-xf", downloaded_tar_gz)
downloaded_tar_gz.unlink() downloaded_tar_gz.unlink()
return installation_path return installation_path
@@ -363,7 +320,6 @@ def setup_python(
python_configuration.version, python_configuration.version,
python_configuration.build_url, python_configuration.build_url,
free_threading, free_threading,
python_configuration.build_sha256,
) )
else: else:
msg = f"Unknown Python implementation: {implementation_id}" msg = f"Unknown Python implementation: {implementation_id}"
@@ -527,7 +483,6 @@ def build(options: Options, tmp_path: Path) -> None:
build_frontend=build_frontend.name, build_frontend=build_frontend.name,
xbuild_tools=build_options.xbuild_tools, xbuild_tools=build_options.xbuild_tools,
) )
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier) compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
if compatible_wheel: if compatible_wheel:
@@ -591,10 +546,7 @@ def build(options: Options, tmp_path: Path) -> None:
case _: case _:
assert_never(build_frontend) assert_never(build_frontend)
try: built_wheel = next(built_wheel_dir.glob("*.whl"))
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
if built_wheel.name.endswith("none-any.whl"): if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError() raise errors.NonPlatformWheelError()
+2 -23
View File
@@ -1,22 +1,5 @@
from __future__ import annotations 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 contextlib
import dataclasses import dataclasses
import shutil import shutil
@@ -254,7 +237,6 @@ def build_in_container(
env["PATH"] = f"{python_bin}:{env['PATH']}" env["PATH"] = f"{python_bin}:{env['PATH']}"
env = build_options.environment.as_dictionary(env, executor=container.environment_executor) env = build_options.environment.as_dictionary(env, executor=container.environment_executor)
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
# check config python is still on PATH # check config python is still on PATH
which_python = container.call(["which", "python"], env=env, capture_output=True).strip() which_python = container.call(["which", "python"], env=env, capture_output=True).strip()
@@ -363,10 +345,7 @@ def build_in_container(
case _: case _:
assert_never(build_frontend) assert_never(build_frontend)
try: built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
except IndexError:
raise errors.BuildProducedNoWheelError() from None
repaired_wheel_dir = temp_dir / "repaired_wheel" repaired_wheel_dir = temp_dir / "repaired_wheel"
container.call(["rm", "-rf", repaired_wheel_dir]) container.call(["rm", "-rf", repaired_wheel_dir])
@@ -513,7 +492,7 @@ def build(options: Options, tmp_path: Path) -> None:
abs_package_dir = options.globals.package_dir.resolve() abs_package_dir = options.globals.package_dir.resolve()
if cwd != abs_package_dir and cwd not in abs_package_dir.parents: if cwd != abs_package_dir and cwd not in abs_package_dir.parents:
msg = "package_dir must be inside the working directory" msg = "package_dir must be inside the working directory"
raise errors.ConfigurationError(msg) raise Exception(msg)
container_project_path = PurePosixPath("/project") container_project_path = PurePosixPath("/project")
container_package_dir = container_project_path / abs_package_dir.relative_to(cwd) container_package_dir = container_project_path / abs_package_dir.relative_to(cwd)
+15 -54
View File
@@ -1,27 +1,5 @@
from __future__ import annotations 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 dataclasses
import functools import functools
import inspect import inspect
@@ -49,13 +27,7 @@ from cibuildwheel.frontend import (
from cibuildwheel.logger import log from cibuildwheel.logger import log
from cibuildwheel.util import resources from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call, shell from cibuildwheel.util.cmd import call, shell
from cibuildwheel.util.file import ( from cibuildwheel.util.file import CIBW_CACHE_PATH, copy_test_sources, download, move_file
CIBW_CACHE_PATH,
copy_test_sources,
download,
move_file,
remove_on_error,
)
from cibuildwheel.util.helpers import prepare_command, unwrap from cibuildwheel.util.helpers import prepare_command, unwrap
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
from cibuildwheel.venv import constraint_flags, find_uv, target_marker_env, virtualenv from cibuildwheel.venv import constraint_flags, find_uv, target_marker_env, virtualenv
@@ -116,7 +88,7 @@ class PythonConfiguration:
version: str version: str
identifier: str identifier: str
url: str url: str
sha256: str sha256: str = ""
def all_python_configurations() -> list[PythonConfiguration]: def all_python_configurations() -> list[PythonConfiguration]:
@@ -164,7 +136,9 @@ def get_python_configurations(
return 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 "" ft = "T" if free_threading else ""
installation_path = Path(f"/Library/Frameworks/Python{ft}.framework/Versions/{version}") installation_path = Path(f"/Library/Frameworks/Python{ft}.framework/Versions/{version}")
with FileLock(CIBW_CACHE_PATH / f"cpython{version}.lock"): with FileLock(CIBW_CACHE_PATH / f"cpython{version}.lock"):
@@ -190,7 +164,7 @@ def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool, sh
python_filename = url.rsplit("/", maxsplit=1)[-1] python_filename = url.rsplit("/", maxsplit=1)[-1]
pkg_path = CIBW_CACHE_PATH / "cpython-installer" / python_filename pkg_path = CIBW_CACHE_PATH / "cpython-installer" / python_filename
if not pkg_path.exists(): if not pkg_path.exists():
download(url, pkg_path, sha256=sha256) download(url, pkg_path, sha256=sha256 or None)
args = [] args = []
if version.startswith("3.14"): if version.startswith("3.14"):
args += ["-applyChoiceChangesXML", str(resources.FREE_THREAD_ENABLE_314.resolve())] args += ["-applyChoiceChangesXML", str(resources.FREE_THREAD_ENABLE_314.resolve())]
@@ -214,7 +188,7 @@ def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool, sh
return installation_path / "bin" / (f"python{version}t" if free_threading else "python3") return installation_path / "bin" / (f"python{version}t" if free_threading else "python3")
def install_pypy(tmp: Path, url: str, sha256: str) -> Path: def install_pypy(tmp: Path, url: str, sha256: str = "") -> Path:
pypy_tar_bz2 = url.rsplit("/", 1)[-1] pypy_tar_bz2 = url.rsplit("/", 1)[-1]
extension = ".tar.bz2" extension = ".tar.bz2"
assert pypy_tar_bz2.endswith(extension) assert pypy_tar_bz2.endswith(extension)
@@ -222,15 +196,14 @@ def install_pypy(tmp: Path, url: str, sha256: str) -> Path:
with FileLock(str(installation_path) + ".lock"): with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists(): if not installation_path.exists():
downloaded_tar_bz2 = tmp / pypy_tar_bz2 downloaded_tar_bz2 = tmp / pypy_tar_bz2
download(url, downloaded_tar_bz2, sha256=sha256) download(url, downloaded_tar_bz2, sha256=sha256 or None)
installation_path.parent.mkdir(parents=True, exist_ok=True) installation_path.parent.mkdir(parents=True, exist_ok=True)
with remove_on_error(installation_path): call("tar", "-C", installation_path.parent, "-xf", downloaded_tar_bz2)
call("tar", "-C", installation_path.parent, "-xf", downloaded_tar_bz2)
downloaded_tar_bz2.unlink() downloaded_tar_bz2.unlink()
return installation_path / "bin" / "pypy3" 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] graalpy_archive = url.rsplit("/", 1)[-1]
extension = ".tar.gz" extension = ".tar.gz"
assert graalpy_archive.endswith(extension) assert graalpy_archive.endswith(extension)
@@ -238,18 +211,10 @@ def install_graalpy(tmp: Path, url: str, sha256: str) -> Path:
with FileLock(str(installation_path) + ".lock"): with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists(): if not installation_path.exists():
downloaded_archive = tmp / graalpy_archive downloaded_archive = tmp / graalpy_archive
download(url, downloaded_archive, sha256=sha256) download(url, downloaded_archive, sha256=sha256 or None)
with remove_on_error(installation_path): installation_path.mkdir(parents=True)
installation_path.mkdir(parents=True) # GraalPy top-folder name is inconsistent with archive name
# GraalPy top-folder name is inconsistent with archive name call("tar", "-C", installation_path, "--strip-components=1", "-xzf", downloaded_archive)
call(
"tar",
"-C",
installation_path,
"--strip-components=1",
"-xzf",
downloaded_archive,
)
downloaded_archive.unlink() downloaded_archive.unlink()
return installation_path / "bin" / "graalpy" return installation_path / "bin" / "graalpy"
@@ -508,7 +473,6 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.environment, build_options.environment,
build_frontend.name, build_frontend.name,
) )
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = None if use_uv else get_pip_version(env) pip_version = None if use_uv else get_pip_version(env)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier) compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
@@ -588,10 +552,7 @@ def build(options: Options, tmp_path: Path) -> None:
case _: case _:
assert_never(build_frontend) assert_never(build_frontend)
try: built_wheel = next(built_wheel_dir.glob("*.whl"))
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
repaired_wheel_dir.mkdir() repaired_wheel_dir.mkdir()
+29 -95
View File
@@ -1,26 +1,5 @@
from __future__ import annotations 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 dataclasses
import functools import functools
import json import json
@@ -50,7 +29,6 @@ from cibuildwheel.util.file import (
extract_tar, extract_tar,
extract_zip, extract_zip,
move_file, move_file,
remove_on_error,
) )
from cibuildwheel.util.helpers import prepare_command, unwrap, unwrap_preserving_paragraphs from cibuildwheel.util.helpers import prepare_command, unwrap, unwrap_preserving_paragraphs
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
@@ -114,11 +92,10 @@ def ensure_node(major_version: str) -> Path:
with TemporaryDirectory() as tmp_path: with TemporaryDirectory() as tmp_path:
archive = Path(tmp_path) / f"{name}.{ext}" archive = Path(tmp_path) / f"{name}.{ext}"
download(url, archive) download(url, archive)
with remove_on_error(path): if ext == "zip":
if ext == "zip": extract_zip(archive, path.parent)
extract_zip(archive, path.parent) else:
else: extract_tar(archive, path.parent)
extract_tar(archive, path.parent)
assert path.exists() assert path.exists()
if not IS_WIN: if not IS_WIN:
return path / "bin" return path / "bin"
@@ -133,19 +110,18 @@ def install_emscripten(env: dict[str, str], version: str, xbuildenv_cache_path:
with FileLock(CIBW_CACHE_PATH / "emscripten.lock"): with FileLock(CIBW_CACHE_PATH / "emscripten.lock"):
if emscripten_dir.exists(): if emscripten_dir.exists():
return emscripten_dir return emscripten_dir
with remove_on_error(emscripten_dir): call(
call( "pyodide",
"pyodide", "xbuildenv",
"xbuildenv", "install-emscripten",
"install-emscripten", "--force",
"--force", "--version",
"--version", version,
version, "--path",
"--path", str(xbuildenv_cache_path),
str(xbuildenv_cache_path), env=env,
env=env, cwd=CIBW_CACHE_PATH,
cwd=CIBW_CACHE_PATH, )
)
assert emscripten_dir.exists() assert emscripten_dir.exists()
return emscripten_dir return emscripten_dir
@@ -218,36 +194,6 @@ def validate_pyodide_build_version(
raise errors.FatalError(msg) 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: 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.""" """Install a particular Pyodide xbuildenv version and set a path to the Pyodide root."""
pyodide_root = xbuildenv_cache_path / pyodide_version / "xbuildenv" / "pyodide-root" pyodide_root = xbuildenv_cache_path / pyodide_version / "xbuildenv" / "pyodide-root"
@@ -262,18 +208,17 @@ def install_xbuildenv(env: dict[str, str], xbuildenv_cache_path: Path, pyodide_v
env.pop("PYODIDE_ROOT", None) env.pop("PYODIDE_ROOT", None)
# Install the xbuildenv # Install the xbuildenv
with remove_on_error(xbuildenv_cache_path / pyodide_version): call(
call( "pyodide",
"pyodide", "xbuildenv",
"xbuildenv", "install",
"install", "--path",
"--path", str(xbuildenv_cache_path),
str(xbuildenv_cache_path), pyodide_version,
pyodide_version, env=env,
env=env, cwd=CIBW_CACHE_PATH,
cwd=CIBW_CACHE_PATH, )
) assert pyodide_root.exists()
assert pyodide_root.exists()
return str(pyodide_root) return str(pyodide_root)
@@ -367,10 +312,6 @@ def setup_python(
xbuildenv_info=xbuildenv_info, xbuildenv_info=xbuildenv_info,
pyodide_build_version=pyodide_build_version, 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}" xbuildenv_cache_path = CIBW_CACHE_PATH / f"pyodide-build-{pyodide_build_version}"
@@ -451,7 +392,6 @@ def build(options: Options, tmp_path: Path) -> None:
environment=build_options.environment, environment=build_options.environment,
user_pyodide_version=build_options.pyodide_version, user_pyodide_version=build_options.pyodide_version,
) )
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = get_pip_version(env) pip_version = get_pip_version(env)
# The Pyodide command line runner mounts all directories in the host # The Pyodide command line runner mounts all directories in the host
# filesystem into the Pyodide file system, except for the custom # filesystem into the Pyodide file system, except for the custom
@@ -506,10 +446,7 @@ def build(options: Options, tmp_path: Path) -> None:
*extra_flags, *extra_flags,
env=env, env=env,
) )
try: built_wheel = next(built_wheel_dir.glob("*.whl"))
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
if built_wheel.name.endswith("none-any.whl"): if built_wheel.name.endswith("none-any.whl"):
raise errors.NonPlatformWheelError() raise errors.NonPlatformWheelError()
@@ -529,10 +466,7 @@ def build(options: Options, tmp_path: Path) -> None:
else: else:
shutil.move(str(built_wheel), repaired_wheel_dir) shutil.move(str(built_wheel), repaired_wheel_dir)
try: repaired_wheel = next(repaired_wheel_dir.glob("*.whl"))
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}: if repaired_wheel.name in {wheel.name for wheel in built_wheels}:
raise errors.AlreadyBuiltWheelError(repaired_wheel.name) raise errors.AlreadyBuiltWheelError(repaired_wheel.name)
+68 -45
View File
@@ -1,26 +1,7 @@
from __future__ import annotations 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 dataclasses
import json
import os import os
import platform as platform_module import platform as platform_module
import shutil import shutil
@@ -49,7 +30,6 @@ from cibuildwheel.util.file import (
download, download,
extract_zip, extract_zip,
move_file, move_file,
remove_on_error,
) )
from cibuildwheel.util.helpers import prepare_command, unwrap from cibuildwheel.util.helpers import prepare_command, unwrap
from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version from cibuildwheel.util.packaging import find_compatible_wheel, get_pip_version
@@ -132,8 +112,7 @@ def _ensure_nuget() -> Path:
nuget = CIBW_CACHE_PATH / "nuget.exe" nuget = CIBW_CACHE_PATH / "nuget.exe"
with FileLock(str(nuget) + ".lock"): with FileLock(str(nuget) + ".lock"):
if not nuget.exists(): if not nuget.exists():
with remove_on_error(nuget): download("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", nuget)
download("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", nuget)
return nuget return nuget
@@ -149,12 +128,11 @@ def install_cpython(configuration: PythonConfiguration, arch: str | None = None)
with FileLock(str(base_output_dir) + f"-{version}{free_threaded_str}-{arch}.lock"): with FileLock(str(base_output_dir) + f"-{version}{free_threaded_str}-{arch}.lock"):
if not installation_path.exists(): if not installation_path.exists():
nuget = _ensure_nuget() nuget = _ensure_nuget()
with remove_on_error(installation_path.parent): call(nuget, "install", *nuget_args)
call(nuget, "install", *nuget_args)
return installation_path / "python.exe" 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 arch == "64"
assert "win64" in url assert "win64" in url
# Inside the PyPy zip file is a directory with the same name # Inside the PyPy zip file is a directory with the same name
@@ -165,14 +143,13 @@ def install_pypy(tmp: Path, arch: str, url: str, sha256: str) -> Path:
with FileLock(str(installation_path) + ".lock"): with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists(): if not installation_path.exists():
pypy_zip = tmp / zip_filename pypy_zip = tmp / zip_filename
download(url, pypy_zip, sha256=sha256) download(url, pypy_zip, sha256=sha256 or None)
with remove_on_error(installation_path): # Extract to the parent directory because the zip file still contains a directory
# Extract to the parent directory because the zip file still contains a directory extract_zip(pypy_zip, installation_path.parent)
extract_zip(pypy_zip, installation_path.parent)
return installation_path / "python.exe" 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] zip_filename = url.rsplit("/", 1)[-1]
extension = ".zip" extension = ".zip"
assert zip_filename.endswith(extension) assert zip_filename.endswith(extension)
@@ -180,10 +157,9 @@ def install_graalpy(tmp: Path, url: str, sha256: str) -> Path:
with FileLock(str(installation_path) + ".lock"): with FileLock(str(installation_path) + ".lock"):
if not installation_path.exists(): if not installation_path.exists():
graalpy_zip = tmp / zip_filename graalpy_zip = tmp / zip_filename
download(url, graalpy_zip, sha256=sha256) download(url, graalpy_zip, sha256=sha256 or None)
with remove_on_error(installation_path): # Extract to the parent directory because the zip file still contains a directory
# Extract to the parent directory because the zip file still contains a directory extract_zip(graalpy_zip, installation_path.parent)
extract_zip(graalpy_zip, installation_path.parent)
return installation_path / "bin" / "graalpy.exe" return installation_path / "bin" / "graalpy.exe"
@@ -297,14 +273,13 @@ def setup_python(
base_python = install_cpython(python_configuration, arch=native_arch) base_python = install_cpython(python_configuration, arch=native_arch)
elif implementation_id.startswith("pp"): elif implementation_id.startswith("pp"):
assert python_configuration.url is not None assert python_configuration.url is not None
assert python_configuration.sha256
base_python = install_pypy( base_python = install_pypy(
tmp, python_configuration.arch, python_configuration.url, python_configuration.sha256 tmp, python_configuration.arch, python_configuration.url, python_configuration.sha256
) )
elif implementation_id.startswith("gp"): elif implementation_id.startswith("gp"):
assert python_configuration.url is not None base_python = install_graalpy(
assert python_configuration.sha256 tmp, python_configuration.url or "", python_configuration.sha256
base_python = install_graalpy(tmp, python_configuration.url, python_configuration.sha256) )
else: else:
msg = "Unknown Python implementation" msg = "Unknown Python implementation"
raise ValueError(msg) raise ValueError(msg)
@@ -348,7 +323,7 @@ def setup_python(
assert (venv_path / "Scripts" / "pip.exe").exists() assert (venv_path / "Scripts" / "pip.exe").exists()
where_pip = call("where", "pip", env=env, capture_stdout=True).splitlines()[0].strip() where_pip = call("where", "pip", env=env, capture_stdout=True).splitlines()[0].strip()
print(where_pip) print(where_pip)
if where_pip != str(venv_path / "Scripts" / "pip.exe"): if where_pip.strip() != 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." 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) raise errors.FatalError(msg)
call("pip", "--version", env=env) call("pip", "--version", env=env)
@@ -409,6 +384,42 @@ def setup_python(
setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env) setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env)
setup_rust_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 return base_python, env
@@ -460,7 +471,6 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.environment, build_options.environment,
build_frontend.name, build_frontend.name,
) )
env["CIBUILDWHEEL_BUILD_IDENTIFIER"] = config.identifier
pip_version = None if use_uv else get_pip_version(env) pip_version = None if use_uv else get_pip_version(env)
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier) compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
@@ -494,6 +504,22 @@ def build(options: Options, tmp_path: Path) -> None:
), ),
) )
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: match build_frontend.name:
case "pip": case "pip":
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org # Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
@@ -542,10 +568,7 @@ def build(options: Options, tmp_path: Path) -> None:
case _: case _:
assert_never(build_frontend) assert_never(build_frontend)
try: built_wheel = next(built_wheel_dir.glob("*.whl"))
built_wheel = next(built_wheel_dir.glob("*.whl"))
except StopIteration:
raise errors.BuildProducedNoWheelError() from None
# repair the wheel # repair the wheel
repaired_wheel_dir.mkdir() repaired_wheel_dir.mkdir()
-2
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"configparser", "contextlib", "dependency_groups"}
import ast import ast
import configparser import configparser
import contextlib import contextlib
@@ -14,9 +14,6 @@ def initialize() -> None:
if not (host_triplet := os.environ.get("CIBW_HOST_TRIPLET")): if not (host_triplet := os.environ.get("CIBW_HOST_TRIPLET")):
return 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 ###################################################################### # os ######################################################################
def cross_os_uname() -> os.uname_result: def cross_os_uname() -> os.uname_result:
return os.uname_result( return os.uname_result(
@@ -1,121 +0,0 @@
# 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()
+24 -19
View File
@@ -21,6 +21,7 @@ python_configurations = [
{ identifier = "pp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" }, { 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 = "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 = "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 = "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 = "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" }, { identifier = "cp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/cp310-cp310" },
@@ -70,6 +71,7 @@ python_configurations = [
{ identifier = "pp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" }, { 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 = "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 = "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 = "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 = "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" }, { identifier = "pp310-manylinux_i686", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
@@ -162,19 +164,21 @@ python_configurations = [
{ 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_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_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 = "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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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.0b2-macos11.pkg", sha256 = "29b5c95f255f846f77e1c119146836445f929de1392a3ae9ef24f559e1345418" }, { 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_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 = "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_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 = "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_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 = "pp311-macosx_arm64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.23-macos_arm64.tar.bz2", sha256 = "4747b3aceba4c1c6104cddc0fe5ea302101d32955f0957347b9ecc4fbd7aed05" },
{ 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 = "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 = "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" }, { 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" },
] ]
@@ -194,10 +198,10 @@ python_configurations = [
{ identifier = "cp314t-win32", version = "3.14.5" }, { identifier = "cp314t-win32", version = "3.14.5" },
{ identifier = "cp314-win_amd64", version = "3.14.5" }, { identifier = "cp314-win_amd64", version = "3.14.5" },
{ identifier = "cp314t-win_amd64", version = "3.14.5" }, { identifier = "cp314t-win_amd64", version = "3.14.5" },
{ identifier = "cp315-win32", version = "3.15.0-b2" }, { identifier = "cp315-win32", version = "3.15.0-b1" },
{ identifier = "cp315t-win32", version = "3.15.0-b2" }, { identifier = "cp315t-win32", version = "3.15.0-b1" },
{ identifier = "cp315-win_amd64", version = "3.15.0-b2" }, { identifier = "cp315-win_amd64", version = "3.15.0-b1" },
{ identifier = "cp315t-win_amd64", version = "3.15.0-b2" }, { identifier = "cp315t-win_amd64", version = "3.15.0-b1" },
{ identifier = "cp39-win_arm64", version = "3.9.10" }, { identifier = "cp39-win_arm64", version = "3.9.10" },
{ identifier = "cp310-win_arm64", version = "3.10.11" }, { identifier = "cp310-win_arm64", version = "3.10.11" },
{ identifier = "cp311-win_arm64", version = "3.11.9" }, { identifier = "cp311-win_arm64", version = "3.11.9" },
@@ -205,11 +209,12 @@ python_configurations = [
{ identifier = "cp313-win_arm64", version = "3.13.13" }, { identifier = "cp313-win_arm64", version = "3.13.13" },
{ identifier = "cp314-win_arm64", version = "3.14.5" }, { identifier = "cp314-win_arm64", version = "3.14.5" },
{ identifier = "cp314t-win_arm64", version = "3.14.5" }, { identifier = "cp314t-win_arm64", version = "3.14.5" },
{ identifier = "cp315-win_arm64", version = "3.15.0-b2" }, { identifier = "cp315-win_arm64", version = "3.15.0-b1" },
{ identifier = "cp315t-win_arm64", version = "3.15.0-b2" }, { identifier = "cp315t-win_arm64", version = "3.15.0-b1" },
{ identifier = "pp39-win_amd64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-win64.zip", sha256 = "06ec12a5e964dc0ad33e6f380185a4d295178dce6d6df512f508e7aee00a1323" }, { 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 = "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 = "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" }, { 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" },
] ]
@@ -217,7 +222,7 @@ python_configurations = [
python_configurations = [ python_configurations = [
{ identifier = "cp312-pyodide_wasm32", version = "3.12", default_pyodide_version = "0.27.7", node_version = "v22", sha256 = "0c2e7db42efa5d1dac38b50f8b3d659a1e3885d0a233494831b8206281307d52" }, { 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 = "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.0", node_version = "v24", sha256 = "6e76cf18251bd7d046bdb7ef35c9f938c8e995f10d88397497ca4b7020f27ba6" }, { identifier = "cp314-pyodide_wasm32", version = "3.14", default_pyodide_version = "314.0.0a2", node_version = "v24", sha256 = "ac7bbcdf289ab3ae25621c436b1d013099ef6bec644ad0538dae5d65552c5c95" },
] ]
[android] [android]
@@ -226,8 +231,8 @@ python_configurations = [
{ 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 = "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_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 = "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.0b2-aarch64-linux-android.tar.gz", sha256 = "de5e36ffc3c33b63a1ed53fe83db4dee16b003a3180ac35e5c4c203d3750e076" }, { 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.0b2-x86_64-linux-android.tar.gz", sha256 = "e05ef9c142ea83b41b194b16014ffe2249d27783313c3b00b97f6c93d9a56b92" }, { 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" },
] ]
[ios] [ios]
@@ -238,7 +243,7 @@ python_configurations = [
{ 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_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_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 = "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.0b2-iOS-XCframework.tar.gz", sha256 = "fd6b6fb8f82cf44622d28ea53b8197c89fb06505557d29d4d7a47f9386c1c896" }, { 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.0b2-iOS-XCframework.tar.gz", sha256 = "fd6b6fb8f82cf44622d28ea53b8197c89fb06505557d29d4d7a47f9386c1c896" }, { 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.0b2-iOS-XCframework.tar.gz", sha256 = "fd6b6fb8f82cf44622d28ea53b8197c89fb06505557d29d4d7a47f9386c1c896" }, { 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" },
] ]
+57 -157
View File
@@ -26,67 +26,6 @@
"description": "cibuildwheel's settings.", "description": "cibuildwheel's settings.",
"type": "object", "type": "object",
"properties": { "properties": {
"inherit": {
"type": "object",
"additionalProperties": false,
"properties": {
"audit-command": {
"$ref": "#/$defs/inherit"
},
"audit-requires": {
"$ref": "#/$defs/inherit"
},
"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"
},
"environment": {
"$ref": "#/$defs/inherit"
},
"environment-pass": {
"$ref": "#/$defs/inherit"
},
"repair-wheel-command": {
"$ref": "#/$defs/inherit"
},
"test-command": {
"$ref": "#/$defs/inherit"
},
"test-extras": {
"$ref": "#/$defs/inherit"
},
"test-sources": {
"$ref": "#/$defs/inherit"
},
"test-requires": {
"$ref": "#/$defs/inherit"
},
"test-environment": {
"$ref": "#/$defs/inherit"
},
"test-runtime": {
"$ref": "#/$defs/inherit"
}
},
"title": "CIBW_INHERIT"
},
"audit-command": { "audit-command": {
"description": "Execute a shell command to audit each wheel after it is repaired. Use {wheel} for each wheel path, or {abi3_wheel} to only audit abi3 wheels.", "description": "Execute a shell command to audit each wheel after it is repaired. Use {wheel} for each wheel path, or {abi3_wheel} to only audit abi3 wheels.",
"oneOf": [ "oneOf": [
@@ -521,34 +460,6 @@
], ],
"title": "CIBW_XBUILD_TOOLS" "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": { "pyodide-version": {
"type": "string", "type": "string",
"description": "Specify the version of Pyodide to use", "description": "Specify the version of Pyodide to use",
@@ -750,7 +661,61 @@
] ]
}, },
"inherit": { "inherit": {
"$ref": "#/properties/inherit" "type": "object",
"additionalProperties": false,
"properties": {
"audit-command": {
"$ref": "#/$defs/inherit"
},
"audit-requires": {
"$ref": "#/$defs/inherit"
},
"before-all": {
"$ref": "#/$defs/inherit"
},
"before-build": {
"$ref": "#/$defs/inherit"
},
"xbuild-tools": {
"$ref": "#/$defs/inherit"
},
"before-test": {
"$ref": "#/$defs/inherit"
},
"config-settings": {
"$ref": "#/$defs/inherit"
},
"container-engine": {
"$ref": "#/$defs/inherit"
},
"environment": {
"$ref": "#/$defs/inherit"
},
"environment-pass": {
"$ref": "#/$defs/inherit"
},
"repair-wheel-command": {
"$ref": "#/$defs/inherit"
},
"test-command": {
"$ref": "#/$defs/inherit"
},
"test-extras": {
"$ref": "#/$defs/inherit"
},
"test-sources": {
"$ref": "#/$defs/inherit"
},
"test-requires": {
"$ref": "#/$defs/inherit"
},
"test-environment": {
"$ref": "#/$defs/inherit"
},
"test-runtime": {
"$ref": "#/$defs/inherit"
}
}
}, },
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
@@ -842,9 +807,6 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
@@ -879,9 +841,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -972,9 +931,6 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
@@ -1021,9 +977,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -1060,27 +1013,11 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
"repair-wheel-command": { "repair-wheel-command": {
"description": "Execute a shell command to repair each built wheel.", "$ref": "#/properties/repair-wheel-command"
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"title": "CIBW_REPAIR_WHEEL_COMMAND",
"default": "delvewheel repair -w {dest_dir} -v {wheel}"
}, },
"test-command": { "test-command": {
"$ref": "#/properties/test-command" "$ref": "#/properties/test-command"
@@ -1109,9 +1046,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -1148,9 +1082,6 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
@@ -1197,9 +1128,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -1236,9 +1164,6 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
@@ -1272,9 +1197,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -1311,27 +1233,11 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
"repair-wheel-command": { "repair-wheel-command": {
"description": "Execute a shell command to repair each built wheel.", "$ref": "#/properties/repair-wheel-command"
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"title": "CIBW_REPAIR_WHEEL_COMMAND",
"default": "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"
}, },
"test-command": { "test-command": {
"$ref": "#/properties/test-command" "$ref": "#/properties/test-command"
@@ -1360,9 +1266,6 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"inherit": {
"$ref": "#/properties/inherit"
},
"audit-command": { "audit-command": {
"$ref": "#/properties/audit-command" "$ref": "#/properties/audit-command"
}, },
@@ -1399,9 +1302,6 @@
"xbuild-tools": { "xbuild-tools": {
"$ref": "#/properties/xbuild-tools" "$ref": "#/properties/xbuild-tools"
}, },
"xbuild-files": {
"$ref": "#/properties/xbuild-files"
},
"pyodide-version": { "pyodide-version": {
"$ref": "#/properties/pyodide-version" "$ref": "#/properties/pyodide-version"
}, },
@@ -2,7 +2,7 @@
# nox -s update_constraints # nox -s update_constraints
annotated-types==0.7.0 annotated-types==0.7.0
# via pydantic # via pydantic
auditwheel-emscripten==0.2.5 auditwheel-emscripten==0.2.4
# via pyodide-build # via pyodide-build
build==1.5.0 build==1.5.0
# via # via
@@ -17,13 +17,13 @@ click==8.1.8
# -r .nox/update_constraints/tmp/constraints-pyodide.in # -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build # pyodide-build
# pyodide-cli # pyodide-cli
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via requests # via requests
leb128==1.0.9 leb128==1.0.9
# via auditwheel-emscripten # via auditwheel-emscripten
@@ -37,9 +37,9 @@ packaging==26.2
# build # build
# pyodide-build # pyodide-build
# wheel # wheel
pip==26.1.2 pip==26.1.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.10.0 platformdirs==4.9.6
# via # via
# pyodide-build # pyodide-build
# python-discovery # python-discovery
@@ -52,7 +52,7 @@ pydantic-core==2.46.4
# via pydantic # via pydantic
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyodide-build==0.35.0 pyodide-build==0.34.4
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0 pyodide-cli==0.5.0
# via # via
@@ -62,7 +62,7 @@ pyodide-lock==0.1.3
# via pyodide-build # via pyodide-build
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via pyodide-build # via pyodide-build
@@ -81,7 +81,7 @@ typing-inspection==0.4.2
# via pydantic # via pydantic
urllib3==2.7.0 urllib3==2.7.0
# via requests # via requests
virtualenv==21.4.2 virtualenv==21.3.3
# via # via
# build # build
# pyodide-build # pyodide-build
@@ -2,7 +2,7 @@
# nox -s update_constraints # nox -s update_constraints
annotated-types==0.7.0 annotated-types==0.7.0
# via pydantic # via pydantic
auditwheel-emscripten==0.2.5 auditwheel-emscripten==0.2.4
# via pyodide-build # via pyodide-build
build==1.5.0 build==1.5.0
# via # via
@@ -17,13 +17,13 @@ click==8.1.8
# -r .nox/update_constraints/tmp/constraints-pyodide.in # -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build # pyodide-build
# pyodide-cli # pyodide-cli
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via requests # via requests
leb128==1.0.9 leb128==1.0.9
# via auditwheel-emscripten # via auditwheel-emscripten
@@ -37,9 +37,9 @@ packaging==26.2
# build # build
# pyodide-build # pyodide-build
# wheel # wheel
pip==26.1.2 pip==26.1.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.10.0 platformdirs==4.9.6
# via # via
# pyodide-build # pyodide-build
# python-discovery # python-discovery
@@ -52,7 +52,7 @@ pydantic-core==2.46.4
# via pydantic # via pydantic
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyodide-build==0.35.0 pyodide-build==0.34.4
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0 pyodide-cli==0.5.0
# via # via
@@ -62,7 +62,7 @@ pyodide-lock==0.1.3
# via pyodide-build # via pyodide-build
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via pyodide-build # via pyodide-build
@@ -81,7 +81,7 @@ typing-inspection==0.4.2
# via pydantic # via pydantic
urllib3==2.7.0 urllib3==2.7.0
# via requests # via requests
virtualenv==21.4.2 virtualenv==21.3.3
# via # via
# build # build
# pyodide-build # pyodide-build
@@ -2,7 +2,7 @@
# nox -s update_constraints # nox -s update_constraints
annotated-types==0.7.0 annotated-types==0.7.0
# via pydantic # via pydantic
auditwheel-emscripten==0.2.5 auditwheel-emscripten==0.2.4
# via pyodide-build # via pyodide-build
build==1.5.0 build==1.5.0
# via # via
@@ -17,13 +17,13 @@ click==8.1.8
# -r .nox/update_constraints/tmp/constraints-pyodide.in # -r .nox/update_constraints/tmp/constraints-pyodide.in
# pyodide-build # pyodide-build
# pyodide-cli # pyodide-cli
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via requests # via requests
leb128==1.0.9 leb128==1.0.9
# via auditwheel-emscripten # via auditwheel-emscripten
@@ -37,9 +37,9 @@ packaging==26.2
# build # build
# pyodide-build # pyodide-build
# wheel # wheel
pip==26.1.2 pip==26.1.1
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
platformdirs==4.10.0 platformdirs==4.9.6
# via # via
# pyodide-build # pyodide-build
# python-discovery # python-discovery
@@ -52,7 +52,7 @@ pydantic-core==2.46.4
# via pydantic # via pydantic
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyodide-build==0.35.0 pyodide-build==0.34.4
# via -r .nox/update_constraints/tmp/constraints-pyodide.in # via -r .nox/update_constraints/tmp/constraints-pyodide.in
pyodide-cli==0.5.0 pyodide-cli==0.5.0
# via # via
@@ -62,7 +62,7 @@ pyodide-lock==0.1.3
# via pyodide-build # via pyodide-build
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via pyodide-build # via pyodide-build
@@ -81,7 +81,7 @@ typing-inspection==0.4.2
# via pydantic # via pydantic
urllib3==2.7.0 urllib3==2.7.0
# via requests # via requests
virtualenv==21.4.2 virtualenv==21.3.3
# via # via
# build # build
# pyodide-build # pyodide-build
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,17 +20,17 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
exceptiongroup==1.3.1 exceptiongroup==1.3.1
# via cattrs # via cattrs
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -49,33 +47,26 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2 pip==26.1.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -99,7 +90,7 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
zipp==4.1.0 zipp==4.1.0
# via importlib-metadata # via importlib-metadata
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,34 +43,27 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2; implementation_name != "graalpy" or platform_system != "Windows" pip==26.1.1; implementation_name != "graalpy" or platform_system != "Windows"
pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows" pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows"
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -92,5 +83,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,34 +43,27 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2; implementation_name != "graalpy" or platform_system != "Windows" pip==26.1.1; implementation_name != "graalpy" or platform_system != "Windows"
pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows" pip==26.0.1; implementation_name == "graalpy" and platform_system == "Windows"
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -92,5 +83,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,33 +43,26 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2 pip==26.1.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -91,5 +82,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,33 +43,26 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2 pip==26.1.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -91,5 +82,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,33 +43,26 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2 pip==26.1.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -91,5 +82,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.4.2
# via -r cibuildwheel/resources/constraints.in
build==1.4.4 build==1.4.4
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==25.3.0 cattrs==25.3.0
@@ -22,9 +20,9 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
exceptiongroup==1.3.1 exceptiongroup==1.3.1
# via cattrs # via cattrs
@@ -32,14 +30,12 @@ filelock==3.19.1
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
importlib-metadata==8.7.1 importlib-metadata==8.7.1
# via # via build
# build
# pkgconf
kaitaistruct==0.11 kaitaistruct==0.11
# via abi3audit # via abi3audit
macholib==1.16.4 macholib==1.16.4
@@ -51,33 +47,26 @@ mdurl==0.1.2
packaging==25.0 packaging==25.0
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.0.1 pip==26.0.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.4.3.post2
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.4.0 platformdirs==4.4.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.32 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.32.5 requests==2.32.5
# via # via
@@ -101,7 +90,7 @@ urllib3==2.6.3
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
zipp==3.23.1 zipp==3.23.1
# via importlib-metadata # via importlib-metadata
-5
View File
@@ -4,8 +4,3 @@ delocate
delvewheel delvewheel
virtualenv virtualenv
abi3audit abi3audit
# Android
auditwheel
patchelf
pkgconf
+10 -19
View File
@@ -10,8 +10,6 @@ attrs==26.1.0
# via # via
# cattrs # cattrs
# requests-cache # requests-cache
auditwheel==6.7.0
# via -r cibuildwheel/resources/constraints.in
build==1.5.0 build==1.5.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
cattrs==26.1.0 cattrs==26.1.0
@@ -22,15 +20,15 @@ charset-normalizer==3.4.7
# via requests # via requests
delocate==0.13.0 delocate==0.13.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
delvewheel==1.13.0 delvewheel==1.12.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.4.1 distlib==0.4.0
# via virtualenv # via virtualenv
filelock==3.29.1 filelock==3.29.0
# via # via
# python-discovery # python-discovery
# virtualenv # virtualenv
idna==3.18 idna==3.16
# via # via
# requests # requests
# url-normalize # url-normalize
@@ -45,33 +43,26 @@ mdurl==0.1.2
packaging==26.2 packaging==26.2
# via # via
# abi3audit # abi3audit
# auditwheel
# build # build
# delocate # delocate
patchelf==0.17.2.4
# via -r cibuildwheel/resources/constraints.in
pefile==2024.8.26 pefile==2024.8.26
# via # via
# abi3audit # abi3audit
# delvewheel # delvewheel
pip==26.1.2 pip==26.1.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
pkgconf==2.5.1.post2 platformdirs==4.9.6
# via -r cibuildwheel/resources/constraints.in
platformdirs==4.10.0
# via # via
# python-discovery # python-discovery
# requests-cache # requests-cache
# virtualenv # virtualenv
pyelftools==0.33 pyelftools==0.32
# via # via abi3audit
# abi3audit
# auditwheel
pygments==2.20.0 pygments==2.20.0
# via rich # via rich
pyproject-hooks==1.2.0 pyproject-hooks==1.2.0
# via build # via build
python-discovery==1.4.0 python-discovery==1.3.1
# via virtualenv # via virtualenv
requests==2.34.2 requests==2.34.2
# via # via
@@ -91,5 +82,5 @@ urllib3==2.7.0
# via # via
# requests # requests
# requests-cache # requests-cache
virtualenv==21.4.2 virtualenv==21.3.3
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
-11
View File
@@ -1,6 +1,3 @@
# 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] [tool.cibuildwheel]
build = "*" build = "*"
skip = "" skip = ""
@@ -55,13 +52,6 @@ musllinux-s390x-image = "musllinux_1_2"
musllinux-armv7l-image = "musllinux_1_2" musllinux-armv7l-image = "musllinux_1_2"
musllinux-riscv64-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] [tool.cibuildwheel.linux]
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
@@ -73,7 +63,6 @@ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest
repair-wheel-command = "delvewheel repair -w {dest_dir} -v {wheel}" repair-wheel-command = "delvewheel repair -w {dest_dir} -v {wheel}"
[tool.cibuildwheel.android] [tool.cibuildwheel.android]
repair-wheel-command = "auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {wheel}"
[tool.cibuildwheel.ios] [tool.cibuildwheel.ios]
+34 -34
View File
@@ -1,54 +1,54 @@
[x86_64] [x86_64]
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2026.06.04-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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_x86_64:2026.05.27-1
[i686] [i686]
manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686:2026.06.04-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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_i686:2026.05.27-1
[aarch64] [aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2026.06.04-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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_aarch64:2026.05.27-1
[ppc64le] [ppc64le]
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2026.06.04-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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_ppc64le:2026.05.27-1
[s390x] [s390x]
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_s390x:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x:2026.06.04-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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_s390x:2026.05.27-1
[pypy_x86_64] [pypy_x86_64]
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2026.06.04-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.06.04-1 manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2026.05.27-1
[pypy_i686] [pypy_i686]
manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_i686:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_i686:2026.06.04-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.06.04-1 manylinux_2_34 = quay.io/pypa/manylinux_2_34_i686:2026.05.27-1
[pypy_aarch64] [pypy_aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.06.04-1 manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2026.05.27-1
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2026.06.04-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.06.04-1 manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2026.05.27-1
[armv7l] [armv7l]
manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l:2026.06.04-1 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.06.04-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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2026.05.27-1
[riscv64] [riscv64]
manylinux_2_39 = quay.io/pypa/manylinux_2_39_riscv64:2026.06.04-1 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.06.04-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_riscv64:2026.05.27-1
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
default = { version = "21.4.2", url = "https://github.com/pypa/get-virtualenv/releases/download/21.4.2/virtualenv.pyz", sha256 = "b54c48b9c81468403626762747c5ee5939616f18f46c3c4bbebdbe0aa3a8ba1d" } default = { version = "21.3.3", url = "https://github.com/pypa/get-virtualenv/releases/download/21.3.3/virtualenv.pyz", sha256 = "d3a7f4ee4c820c4247fe14ec1a478e19ef8f63f716c0f15bc10fab4d70ad9b69" }
-2
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.util", "json"}
import json import json
from cibuildwheel.util import resources from cibuildwheel.util import resources
+7 -9
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"bracex", "fnmatch", "itertools", "packaging", "packaging.version"}
import dataclasses import dataclasses
import itertools import itertools
from enum import StrEnum from enum import StrEnum
@@ -104,19 +102,19 @@ class BuildSelector:
return False return False
if EnableGroup.PyodideEoL not in self.enable and fnmatch(build_id, "cp312-pyodide_*"): if EnableGroup.PyodideEoL not in self.enable and fnmatch(build_id, "cp312-pyodide_*"):
return False return False
# NOTE: Re-enable this when we have a new Pyodide prerelease (e.g., 315.0.0a1+) # NOTE: Disable this when we don't have any Pyodide prereleases (e.g., 314.0.0a1+)
# When doing this, also: # When doing this, also:
# 1. update Pyodide tests in unit_test/build_selector_test.py and unit_test/options_test.py accordingly. # 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. # 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 # 3. update constraints as necessary via bin/generate_pyodide_constraints.py and add/delete
# Pyodide constraints files in cibuildwheel/resources/constraints/ as necessary. # Pyodide constraints files in cibuildwheel/resources/constraints/ as necessary.
# When re-enabling, update the pattern to match the experimental Python version when # When disabling, update the pattern to match the experimental Python version in case
# it is bumped to Python 3.15 (likely cp315-pyodide_*). # 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. # This depends on the CPython version being used in the Pyodide runtime at the time.
# if EnableGroup.PyodidePrerelease not in self.enable and fnmatch( if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
# build_id, "cp315-pyodide_*" build_id, "cp314-pyodide_*"
# ): ):
# return False return False
should_build = selector_matches(self.build_config, build_id) should_build = selector_matches(self.build_config, build_id)
should_skip = selector_matches(self.skip_config, build_id) should_skip = selector_matches(self.skip_config, build_id)
-2
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"cibuildwheel.errors", "shlex", "shutil", "subprocess"}
import os import os
import shlex import shlex
import shutil import shutil
+2 -36
View File
@@ -1,19 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {
"certifi",
"cibuildwheel.errors",
"hashlib",
"shutil",
"ssl",
"tarfile",
"typing",
"urllib",
"urllib.request",
"zipfile",
}
import hashlib import hashlib
import os import os
import shutil import shutil
@@ -21,7 +7,6 @@ import ssl
import tarfile import tarfile
import time import time
import urllib.request import urllib.request
from contextlib import contextmanager
from pathlib import Path, PurePath from pathlib import Path, PurePath
from typing import Final from typing import Final
from zipfile import ZipFile from zipfile import ZipFile
@@ -33,7 +18,7 @@ from cibuildwheel.errors import FatalError
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from collections.abc import Callable, Generator from collections.abc import Callable
DEFAULT_CIBW_CACHE_PATH: Final[Path] = user_cache_path(appname="cibuildwheel", appauthor="pypa") DEFAULT_CIBW_CACHE_PATH: Final[Path] = user_cache_path(appname="cibuildwheel", appauthor="pypa")
CIBW_CACHE_PATH: Final[Path] = Path( CIBW_CACHE_PATH: Final[Path] = Path(
@@ -41,22 +26,6 @@ CIBW_CACHE_PATH: Final[Path] = Path(
).resolve() ).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: def ensure_cache_sentinel(cache_path: Path) -> None:
"""Create a sentinel file to mark a cibuildwheel cache directory. """Create a sentinel file to mark a cibuildwheel cache directory.
@@ -99,8 +68,7 @@ def download(url: str, dest: Path, *, sha256: str | None = None) -> None:
time.sleep(3) time.sleep(3)
if sha256: if sha256:
with dest.open("rb") as f: computed = hashlib.sha256(dest.read_bytes()).hexdigest()
computed = hashlib.file_digest(f, "sha256").hexdigest()
if computed != sha256: if computed != sha256:
dest.unlink(missing_ok=True) dest.unlink(missing_ok=True)
msg = f"SHA256 mismatch for {url}: expected {sha256!r}, got {computed!r}" msg = f"SHA256 mismatch for {url}: expected {sha256!r}, got {computed!r}"
@@ -131,8 +99,6 @@ def extract_tar(tar_src: Path, dest: Path) -> None:
See: https://docs.python.org/3/library/tarfile.html#tarfile.tar_filter for filter details See: https://docs.python.org/3/library/tarfile.html#tarfile.tar_filter for filter details
""" """
with tarfile.open(tar_src) as tar_: 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_.extraction_filter = getattr(tarfile, "tar_filter", (lambda member, _: member))
tar_.extractall(dest) tar_.extractall(dest)
-47
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"collections", "itertools", "re", "shlex", "textwrap"}
import dataclasses import dataclasses
import itertools import itertools
import re import re
@@ -147,51 +145,6 @@ def parse_key_value_string(
return dict(result) return dict(result)
def parse_arbitrary_key_value_string(
key_value_string: str, default_value: str | None = None
) -> dict[str, list[str]]:
"""
Parses a string like
"before-build; before-test: append; after-test: prepend"
or
"package1: some/header.h some/library.a; package2: other/header.h"
There are no restrictions on the keys than can be set.
No positional arguments are allowed. Words without a colon attached are
interpreted as keys. Keys without a value will be assigned the
default_value if provided, otherwise throw an error.
"""
shlexer = shlex.shlex(key_value_string, posix=True, punctuation_chars=";")
shlexer.commenters = ""
shlexer.whitespace_split = True
parts = list(shlexer)
# parts now looks like
# ['before-build', ';', 'before-test:', 'append', ';', 'after-test:', 'prepend']
# split by semicolon
result: defaultdict[str, list[str]] = defaultdict(list)
fields = [list(group) for k, group in itertools.groupby(parts, lambda x: x == ";") if not k]
for field in fields:
# check to see if the option name is specified
field_name, sep, first_value = field[0].partition(":")
if sep:
# the colon was present, so the first value is the value after the colon
values = ([first_value] if first_value else []) + field[1:]
result[field_name] += values
else:
# no colon, so it's a key (or set of keys) without values
if default_value is None:
msg = f"Failed to parse {key_value_string!r}. No value specified for {field_name!r}. Expected ':' followed by a value."
raise ValueError(msg)
for key in field:
result[key].append(default_value)
return dict(result)
@dataclasses.dataclass(order=True) @dataclasses.dataclass(order=True)
class FlexibleVersion: class FlexibleVersion:
version_parts: tuple[int, ...] = dataclasses.field(init=False, repr=False) version_parts: tuple[int, ...] = dataclasses.field(init=False, repr=False)
-8
View File
@@ -1,13 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"packaging",
"packaging.utils",
"shlex",
}
import shlex import shlex
from dataclasses import dataclass, field from dataclasses import dataclass, field
from pathlib import Path, PurePath from pathlib import Path, PurePath
+7 -39
View File
@@ -1,27 +1,15 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {
"cibuildwheel.util.file",
"cibuildwheel.util.resources",
"filelock",
"fnmatch",
"hashlib",
"json",
"platform",
"subprocess",
}
import fnmatch import fnmatch
import functools import functools
import hashlib import hashlib
import json import json
import platform import platform
import subprocess
import typing import typing
from filelock import FileLock from filelock import FileLock
from cibuildwheel.util.file import download, extract_tar, remove_on_error from cibuildwheel.util.file import download, extract_tar
from cibuildwheel.util.resources import PYTHON_BUILD_STANDALONE_RELEASES from cibuildwheel.util.resources import PYTHON_BUILD_STANDALONE_RELEASES
TYPE_CHECKING = False TYPE_CHECKING = False
@@ -54,26 +42,6 @@ class PythonBuildStandaloneError(Exception):
"""Errors related to python-build-standalone.""" """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]: def _get_platform_identifiers() -> tuple[str, str, str | None]:
""" """
Detects the current platform and returns architecture, platform, and libc Detects the current platform and returns architecture, platform, and libc
@@ -99,7 +67,7 @@ def _get_platform_identifiers() -> tuple[str, str, str | None]:
# Map OS + Libc # Map OS + Libc
if system == "Linux": if system == "Linux":
platform_identifier = "unknown-linux" platform_identifier = "unknown-linux"
libc_identifier = "musl" if _is_musl_libc() else "gnu" libc_identifier = "musl" if "musl" in (platform.libc_ver() or ("", "")) else "gnu"
elif system == "Darwin": elif system == "Darwin":
platform_identifier = "apple-darwin" platform_identifier = "apple-darwin"
elif system == "Windows": elif system == "Windows":
@@ -154,8 +122,7 @@ def _download_or_get_from_cache(
asset_cache_path = cache_dir / asset_filename asset_cache_path = cache_dir / asset_filename
if asset_cache_path.is_file(): if asset_cache_path.is_file():
if sha256: if sha256:
with asset_cache_path.open("rb") as f: computed = hashlib.sha256(asset_cache_path.read_bytes()).hexdigest()
computed = hashlib.file_digest(f, "sha256").hexdigest()
if computed != sha256: if computed != sha256:
print( print(
f"Cached python_build_standalone SHA256 mismatch for {asset_cache_path}; redownloading." f"Cached python_build_standalone SHA256 mismatch for {asset_cache_path}; redownloading."
@@ -169,8 +136,7 @@ def _download_or_get_from_cache(
return asset_cache_path return asset_cache_path
print(f"Downloading python_build_standalone: {asset_url} to {asset_cache_path}") print(f"Downloading python_build_standalone: {asset_url} to {asset_cache_path}")
with remove_on_error(asset_cache_path): download(asset_url, asset_cache_path, sha256=sha256 or None)
download(asset_url, asset_cache_path, sha256=sha256 or None)
return asset_cache_path return asset_cache_path
@@ -230,7 +196,9 @@ def create_python_build_standalone_environment(
) )
python_base_dir = temp_dir / "pbs" python_base_dir = temp_dir / "pbs"
assert not python_base_dir.exists() if python_base_dir.exists():
msg = f"python-build-standalone directory already exists: {python_base_dir}"
raise PythonBuildStandaloneError(msg)
extract_tar(archive_path, python_base_dir) extract_tar(archive_path, python_base_dir)
return _find_python_executable(python_base_dir) return _find_python_executable(python_base_dir)
+1 -10
View File
@@ -1,7 +1,5 @@
from __future__ import annotations from __future__ import annotations
__lazy_modules__ = {"tomllib"}
import functools import functools
import tomllib import tomllib
from pathlib import Path from pathlib import Path
@@ -33,14 +31,7 @@ IOS_SUPPORT_FILES: Final[Path] = PATH / "ios-support"
def read_all_configs() -> dict[str, list[dict[str, str]]]: def read_all_configs() -> dict[str, list[dict[str, str]]]:
with BUILD_PLATFORMS.open("rb") as f: with BUILD_PLATFORMS.open("rb") as f:
loaded_file = tomllib.load(f) loaded_file = tomllib.load(f)
configs = {k: list[dict[str, str]](v["python_configurations"]) for k, v in loaded_file.items()} return {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]]: def read_python_configs(config: PlatformName) -> list[dict[str, str]]:
+4 -20
View File
@@ -1,20 +1,5 @@
from __future__ import annotations 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 contextlib
import functools import functools
import os import os
@@ -31,7 +16,7 @@ from packaging.version import Version
from cibuildwheel.util import resources from cibuildwheel.util import resources
from cibuildwheel.util.cmd import call from cibuildwheel.util.cmd import call
from cibuildwheel.util.file import CIBW_CACHE_PATH, download, remove_on_error from cibuildwheel.util.file import CIBW_CACHE_PATH, download
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
@@ -68,12 +53,11 @@ def _ensure_virtualenv(version: str) -> tuple[Path, Version]:
configuration = loaded_file.get(key, loaded_file["default"]) configuration = loaded_file.get(key, loaded_file["default"])
version = str(configuration["version"]) version = str(configuration["version"])
url = str(configuration["url"]) url = str(configuration["url"])
sha256 = str(configuration["sha256"]) sha256 = str(configuration.get("sha256", ""))
path = CIBW_CACHE_PATH / f"virtualenv-{version}.pyz" path = CIBW_CACHE_PATH / f"virtualenv-{version}.pyz"
with FileLock(str(path) + ".lock"): with FileLock(str(path) + ".lock"):
if not path.exists(): if not path.exists():
with remove_on_error(path): download(url, path, sha256=sha256 or None)
download(url, path, sha256=sha256)
return (path, Version(version)) return (path, Version(version))
@@ -100,7 +84,7 @@ def _parse_pip_constraint_for_virtualenv(
If it can't get an exact version, the real constraint will be handled by the If it can't get an exact version, the real constraint will be handled by the
{macos|windows}.setup_python function. {macos|windows}.setup_python function.
If marker_env is provided, marker-bearing constraints are evaluated against it; If marker_env is provided, marker-bearing constraints are evaluated against it;
otherwise, they are evaluated against the host's default environment. otherwise, marker-bearing constraints are skipped.
""" """
env: dict[str, str] = ( env: dict[str, str] = (
marker_env if marker_env is not None else cast("dict[str, str]", default_environment()) marker_env if marker_env is not None else cast("dict[str, str]", default_environment())
+10 -49
View File
@@ -1,75 +1,36 @@
--- ---
title: Changelog title: Changelog
ref: changelog
--- ---
# Changelog # Changelog
### v4.1.0 ### v4.0.0rc1
_12 June 2026_ _14 May 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 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.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) - 🌟 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)
- 🌟 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) - 🌟 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.0b2. (#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.0b1. (#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.15 will be available in cibuildwheel without the flag._ _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)
- ✨ 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) - ✨ 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) - ⚠️ 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) - ⚠️ 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 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 `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) - 🛠 Updates Android to Python 3.13.13 and 3.14.4 (#2821)
- 🛠 Applies Pyodide-specific patches to the Emscripten toolchain installation (#2800) - 🛠 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) - 🛠 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) - 📚 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) - 📚 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 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) - 📚 Links back to source in docs (#2806)
- 📚 Removes outdated numpy info (#2855) - 💼 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)
### v3.4.1 ### v3.4.1
-1
View File
@@ -1,6 +1,5 @@
--- ---
title: Configuring a CI service title: Configuring a CI service
ref: ci-services
--- ---
## Configuring a CI service ## Configuring a CI service
+19 -79
View File
@@ -1,8 +1,3 @@
---
title: Configuration
ref: configuration
---
# Configuration methods # Configuration methods
cibuildwheel can either be configured using environment variables, or from cibuildwheel can either be configured using environment variables, or from
@@ -63,14 +58,11 @@ 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`. You can configure cibuildwheel with a config file, such as `pyproject.toml`.
Options have the same names as the environment variable overrides, but are Options have the same names as the environment variable overrides, but are
placed in `[tool.cibuildwheel]` and are lower case, with dashes, following placed in `[tool.cibuildwheel]` and are lower case, with dashes, following
common [TOML](https://toml.io) practice. Anything placed in subsections common [TOML](https://toml.io) practice. Anything placed in subsections `linux`, `windows`,
named after a platform will only affect those platforms. Platform-specific `macos`, or `pyodide` will only affect those platforms. Lists can be used
values replace the corresponding global value for that platform; table options instead of strings for items that are naturally a list. Multiline strings also
are not merged key by key unless you configure [inheritance](#inherit). Lists can work just like in the environment variables. Environment variables will take
be used instead of strings for items that are naturally a list. Multiline strings precedence if defined.
also work just like in the environment variables. Environment variable overrides,
such as `CIBW_TEST_COMMAND` and `CIBW_TEST_COMMAND_LINUX`, take precedence if
defined.
The example above using environment variables could have been written like this: The example above using environment variables could have been written like this:
@@ -114,9 +106,9 @@ trigger new containers, one per image.
The ``output-dir``, ``build``, ``skip``, ``test_skip`` selectors, and architectures cannot be overridden. The ``output-dir``, ``build``, ``skip``, ``test_skip`` selectors, and architectures cannot be overridden.
By default, values in an override replace values from the main configuration or You can specify a table of overrides in `inherit={}`, any list or table in this
earlier overrides. You can instead [extend a list or table option](#inherit) by list will inherit from previous overrides or the main configuration. The valid
setting an `inherit` rule for it. options are `"none"` (the default), `"append"`, and `"prepend"`.
#### Examples: #### Examples:
@@ -176,50 +168,14 @@ This example will provide the command `"pyproject-before && pyproject && pyproje
on Python 3.11, and will have `environment = {FOO="BAZ", "PYTHON"="MONTY", "HAM"="EGGS"}`. on Python 3.11, and will have `environment = {FOO="BAZ", "PYTHON"="MONTY", "HAM"="EGGS"}`.
## Option inheritance {: #inherit } ## Extending existing options {: #inherit }
As cibuildwheel reads its configuration, each layer normally replaces the value In the TOML configuration, you can choose how tables and lists are inherited.
from the previous layer. The layers, from lowest to highest precedence, are: 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
1. cibuildwheel's defaults with the `inherit` table in overrides. For example, if you want to add an environment
2. `[tool.cibuildwheel]` variable for CPython 3.11, without `inherit` you'd have to repeat all the
3. `[tool.cibuildwheel.<platform>]` original environment variables in the override. With `inherit`, it's just:
4. matching `[[tool.cibuildwheel.overrides]]` entries, in order
5. `CIBW_<OPTION>`
6. `CIBW_<OPTION>_<PLATFORM>`
For list and table options, you can use an `inherit` rule to merge a value with
the value accumulated from the preceding layers instead. The available rules
are `"none"` (replace the previous value, the default), `"append"`, and
`"prepend"`.
In `pyproject.toml`, set the rule in the same table as the value it applies to.
For example, this adds Twine checks to the default audit configuration:
```toml
[tool.cibuildwheel]
inherit.audit-requires = "append"
inherit.audit-command = "append"
audit-requires = ["twine"]
audit-command = "twine check {wheel}"
```
Inheritance can also combine global and platform-specific configuration. This
example runs a Linux-specific setup command before the global command:
```toml
[tool.cibuildwheel]
before-all = "make -C third_party_lib"
[tool.cibuildwheel.linux]
inherit.before-all = "prepend"
before-all = "yum install -y libffi-devel"
```
The same mechanism remains available 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:
```toml ```toml
[[tool.cibuildwheel.overrides]] [[tool.cibuildwheel.overrides]]
@@ -247,23 +203,7 @@ repair-wheel-command = "echo 'After repair'"
``` ```
As seen in this example, you can have multiple overrides match - they match top As seen in this example, you can have multiple overrides match - they match top
to bottom, with the config being accumulated. to bottom, with the config being accumulated. If you need platform-specific
inheritance, you can use `select = "*-????linux_*"` for Linux, `select =
For environment variables, specify the rules in `CIBW_INHERIT`. Rules are "*-win_*"` for Windows, and `select = "*-macosx_*"` for macOS. As always,
separated by semicolons and use lowercase option names. A rule without an environment variables will completely override any TOML configuration.
explicit value defaults to `append`:
```yaml
CIBW_AUDIT_REQUIRES: twine
CIBW_AUDIT_COMMAND: "twine check {wheel}"
CIBW_INHERIT: "audit-requires; audit-command"
```
To control a platform-specific environment variable, add the lowercase platform
suffix to the option name. For example, this prepends `CIBW_BEFORE_ALL_LINUX` to
the value accumulated from the lower-precedence layers:
```yaml
CIBW_BEFORE_ALL_LINUX: yum install -y libffi-devel
CIBW_INHERIT: "before-all-linux: prepend"
```
+1 -2
View File
@@ -1,6 +1,5 @@
--- ---
title: Contributing title: Contributing
ref: contributing
--- ---
# Contributing # Contributing
@@ -27,7 +26,7 @@ Other notes:
### cibuildwheel's relationship with build errors ### cibuildwheel's relationship with build errors
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. 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.
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. 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,6 +1,5 @@
--- ---
title: Modern C++ standards title: Modern C++ standards
ref: cpp-standards
--- ---
# Modern C++ standards # Modern C++ standards
Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 96 KiB

-1
View File
@@ -1,6 +1,5 @@
--- ---
title: Delivering to PyPI title: Delivering to PyPI
ref: deliver-to-pypi
--- ---
# Delivering to PyPI # Delivering to PyPI
+3 -14
View File
@@ -179,30 +179,19 @@
}, },
}, },
{ {
label: 'Repair using auditwheel', label: 'Repair wheel',
href: 'options/#repair-wheel-command', href: 'options/#repair-wheel-command',
platforms: ['android'], platforms: ['android'],
style: 'block', style: 'block',
tooltip: { tooltip: {
title: 'CIBW_REPAIR_WHEEL_COMMAND', title: 'CIBW_REPAIR_WHEEL_COMMAND',
tag: 'Customisable step', tag: 'Customisable step',
description: 'Bundle shared libraries by running auditwheel on each built wheel.' 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.'
},
},
{
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', href: 'options/#repair-wheel-command',
platforms: ['ios', 'pyodide'], platforms: ['windows', 'ios', 'pyodide'],
style: 'dot', style: 'dot',
tooltip: { tooltip: {
title: 'CIBW_REPAIR_WHEEL_COMMAND', title: 'CIBW_REPAIR_WHEEL_COMMAND',
+4 -104
View File
@@ -1,6 +1,5 @@
--- ---
title: Tips and tricks title: Tips and tricks
ref: faq
--- ---
# Tips and tricks # Tips and tricks
@@ -102,51 +101,6 @@ 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. - 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} ### 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. 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.
@@ -158,7 +112,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: If you use GitHub Actions for builds, you can use cibuildwheel as an action:
```yaml ```yaml
uses: pypa/cibuildwheel@v4.1.0 uses: pypa/cibuildwheel@v4.0.0rc1
``` ```
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. 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.
@@ -183,7 +137,7 @@ The second option, and the only one that supports other CI systems, is using a `
```bash ```bash
# requirements-cibw.txt # requirements-cibw.txt
cibuildwheel==4.1.0 cibuildwheel==4.0.0rc1
``` ```
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: 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:
@@ -266,60 +220,6 @@ 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 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). `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 ## Troubleshooting
If your wheel didn't compile, you might have a mistake in your config. If your wheel didn't compile, you might have a mistake in your config.
@@ -334,7 +234,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 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 (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 **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
- the bundled library doesn't accidentally increase the minimum system requirements (such as the minimum macOS version) - 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 - the bundled library matches the architecture of the wheel you're building when cross-compiling
@@ -402,7 +302,7 @@ Solutions to this vary, but the simplest is to use pipx:
# most runners have pipx preinstalled, but in case you don't # most runners have pipx preinstalled, but in case you don't
python3 -m pip install pipx python3 -m pip install pipx
pipx run cibuildwheel==4.1.0 --output-dir wheelhouse pipx run cibuildwheel==4.0.0rc1 --output-dir wheelhouse
pipx run twine upload wheelhouse/*.whl pipx run twine upload wheelhouse/*.whl
``` ```
-1
View File
@@ -1,6 +1,5 @@
--- ---
title: Home title: Home
ref: index
--- ---
# cibuildwheel # cibuildwheel
+23 -83
View File
@@ -1,8 +1,3 @@
---
title: Options
ref: options
---
# Options # Options
<div class="options-toc"></div> <div class="options-toc"></div>
@@ -69,6 +64,7 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
| 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.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.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 | | | | | 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 | | | | 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. The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to cibuildwheel.
@@ -593,12 +589,6 @@ 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. 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. 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. To specify more than one environment variable, separate the assignments by spaces.
Platform-specific environment variables are also available:<br/> Platform-specific environment variables are also available:<br/>
@@ -679,9 +669,6 @@ Platform-specific environment variables are also available:<br/>
!!! note !!! note
cibuildwheel always defines the environment variable `CIBUILDWHEEL=1`. This can be useful for [building wheels with optional extensions](faq.md#optional-extensions). 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 !!! 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. 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.
@@ -734,17 +721,6 @@ 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. 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`. 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 linux, overriding it triggers a new container launch. It cannot be overridden
on macOS and Windows. on macOS and Windows.
@@ -807,9 +783,9 @@ instead.
### `before-build` {: #before-build env-var toml} ### `before-build` {: #before-build env-var toml}
> Execute a shell command preparing each wheel's build > 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 wheel is built. 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 `pip wheel` command. 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 BSD operating system variants) 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 Alpine or ClearLinux users) 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. 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.
@@ -940,44 +916,15 @@ 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} ### `repair-wheel-command` {: #repair-wheel-command env-var toml}
> Execute a shell command to repair each built wheel > Execute a shell command to repair each built wheel
Default: Default:
- on Linux: `'auditwheel repair -w {dest_dir} {wheel}'` - 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 macOS: `'delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}'`
- on Android: `'auditwheel repair --ldpaths {ldpaths} -w {dest_dir} {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 Pyodide: You can use `pyodide auditwheel repair --libdir /path/to/libraries --output-dir {dest_dir} {wheel}` command to repair the 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 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 specify the library directory. You might not want to use the libraries in the system
@@ -987,15 +934,11 @@ Default:
A shell command to repair a built wheel by copying external library dependencies into the wheel tree and relinking them. 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. 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: The following placeholders must be used inside the command and will be replaced by cibuildwheel:
- `{wheel}` for the absolute path to the built wheel - `{wheel}` for the absolute path to the built wheel
- `{dest_dir}` for the absolute path of the directory where to create the repaired 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. - `{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. 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.
@@ -1004,14 +947,24 @@ The command is run in a shell, so you can run multiple commands like `cmd1 && cm
Platform-specific environment variables are also available:<br/> 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` `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 #### Examples
!!! tab examples "pyproject.toml" !!! tab examples "pyproject.toml"
```toml ```toml
# Don't repair Windows wheels # Use delvewheel on windows
[tool.cibuildwheel.windows] [tool.cibuildwheel.windows]
repair-wheel-command = "" before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
# Don't repair macOS wheels # Don't repair macOS wheels
[tool.cibuildwheel.macos] [tool.cibuildwheel.macos]
@@ -1039,8 +992,9 @@ Platform-specific environment variables are also available:<br/>
!!! tab examples "Environment variables" !!! tab examples "Environment variables"
```yaml ```yaml
# Don't repair Windows wheels # Use delvewheel on windows
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
# Don't repair macOS wheels # Don't repair macOS wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
@@ -1444,11 +1398,10 @@ Run shell commands to verify your wheels once they are built. Multiple commands
audit-requires = ["twine"] audit-requires = ["twine"]
audit-command = "twine check {wheel}" audit-command = "twine check {wheel}"
# Add an additional audit command, keeping the default abi3audit check # Add an additional audit command using overrides, keeping the default abi3audit check
[tool.cibuildwheel] [[tool.cibuildwheel.overrides]]
inherit.audit-requires = "append" select = "*"
inherit.audit-command = "append" inherit.audit-command = "append"
audit-requires = ["twine"]
audit-command = "twine check {wheel}" audit-command = "twine check {wheel}"
``` ```
@@ -1464,11 +1417,6 @@ Run shell commands to verify your wheels once they are built. Multiple commands
# Use twine check to validate wheel metadata # Use twine check to validate wheel metadata
CIBW_AUDIT_REQUIRES: "twine" CIBW_AUDIT_REQUIRES: "twine"
CIBW_AUDIT_COMMAND: "twine check {wheel}" CIBW_AUDIT_COMMAND: "twine check {wheel}"
# Add twine check to the default audit configuration
CIBW_AUDIT_REQUIRES: "twine"
CIBW_AUDIT_COMMAND: "twine check {wheel}"
CIBW_INHERIT: "audit-requires; audit-command"
``` ```
@@ -1676,10 +1624,6 @@ Platform-specific environment variables are also available:<br/>
# Install specific versions of test dependencies # Install specific versions of test dependencies
[tool.cibuildwheel] [tool.cibuildwheel]
test-requires = ["pytest==8.2.2", "packaging==24.1"] 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. In configuration files, you can use an array, and the items will be joined with a space.
@@ -1692,10 +1636,6 @@ Platform-specific environment variables are also available:<br/>
# Install specific versions of test dependencies # Install specific versions of test dependencies
CIBW_TEST_REQUIRES: pytest==8.2.2 packaging==24.1 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\"'"
``` ```
+8 -5
View File
@@ -1,6 +1,5 @@
--- ---
title: Platforms title: Platforms
ref: platforms
--- ---
# Platforms # Platforms
@@ -169,7 +168,7 @@ You must target pyodide with `--platform pyodide` (or use `--only` on the identi
### Choosing a Pyodide version {: #pyodide-choosing-a-version} ### 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://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. 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.
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). 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).
@@ -220,9 +219,13 @@ It also requires the following commands to be on the `PATH`:
Android builds will honor the `ANDROID_API_LEVEL` environment variable to set the Android builds will honor the `ANDROID_API_LEVEL` environment variable to set the
minimum supported [API level](https://developer.android.com/tools/releases/platforms) minimum supported [API level](https://developer.android.com/tools/releases/platforms)
for generated wheels. This defaults to 24, which is supported by [99% of active for generated wheels. This will default to the minimum API level of the selected Python
devices](https://dl.google.com/android/studio/metadata/distributions.json), and is the first version.
version to support RUNPATH, which auditwheel needs in order to graft external libraries.
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.
### Build frontend support ### Build frontend support
-1
View File
@@ -1,6 +1,5 @@
--- ---
title: 'Getting started' title: 'Getting started'
ref: setup
--- ---
# Getting started # Getting started
+6 -7
View File
@@ -1,6 +1,5 @@
--- ---
title: Working examples title: Working examples
ref: working-examples
--- ---
<!-- START bin/projects.py --> <!-- START bin/projects.py -->
@@ -82,8 +81,8 @@ ref: working-examples
| [python-rapidjson][] | ![travisci icon][] ![gitlab icon][] | ![windows icon][] ![linux icon][] | Python wrapper around rapidjson | | [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 | | [pybind11 python_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] ![pyodide icon][] | Example pybind11 module built with a Python-based build system |
| [python-snappy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Python bindings for the snappy google library | | [python-snappy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Python bindings for the snappy google library |
| [Confluent client for Kafka][] | ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | setup in `tools/wheels/build-wheels.bat` |
| [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. | | [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 | | [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 | | [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. | | [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. |
@@ -96,8 +95,8 @@ ref: working-examples
| [power-grid-model][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python/C++ library for distribution power system analysis | | [power-grid-model][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python/C++ library for distribution power system analysis |
| [TgCrypto][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. | | [TgCrypto][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [streaming-form-data][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Streaming parser for multipart/form-data written in Cython | | [streaming-form-data][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Streaming parser for multipart/form-data written in Cython |
| [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. |
| [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. | | [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. | | [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. | | [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 | | [Python-WebRTC][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | a Python extension that provides bindings to WebRTC M92 |
@@ -110,8 +109,8 @@ ref: working-examples
| [cf-units][] | ![github icon][] | ![apple icon][] ![linux icon][] | Units of measure as required by the Climate and Forecast (CF) Metadata Conventions | | [cf-units][] | ![github icon][] | ![apple icon][] ![linux icon][] | Units of measure as required by the Climate and Forecast (CF) Metadata Conventions |
| [etebase-py][] | ![travisci icon][] | ![linux icon][] | Python bindings to a Rust library using `setuptools-rust`, and `sccache` for improved speed. | | [etebase-py][] | ![travisci icon][] | ![linux icon][] | Python bindings to a Rust library using `setuptools-rust`, and `sccache` for improved speed. |
| [SiPM][] | ![github icon][] | ![apple icon][] ![linux icon][] | High performance library for SiPM detectors simulation using C++17, OpenMP and AVX2 intrinsics. | | [SiPM][] | ![github icon][] | ![apple icon][] ![linux icon][] | High performance library for SiPM detectors simulation using C++17, OpenMP and AVX2 intrinsics. |
| [aalink][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Async Python interface for Ableton Link. |
| [numpythia][] | ![github icon][] | ![apple icon][] ![linux icon][] | The interface between PYTHIA and NumPy | | [numpythia][] | ![github icon][] | ![apple icon][] ![linux icon][] | The interface between PYTHIA and NumPy |
| [aalink][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Async Python interface for Ableton Link. |
| [pyjet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The interface between FastJet and NumPy | | [pyjet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The interface between FastJet and NumPy |
| [ril][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A python binding to Rust Imaging library using maturin and Pyo3, utilizes Github Action cache to improve speed. Builds abi3 wheels. | | [ril][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A python binding to Rust Imaging library using maturin and Pyo3, utilizes Github Action cache to improve speed. Builds abi3 wheels. |
| [GSD][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Cython and NumPy project with 64-bit wheels. | | [GSD][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Cython and NumPy project with 64-bit wheels. |
@@ -193,8 +192,8 @@ ref: working-examples
[python-rapidjson]: https://github.com/python-rapidjson/python-rapidjson [python-rapidjson]: https://github.com/python-rapidjson/python-rapidjson
[pybind11 python_example]: https://github.com/pybind/python_example [pybind11 python_example]: https://github.com/pybind/python_example
[python-snappy]: https://github.com/intake/python-snappy [python-snappy]: https://github.com/intake/python-snappy
[Confluent client for Kafka]: https://github.com/confluentinc/confluent-kafka-python
[abess]: https://github.com/abess-team/abess [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 [jq.py]: https://github.com/mwilliamson/jq.py
[cyvcf2]: https://github.com/brentp/cyvcf2 [cyvcf2]: https://github.com/brentp/cyvcf2
[matrixprofile]: https://github.com/matrix-profile-foundation/matrixprofile [matrixprofile]: https://github.com/matrix-profile-foundation/matrixprofile
@@ -207,8 +206,8 @@ ref: working-examples
[power-grid-model]: https://github.com/PowerGridModel/power-grid-model [power-grid-model]: https://github.com/PowerGridModel/power-grid-model
[TgCrypto]: https://github.com/pyrogram/tgcrypto [TgCrypto]: https://github.com/pyrogram/tgcrypto
[streaming-form-data]: https://github.com/siddhantgoel/streaming-form-data [streaming-form-data]: https://github.com/siddhantgoel/streaming-form-data
[Imagecodecs (fork)]: https://github.com/czaki/imagecodecs_build
[pybase64]: https://github.com/mayeut/pybase64 [pybase64]: https://github.com/mayeut/pybase64
[Imagecodecs (fork)]: https://github.com/czaki/imagecodecs_build
[boost-histogram]: https://github.com/scikit-hep/boost-histogram [boost-histogram]: https://github.com/scikit-hep/boost-histogram
[bx-python]: https://github.com/bxlab/bx-python [bx-python]: https://github.com/bxlab/bx-python
[Python-WebRTC]: https://github.com/MarshalX/python-webrtc [Python-WebRTC]: https://github.com/MarshalX/python-webrtc
@@ -221,8 +220,8 @@ ref: working-examples
[cf-units]: https://github.com/SciTools/cf-units [cf-units]: https://github.com/SciTools/cf-units
[etebase-py]: https://github.com/etesync/etebase-py [etebase-py]: https://github.com/etesync/etebase-py
[SiPM]: https://github.com/EdoPro98/SimSiPM [SiPM]: https://github.com/EdoPro98/SimSiPM
[aalink]: https://github.com/artfwo/aalink
[numpythia]: https://github.com/scikit-hep/numpythia [numpythia]: https://github.com/scikit-hep/numpythia
[aalink]: https://github.com/artfwo/aalink
[pyjet]: https://github.com/scikit-hep/pyjet [pyjet]: https://github.com/scikit-hep/pyjet
[ril]: https://github.com/Cryptex-github/ril-py [ril]: https://github.com/Cryptex-github/ril-py
[GSD]: https://github.com/glotzerlab/gsd [GSD]: https://github.com/glotzerlab/gsd
+3 -3
View File
@@ -6,7 +6,7 @@ jobs:
- bash: | - bash: |
set -o errexit set -o errexit
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
pip3 install cibuildwheel==4.1.0 pip3 install cibuildwheel==4.0.0rc1
displayName: Install dependencies displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse . - bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels displayName: Build wheels
@@ -20,7 +20,7 @@ jobs:
- bash: | - bash: |
set -o errexit set -o errexit
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
python3 -m pip install cibuildwheel==4.1.0 python3 -m pip install cibuildwheel==4.0.0rc1
displayName: Install dependencies displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse . - bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels displayName: Build wheels
@@ -34,7 +34,7 @@ jobs:
- bash: | - bash: |
set -o errexit set -o errexit
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install cibuildwheel==4.1.0 pip install cibuildwheel==4.0.0rc1
displayName: Install dependencies displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse . - bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels displayName: Build wheels
+3 -3
View File
@@ -11,7 +11,7 @@ jobs:
- run: - run:
name: Build the Linux wheels. name: Build the Linux wheels.
command: | command: |
python3 -m pip install --user cibuildwheel==4.1.0 python3 -m pip install --user cibuildwheel==4.0.0rc1
cibuildwheel --output-dir wheelhouse cibuildwheel --output-dir wheelhouse
- store_artifacts: - store_artifacts:
path: wheelhouse/ path: wheelhouse/
@@ -28,7 +28,7 @@ jobs:
- run: - run:
name: Build the Linux aarch64 wheels. name: Build the Linux aarch64 wheels.
command: | command: |
python3 -m pip install --user cibuildwheel==4.1.0 python3 -m pip install --user cibuildwheel==4.0.0rc1
python3 -m cibuildwheel --output-dir wheelhouse python3 -m cibuildwheel --output-dir wheelhouse
- store_artifacts: - store_artifacts:
path: wheelhouse/ path: wheelhouse/
@@ -44,7 +44,7 @@ jobs:
name: Build the OS X wheels. name: Build the OS X wheels.
command: | command: |
sudo softwareupdate --install-rosetta --agree-to-license # for x86_64/universal2 tests sudo softwareupdate --install-rosetta --agree-to-license # for x86_64/universal2 tests
pip3 install cibuildwheel==4.1.0 pip3 install cibuildwheel==4.0.0rc1
cibuildwheel --output-dir wheelhouse cibuildwheel --output-dir wheelhouse
- store_artifacts: - store_artifacts:
path: wheelhouse/ path: wheelhouse/
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Build wheels - name: Build wheels
uses: pypa/cibuildwheel@v4.1.0 uses: pypa/cibuildwheel@v4.0.0rc1
env: env:
CIBW_PLATFORM: ${{ matrix.platform || 'auto' }} CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
CIBW_ARCHS: ${{ matrix.archs || 'auto' }} CIBW_ARCHS: ${{ matrix.archs || 'auto' }}
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Build wheels - name: Build wheels
uses: pypa/cibuildwheel@v4.1.0 uses: pypa/cibuildwheel@v4.0.0rc1
# env: # env:
# CIBW_SOME_OPTION: value # CIBW_SOME_OPTION: value
# ... # ...
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Build wheels - name: Build wheels
run: pipx run cibuildwheel==4.1.0 run: pipx run cibuildwheel==4.0.0rc1
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
platforms: all platforms: all
- name: Build wheels - name: Build wheels
uses: pypa/cibuildwheel@v4.1.0 uses: pypa/cibuildwheel@v4.0.0rc1
env: env:
# configure cibuildwheel on Linux to build native archs ('auto'), # configure cibuildwheel on Linux to build native archs ('auto'),
# and to split the remaining architectures between the x86_64 and # and to split the remaining architectures between the x86_64 and
+3 -3
View File
@@ -12,7 +12,7 @@ linux:
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
script: script:
- curl -sSL https://get.docker.com/ | sh - curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==4.1.0 - python -m pip install cibuildwheel==4.0.0rc1
- cibuildwheel --output-dir wheelhouse - cibuildwheel --output-dir wheelhouse
artifacts: artifacts:
paths: paths:
@@ -23,7 +23,7 @@ windows:
before_script: before_script:
- choco install python -y --allow-downgrade --version 3.12.4 - choco install python -y --allow-downgrade --version 3.12.4
- choco install git.install -y - choco install git.install -y
- py -m pip install cibuildwheel==4.1.0 - py -m pip install cibuildwheel==4.0.0rc1
script: script:
- py -m cibuildwheel --output-dir wheelhouse --platform windows - py -m cibuildwheel --output-dir wheelhouse --platform windows
artifacts: artifacts:
@@ -35,7 +35,7 @@ windows:
macos: macos:
image: macos-14-xcode-15 image: macos-14-xcode-15
before_script: before_script:
- python3 -m pip install cibuildwheel==4.1.0 - python3 -m pip install cibuildwheel==4.0.0rc1
script: script:
- python3 -m cibuildwheel --output-dir wheelhouse - python3 -m cibuildwheel --output-dir wheelhouse
artifacts: artifacts:
+1 -1
View File
@@ -14,7 +14,7 @@ linux:
- curl -sSL https://get.docker.com/ | sh - curl -sSL https://get.docker.com/ | sh
# Warning: This is extremely slow, be careful with how many wheels you build # Warning: This is extremely slow, be careful with how many wheels you build
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- python -m pip install cibuildwheel==4.1.0 - python -m pip install cibuildwheel==4.0.0rc1
# Assuming your CI runner's default architecture is x86_64... # Assuming your CI runner's default architecture is x86_64...
- cibuildwheel --output-dir wheelhouse --platform linux --archs aarch64 - cibuildwheel --output-dir wheelhouse --platform linux --archs aarch64
artifacts: artifacts:
-2
View File
@@ -58,5 +58,3 @@ plugins:
j2_variable_end_string: » j2_variable_end_string: »
on_error_fail: true on_error_fail: true
on_undefined: strict on_undefined: strict
- intersphinx:
project: cibuildwheel
+5 -2
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "cibuildwheel" name = "cibuildwheel"
version = "4.1.0" version = "4.0.0rc1"
description = "Build Python wheels on CI with minimal configuration." description = "Build Python wheels on CI with minimal configuration."
readme = "README.md" readme = "README.md"
license = "BSD-2-Clause" license = "BSD-2-Clause"
@@ -45,7 +45,11 @@ dependencies = [
"filelock", "filelock",
"humanize", "humanize",
"packaging>=20.9", "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", "platformdirs",
"pyelftools>=0.29",
"wheel>=0.33.6",
] ]
[project.optional-dependencies] [project.optional-dependencies]
@@ -66,7 +70,6 @@ Homepage = "https://github.com/pypa/cibuildwheel"
docs = [ docs = [
"jinja2>=3.1.2", "jinja2>=3.1.2",
"mkdocs-include-markdown-plugin==7.1.8", "mkdocs-include-markdown-plugin==7.1.8",
"mkdocs-intersphinx>=0.1.1; python_version >= '3.12'",
"mkdocs-macros-plugin>=1.4.1", "mkdocs-macros-plugin>=1.4.1",
"mkdocs==1.6.1", "mkdocs==1.6.1",
"pymdown-extensions", "pymdown-extensions",
-1
View File
@@ -35,7 +35,6 @@ def test_dummy_serial() -> None:
""" """
@pytest.mark.flaky(reruns=2, reruns_delay=5)
def test( def test(
tmp_path: Path, build_frontend_env: dict[str, str], capfd: pytest.CaptureFixture[str] tmp_path: Path, build_frontend_env: dict[str, str], capfd: pytest.CaptureFixture[str]
) -> None: ) -> None:
+2 -2
View File
@@ -49,10 +49,10 @@ def test_abi3(tmp_path: Path) -> None:
project_dir, project_dir,
add_env={ add_env={
# free_threaded, GraalPy, and PyPy do not have a Py_LIMITED_API equivalent, just build one of those # free_threaded, GraalPy, and PyPy do not have a Py_LIMITED_API equivalent, just build one of those
# pyodide uses cp314 (the latest stable version) which supports limited API / abi3 # pyodide uses cp313 (the stable version) which supports limited API / abi3
# also limit the number of builds for test performance reasons # also limit the number of builds for test performance reasons
"CIBW_BUILD": ( "CIBW_BUILD": (
"cp314-*" "cp313-*"
if utils.get_platform() == "pyodide" if utils.get_platform() == "pyodide"
else "cp39-* cp310-* pp310-* gp312_250-* cp312-* cp314t-*" else "cp39-* cp310-* pp310-* gp312_250-* cp312-* cp314t-*"
), ),
+18 -202
View File
@@ -13,7 +13,7 @@ from zipfile import ZipFile
import pytest import pytest
from .test_projects import new_c_project, new_meson_project from .test_projects import new_c_project
from .utils import cibuildwheel_run, expected_wheels from .utils import cibuildwheel_run, expected_wheels
pytestmark = pytest.mark.android pytestmark = pytest.mark.android
@@ -125,7 +125,7 @@ def test_frontend_good(tmp_path: Path, build_frontend_env: dict[str, str]) -> No
tmp_path, tmp_path,
add_env={**cp313_env, **build_frontend_env, "CIBW_TEST_COMMAND": "python -m site"}, add_env={**cp313_env, **build_frontend_env, "CIBW_TEST_COMMAND": "python -m site"},
) )
assert wheels == [f"spam-0.1.0-cp313-cp313-android_24_{native_arch.android_abi}.whl"] assert wheels == [f"spam-0.1.0-cp313-cp313-android_21_{native_arch.android_abi}.whl"]
@pytest.mark.parametrize("frontend", ["pip"]) @pytest.mark.parametrize("frontend", ["pip"])
@@ -136,10 +136,7 @@ def test_frontend_bad(frontend: str, tmp_path: Path, capfd: pytest.CaptureFixtur
tmp_path, tmp_path,
add_env={**cp313_env, "CIBW_BUILD_FRONTEND": frontend}, add_env={**cp313_env, "CIBW_BUILD_FRONTEND": frontend},
) )
assert ( assert "Android requires the build frontend to be 'build'" in capfd.readouterr().err
f"Android requires the build frontend to be 'build' or 'uv', not '{frontend}'"
in capfd.readouterr().err
)
@needs_emulator @needs_emulator
@@ -165,7 +162,7 @@ def test_archs(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
), ),
}, },
) )
assert wheels == [f"spam-0.1.0-cp313-cp313-android_24_{arch.android_abi}.whl" for arch in archs] assert wheels == [f"spam-0.1.0-cp313-cp313-android_21_{arch.android_abi}.whl" for arch in archs]
stdout, stderr = capfd.readouterr() stdout, stderr = capfd.readouterr()
lines = (line for line in stdout.splitlines() if line.startswith("Hello from")) lines = (line for line in stdout.splitlines() if line.startswith("Hello from"))
@@ -405,11 +402,7 @@ def test_environment_markers(tmp_path: Path) -> None:
**cp313_env, **cp313_env,
"CIBW_TEST_COMMAND": f"python -m pytest {test_filename}", "CIBW_TEST_COMMAND": f"python -m pytest {test_filename}",
"CIBW_TEST_SOURCES": test_filename, "CIBW_TEST_SOURCES": test_filename,
"CIBW_TEST_REQUIRES": ( "CIBW_TEST_REQUIRES": "pytest certifi;sys_platform=='android' platformdirs;sys_platform!='android'",
"pytest"
" 'certifi; sys_platform == \"android\"'"
" 'platformdirs; sys_platform != \"android\"'"
),
}, },
) )
@@ -442,25 +435,13 @@ def test_verbosity(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
@needs_emulator @needs_emulator
def test_api_level(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None: def test_api_level(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
project = new_c_project( project = new_c_project()
# Check that the the compiler options are set correctly.
spam_c_top_level_add=dedent(
"""\
#if __ANDROID_API__ != 33
#error Unexpected API level; the following syntax error will show the actual value:
__ANDROID_API__
#endif
"""
)
)
project.files["pyproject.toml"] = dedent( project.files["pyproject.toml"] = dedent(
"""\ """\
[build-system] [build-system]
requires = ["setuptools"] requires = ["setuptools"]
[tool.cibuildwheel] [tool.cibuildwheel]
# Test setting API level in pyproject.toml (test_libcxx covers setting
# it in the outer environment.)
android.environment.ANDROID_API_LEVEL = "33" android.environment.ANDROID_API_LEVEL = "33"
android.environment.PIP_EXTRA_INDEX_URL = "https://chaquo.com/pypi-13.1" android.environment.PIP_EXTRA_INDEX_URL = "https://chaquo.com/pypi-13.1"
""" """
@@ -505,21 +486,17 @@ def test_libcxx(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
"PATH": non_venv_path, "PATH": non_venv_path,
} }
# Including external libraries requires API level 24. This is enforced by auditwheel. # Including external libraries requires API level 24.
cp313_android_21_env = {
**cp313_test_env,
# Test setting API level in the outer environment (test_api_level covers setting
# it in pyproject.toml.)
"ANDROID_API_LEVEL": "21",
}
with pytest.raises(CalledProcessError): with pytest.raises(CalledProcessError):
cibuildwheel_run(project_dir, add_env=cp313_android_21_env, output_dir=output_dir) cibuildwheel_run(project_dir, add_env=cp313_test_env, output_dir=output_dir)
assert ( assert "libc++_shared.so requires ANDROID_API_LEVEL to be at least 24" in capfd.readouterr().err
"Grafting libraries with RUNPATH requires API level 24 or higher" in capfd.readouterr().err
)
wheels = cibuildwheel_run(project_dir, add_env=cp313_test_env, output_dir=output_dir) wheels = cibuildwheel_run(
assert wheels == [f"spam-0.1.0-cp313-cp313-android_24_{native_arch.android_abi}.whl"] project_dir,
add_env={**cp313_test_env, "ANDROID_API_LEVEL": "24"},
output_dir=output_dir,
)
assert len(wheels) == 1
names = ZipFile(output_dir / wheels[0]).namelist() names = ZipFile(output_dir / wheels[0]).namelist()
libcxx_names = [ libcxx_names = [
name for name in names if re.fullmatch(r"spam\.libs/libc\+\+_shared-[0-9a-f]{8}\.so", name) name for name in names if re.fullmatch(r"spam\.libs/libc\+\+_shared-[0-9a-f]{8}\.so", name)
@@ -527,177 +504,16 @@ def test_libcxx(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
assert len(libcxx_names) == 1 assert len(libcxx_names) == 1
assert "ham: 1, spam: 0" in capfd.readouterr().out assert "ham: 1, spam: 0" in capfd.readouterr().out
# A C package should not include libc++, and can therefore use an older API level. # A C package should not include libc++.
rmtree(project_dir) rmtree(project_dir)
rmtree(output_dir) rmtree(output_dir)
new_c_project().generate(project_dir) new_c_project().generate(project_dir)
wheels = cibuildwheel_run(project_dir, add_env=cp313_android_21_env, output_dir=output_dir) wheels = cibuildwheel_run(project_dir, add_env=cp313_env, output_dir=output_dir)
assert wheels == [f"spam-0.1.0-cp313-cp313-android_21_{native_arch.android_abi}.whl"] assert len(wheels) == 1
for name in ZipFile(output_dir / wheels[0]).namelist(): for name in ZipFile(output_dir / wheels[0]).namelist():
assert ".libs" not in name assert ".libs" not in name
@needs_emulator
def test_repair_none(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
new_c_project(setup_py_extension_args_add="language='c++'").generate(tmp_path)
with pytest.raises(CalledProcessError):
cibuildwheel_run(
tmp_path,
add_env={
**cp313_env,
"CIBW_REPAIR_WHEEL_COMMAND": "",
"CIBW_TEST_COMMAND": "python -c 'import spam'",
},
)
assert 'dlopen failed: library "libc++_shared.so" not found' in capfd.readouterr().err
def test_repair_ldpaths(tmp_path: Path) -> None:
new_c_project().generate(tmp_path)
repair_path = tmp_path / "repair.py"
repair_path.write_text(
dedent(
"""\
#!/usr/bin/env python
import shutil
import sys
from pathlib import Path
assert len(sys.argv) == 4, sys.argv
ldpaths = list(map(Path, sys.argv[1].split(":")))
dest_dir = sys.argv[2]
wheel = sys.argv[3]
for name in ["libc++_shared.so", "libomp.so"]:
assert any((lp / name).exists() for lp in ldpaths), (name, ldpaths)
shutil.copy(wheel, dest_dir)
"""
)
)
repair_path.chmod(0o755)
wheels = cibuildwheel_run(
tmp_path,
add_env={
**cp313_env,
"CIBW_REPAIR_WHEEL_COMMAND": f"{repair_path} {{ldpaths}} {{dest_dir}} {{wheel}}",
},
)
assert wheels == [f"spam-0.1.0-cp313-cp313-android_24_{native_arch.android_abi}.whl"]
@pytest.mark.parametrize(
("script", "error"),
[
("", "did not produce a wheel"),
("touch $dest_dir/one.whl $dest_dir/two.whl", "produced multiple wheels"),
("touch $dest_dir/one-0.0.1-py3-none-any.whl", "pure Python wheel was generated"),
],
)
def test_repair_error(
script: str, error: str, tmp_path: Path, capfd: pytest.CaptureFixture[str]
) -> None:
new_c_project().generate(tmp_path)
repair_path = tmp_path / "repair.sh"
repair_path.write_text(
dedent(
f"""\
#!/bin/sh
dest_dir=$1
{script}
"""
)
)
repair_path.chmod(0o755)
with pytest.raises(CalledProcessError):
cibuildwheel_run(
tmp_path,
add_env={**cp313_env, "CIBW_REPAIR_WHEEL_COMMAND": f"{repair_path} {{dest_dir}}"},
)
assert error in capfd.readouterr().err
# This also tests integration with pkgconf, because Meson uses it to find Python.
@needs_emulator
def test_meson(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
# Alter spam.filter to return the value of a Fortran function.
new_meson_project(
spam_c_top_level_add="int fortran_func_();",
spam_c_function_add="sts = fortran_func_();",
project_args_add="'fortran',",
extension_args_add="'fortran.f90', link_language: 'fortran',",
).generate(tmp_path)
# TODO: remove once meson-python has a release with Android support.
pyproject_path = tmp_path / "pyproject.toml"
pyproject_path.write_text(
pyproject_path.read_text().replace(
"meson-python", "meson-python @ git+https://github.com/mesonbuild/meson-python@main"
)
)
# Add Fortran code.
(tmp_path / "fortran.f90").write_text(
dedent(
"""\
integer*4 function fortran_func()
fortran_func = 42
end
"""
)
)
script = 'import spam; print(f"result: {spam.filter("")}")'
cibuildwheel_run(
tmp_path,
add_env={**cp313_env, "CIBW_TEST_COMMAND": f"python -c '{script}'"},
)
assert "result: 42" in capfd.readouterr().out
@needs_emulator
def test_xbuild_files(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
# Verify that we've replaced the correct files by compiling against a non-trivial
# function from libnpymath.a.
new_c_project(
setup_py_add=dedent(
"""\
import numpy as np
np_include = np.get_include()
np_lib = f"{np_include}/../lib"
libraries.append("npymath")
"""
),
setup_py_extension_args_add="include_dirs=[np_include], library_dirs=[np_lib]",
spam_c_top_level_add="#include <numpy/halffloat.h>",
spam_c_function_add="sts = npy_float_to_half(42);",
).generate(tmp_path)
(tmp_path / "pyproject.toml").write_text(
dedent(
"""\
[build-system]
requires = ["setuptools", "numpy==2.3.2"]
"""
)
)
script = 'import spam; print(f"result: {spam.filter(""):#x}")'
cibuildwheel_run(
tmp_path,
add_env={
**cp313_env,
# TODO: remove this once there are official Android NumPy wheels on PyPI.
"PIP_EXTRA_INDEX_URL": "https://chaquo.com/pypi-test",
"CIBW_ARCHS": "all", # Include both native and non-native archs.
"CIBW_TEST_COMMAND": f"python -c '{script}'",
},
)
assert "result: 0x5140" in capfd.readouterr().out
@needs_emulator @needs_emulator
def test_setuptools_rust(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None: def test_setuptools_rust(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
""" """
+21 -2
View File
@@ -87,13 +87,13 @@ def get_versions_from_constraint_file(constraint_file: Path) -> dict[str, str]:
return result return result
@pytest.mark.parametrize("python_version", ["3.9", "3.14"]) @pytest.mark.parametrize("python_version", ["3.9", "3.13"])
def test_pinned_versions( def test_pinned_versions(
tmp_path: Path, python_version: str, build_frontend_env_nouv: dict[str, str] tmp_path: Path, python_version: str, build_frontend_env_nouv: dict[str, str]
) -> None: ) -> None:
if utils.get_platform() == "linux": if utils.get_platform() == "linux":
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead") pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")
if python_version != "3.14" and utils.get_platform() == "pyodide": if python_version != "3.13" and utils.get_platform() == "pyodide":
pytest.skip(f"pyodide does not support Python {python_version}") pytest.skip(f"pyodide does not support Python {python_version}")
project_dir = tmp_path / "project" project_dir = tmp_path / "project"
@@ -179,6 +179,19 @@ def test_dependency_constraints(
msg = f"Unknown method: {method}" msg = f"Unknown method: {method}"
raise ValueError(msg) raise ValueError(msg)
skip = ""
if (
utils.get_platform() == "windows"
and method == "file"
and build_frontend_env_nouv["CIBW_BUILD_FRONTEND"] == "build"
):
# 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
skip = "gp311*"
# cross-platform Python script for dependency constraint checks # cross-platform Python script for dependency constraint checks
before_build_script = project_dir / "check_versions.py" before_build_script = project_dir / "check_versions.py"
before_build_script.write_text(CHECK_VERSIONS_SCRIPT) before_build_script.write_text(CHECK_VERSIONS_SCRIPT)
@@ -187,6 +200,7 @@ def test_dependency_constraints(
actual_wheels = utils.cibuildwheel_run( actual_wheels = utils.cibuildwheel_run(
project_dir, project_dir,
add_env={ add_env={
"CIBW_SKIP": skip,
"CIBW_DEPENDENCY_VERSIONS": dependency_version_option, "CIBW_DEPENDENCY_VERSIONS": dependency_version_option,
"CIBW_BEFORE_BUILD": f"python {before_build_script.name}", "CIBW_BEFORE_BUILD": f"python {before_build_script.name}",
"EXPECTED_VERSIONS": json.dumps(tool_versions), "EXPECTED_VERSIONS": json.dumps(tool_versions),
@@ -198,4 +212,9 @@ def test_dependency_constraints(
# also check that we got the right wheels # also check that we got the right wheels
expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True) expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True)
if skip == "gp*":
# See reference to https://github.com/oracle/graalpython/issues/491
# above
expected_wheels = [w for w in expected_wheels if "graalpy311" not in w]
assert set(actual_wheels) == set(expected_wheels) assert set(actual_wheels) == set(expected_wheels)
+2 -2
View File
@@ -48,7 +48,7 @@ def skip_if_ios_testing_not_supported() -> None:
# which is guaranteed to run single-process. # which is guaranteed to run single-process.
# This can also fail the first time sometimes. # This can also fail the first time sometimes.
@pytest.mark.serial @pytest.mark.serial
@pytest.mark.flaky(reruns=1) @pytest.mark.flaky(reruns=2)
@pytest.mark.parametrize( @pytest.mark.parametrize(
"build_config", "build_config",
[ [
@@ -173,7 +173,7 @@ def test_ios_testing_with_placeholder(tmp_path: Path, capfd: pytest.CaptureFixtu
@pytest.mark.serial @pytest.mark.serial
@pytest.mark.flaky(reruns=1) @pytest.mark.flaky(reruns=2)
def test_ios_test_command_short_circuit(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None: def test_ios_test_command_short_circuit(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
skip_if_ios_testing_not_supported() skip_if_ios_testing_not_supported()
+14
View File
@@ -40,12 +40,26 @@ def test_pep518(tmp_path: Path, build_frontend_env: dict[str, str]) -> None:
project_dir = tmp_path / "project" project_dir = tmp_path / "project"
basic_project.generate(project_dir) basic_project.generate(project_dir)
# GraalPy 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
# fixed upstream.
if build_frontend_env["CIBW_BUILD_FRONTEND"] == "build" and utils.get_platform() == "windows":
build_frontend_env["CIBW_SKIP"] = "gp*"
# build the wheels # build the wheels
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=build_frontend_env) actual_wheels = utils.cibuildwheel_run(project_dir, add_env=build_frontend_env)
# check that the expected wheels are produced # check that the expected wheels are produced
expected_wheels = utils.expected_wheels("spam", "0.1.0") expected_wheels = utils.expected_wheels("spam", "0.1.0")
# GraalPy 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
# fixed upstream.
if build_frontend_env["CIBW_BUILD_FRONTEND"] == "build" and utils.get_platform() == "windows":
expected_wheels = [w for w in expected_wheels if "graalpy" not in w]
assert set(actual_wheels) == set(expected_wheels) assert set(actual_wheels) == set(expected_wheels)
# These checks ensure an extra file is not created when using custom # These checks ensure an extra file is not created when using custom
-6
View File
@@ -22,7 +22,6 @@ archs = ["auto64"]
MESON_BUILD_TEMPLATE = r""" MESON_BUILD_TEMPLATE = r"""
project('spam', 'c', project('spam', 'c',
{{ project_args_add | indent(2) }}
version: '0.1.0', version: '0.1.0',
default_options: ['warning_level=2'], default_options: ['warning_level=2'],
) )
@@ -31,7 +30,6 @@ py = import('python').find_installation(pure: false)
py.extension_module('spam', py.extension_module('spam',
'spam.c', 'spam.c',
{{ extension_args_add | indent(2) }}
install: true, install: true,
) )
""" """
@@ -41,8 +39,6 @@ def new_meson_project(
*, *,
spam_c_top_level_add: str = "", spam_c_top_level_add: str = "",
spam_c_function_add: str = "", spam_c_function_add: str = "",
project_args_add: str = "",
extension_args_add: str = "",
) -> TestProject: ) -> TestProject:
project = TestProject() project = TestProject()
@@ -58,8 +54,6 @@ def new_meson_project(
{ {
"spam_c_top_level_add": spam_c_top_level_add, "spam_c_top_level_add": spam_c_top_level_add,
"spam_c_function_add": spam_c_function_add, "spam_c_function_add": spam_c_function_add,
"project_args_add": project_args_add,
"extension_args_add": extension_args_add,
} }
) )
+1 -2
View File
@@ -82,10 +82,9 @@ import sys
from setuptools import setup, Extension from setuptools import setup, Extension
libraries = []
{{ setup_py_add }} {{ setup_py_add }}
libraries = []
# Emscripten fails if you pass -lc... # Emscripten fails if you pass -lc...
# See: https://github.com/emscripten-core/emscripten/issues/16680 # See: https://github.com/emscripten-core/emscripten/issues/16680
if sys.platform.startswith('linux') and "emscripten" not in os.environ.get("_PYTHON_HOST_PLATFORM", ""): if sys.platform.startswith('linux') and "emscripten" not in os.environ.get("_PYTHON_HOST_PLATFORM", ""):
+1 -1
View File
@@ -175,6 +175,6 @@ def test_pyodide_repair_wheel(tmp_path: Path) -> None:
# check that the expected wheels are produced # check that the expected wheels are produced
expected_wheels = [ expected_wheels = [
"spam-0.1.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", "spam-0.1.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl",
] ]
assert set(actual_wheels) == set(expected_wheels) assert set(actual_wheels) == set(expected_wheels)
+17 -14
View File
@@ -31,7 +31,7 @@ EMULATED_ARCHS: Final[list[str]] = sorted(
PYPY_ARCHS = ["x86_64", "i686", "AMD64", "aarch64", "arm64"] PYPY_ARCHS = ["x86_64", "i686", "AMD64", "aarch64", "arm64"]
GRAALPY_ARCHS = ["x86_64", "AMD64", "aarch64", "arm64"] GRAALPY_ARCHS = ["x86_64", "AMD64", "aarch64", "arm64"]
SINGLE_PYTHON_VERSION: Final[tuple[int, int]] = (3, 14) SINGLE_PYTHON_VERSION: Final[tuple[int, int]] = (3, 13)
# temporary workaround: set by build_frontend_env fixture to skip graalpy # temporary workaround: set by build_frontend_env fixture to skip graalpy
# when uv is the build frontend (compatibility issue between graalpy and uv) # when uv is the build frontend (compatibility issue between graalpy and uv)
@@ -177,7 +177,6 @@ def expected_wheels(
musllinux_versions: list[str] | None = None, musllinux_versions: list[str] | None = None,
macosx_deployment_target: str | None = None, macosx_deployment_target: str | None = None,
iphoneos_deployment_target: str | None = None, iphoneos_deployment_target: str | None = None,
android_api_level: int | None = None,
machine_arch: str | None = None, machine_arch: str | None = None,
platform: str | None = None, platform: str | None = None,
python_abi_tags: list[str] | None = None, python_abi_tags: list[str] | None = None,
@@ -202,9 +201,6 @@ def expected_wheels(
if iphoneos_deployment_target is None: if iphoneos_deployment_target is None:
iphoneos_deployment_target = os.environ.get("IPHONEOS_DEPLOYMENT_TARGET", "13.0") iphoneos_deployment_target = os.environ.get("IPHONEOS_DEPLOYMENT_TARGET", "13.0")
if android_api_level is None:
android_api_level = int(os.environ.get("ANDROID_API_LEVEL", "24"))
architectures = [machine_arch] architectures = [machine_arch]
if not single_arch: if not single_arch:
if platform == "linux" and full_auto: if platform == "linux" and full_auto:
@@ -230,7 +226,6 @@ def expected_wheels(
musllinux_versions=musllinux_versions, musllinux_versions=musllinux_versions,
macosx_deployment_target=macosx_deployment_target, macosx_deployment_target=macosx_deployment_target,
iphoneos_deployment_target=iphoneos_deployment_target, iphoneos_deployment_target=iphoneos_deployment_target,
android_api_level=android_api_level,
platform=platform, platform=platform,
python_abi_tags=python_abi_tags, python_abi_tags=python_abi_tags,
include_universal2=include_universal2, include_universal2=include_universal2,
@@ -247,7 +242,6 @@ def _expected_wheels(
musllinux_versions: list[str] | None, musllinux_versions: list[str] | None,
macosx_deployment_target: str, macosx_deployment_target: str,
iphoneos_deployment_target: str, iphoneos_deployment_target: str,
android_api_level: int,
platform: str, platform: str,
python_abi_tags: list[str] | None, python_abi_tags: list[str] | None,
include_universal2: bool, include_universal2: bool,
@@ -278,9 +272,9 @@ def _expected_wheels(
# To be kept in sync with Python versions for Pyodide identifiers in cibuildwheel/selector.py. # To be kept in sync with Python versions for Pyodide identifiers in cibuildwheel/selector.py.
if platform == "pyodide" and python_abi_tags is None: if platform == "pyodide" and python_abi_tags is None:
python_abi_tags = ["cp313-cp313", "cp314-cp314"] python_abi_tags = ["cp313-cp313"]
if EnableGroup.PyodideEoL in enable_groups: if EnableGroup.PyodidePrerelease in enable_groups:
python_abi_tags.insert(0, "cp312-cp312") python_abi_tags.append("cp314-cp314")
elif (platform == "android" and python_abi_tags is None) or ( elif (platform == "android" and python_abi_tags is None) or (
platform == "ios" and python_abi_tags is None platform == "ios" and python_abi_tags is None
): ):
@@ -319,6 +313,7 @@ def _expected_wheels(
if EnableGroup.GraalPy in enable_groups and include_graalpy_in_expected_wheels: if EnableGroup.GraalPy in enable_groups and include_graalpy_in_expected_wheels:
python_abi_tags += [ python_abi_tags += [
"graalpy311-graalpy242_311_native",
"graalpy312-graalpy250_312_native", "graalpy312-graalpy250_312_native",
] ]
@@ -375,7 +370,10 @@ def _expected_wheels(
else: else:
min_macosx = _floor_macosx(macosx_deployment_target, "10.15") min_macosx = _floor_macosx(macosx_deployment_target, "10.15")
elif python_abi_tag.startswith("graalpy"): elif python_abi_tag.startswith("graalpy"):
min_macosx = _floor_macosx(macosx_deployment_target, "10.13") if python_abi_tag.startswith("graalpy311"):
min_macosx = macosx_deployment_target
else:
min_macosx = _floor_macosx(macosx_deployment_target, "10.13")
else: else:
min_macosx = macosx_deployment_target min_macosx = macosx_deployment_target
@@ -389,7 +387,12 @@ def _expected_wheels(
platform_tags.append(f"macosx_{min_macosx.replace('.', '_')}_universal2") platform_tags.append(f"macosx_{min_macosx.replace('.', '_')}_universal2")
elif platform == "android": elif platform == "android":
platform_tags = [f"android_{android_api_level}_{machine_arch}"] api_level = {
"cp313-cp313": 21,
"cp314-cp314": 24,
"cp315-cp315": 24,
}[python_abi_tag]
platform_tags = [f"android_{api_level}_{machine_arch}"]
elif platform == "ios": elif platform == "ios":
if machine_arch == "x86_64": if machine_arch == "x86_64":
@@ -414,8 +417,8 @@ def _expected_wheels(
if not platform_tags: if not platform_tags:
# for example if the python tag is `none` or `abi3`, the wheel # for example if the python tag is `none` or `abi3`, the wheel
# is built by the latest stable cp314 Python version # is built by the stable cp313 Python version
platform_tags = ["pyemscripten_2026_0_wasm32"] platform_tags = ["pyemscripten_2025_0_wasm32"]
else: else:
msg = f"Unsupported platform {platform!r}" msg = f"Unsupported platform {platform!r}"
-31
View File
@@ -7,7 +7,6 @@ import sys
import pytest import pytest
import cibuildwheel.architecture import cibuildwheel.architecture
import cibuildwheel.errors
from cibuildwheel.architecture import Architecture, arch_synonym from cibuildwheel.architecture import Architecture, arch_synonym
TYPE_CHECKING = False TYPE_CHECKING = False
@@ -143,33 +142,3 @@ def test_arch_synonym(
arch: str, from_platform: PlatformName, to_platform: PlatformName, expected: str | None arch: str, from_platform: PlatformName, to_platform: PlatformName, expected: str | None
) -> None: ) -> None:
assert arch_synonym(arch, from_platform, to_platform) == expected assert arch_synonym(arch, from_platform, to_platform) == expected
@pytest.mark.parametrize(
("config", "platform", "expected"),
[
# Case-insensitive, platform-resolved names (issue #2373).
("arm64", "windows", {Architecture.ARM64}),
("ARM64", "windows", {Architecture.ARM64}),
("amd64", "windows", {Architecture.AMD64}),
("AMD64", "windows", {Architecture.AMD64}),
("X86", "windows", {Architecture.x86}),
("x86", "windows", {Architecture.x86}),
# macOS resolves the lowercase arm64 even when given uppercase.
("ARM64", "macos", {Architecture.arm64}),
("arm64", "macos", {Architecture.arm64}),
("X86_64", "macos", {Architecture.x86_64}),
# Multiple, mixed-case archs in one config string.
("arm64 amd64", "windows", {Architecture.ARM64, Architecture.AMD64}),
],
)
def test_arch_parse_config_case_insensitive(
config: str, platform: PlatformName, expected: set[Architecture]
) -> None:
assert Architecture.parse_config(config, platform) == expected
@pytest.mark.parametrize("platform", ["windows", "macos", "linux"])
def test_arch_parse_config_invalid(platform: PlatformName) -> None:
with pytest.raises(cibuildwheel.errors.ConfigurationError):
Architecture.parse_config("nonexistent", platform)
+11 -12
View File
@@ -91,15 +91,14 @@ def test_build_filter_pypy_all() -> None:
assert build_selector("pp39-manylinux_x86_64") assert build_selector("pp39-manylinux_x86_64")
# Re-enable when we have Pyodide 3.15 prerelease builds to test against def test_build_filter_pyodide_prerelease() -> None:
# def test_build_filter_pyodide_prerelease() -> None: build_selector = BuildSelector(
# build_selector = BuildSelector( build_config="*",
# build_config="*", skip_config="",
# skip_config="", enable=frozenset([EnableGroup.PyodidePrerelease]),
# enable=frozenset([EnableGroup.PyodidePrerelease]), )
# ) assert build_selector("cp313-pyodide_wasm32")
# assert build_selector("cp314-pyodide_wasm32") assert build_selector("cp314-pyodide_wasm32")
# assert build_selector("cp315-pyodide_wasm32")
def test_build_filter_pyodide() -> None: def test_build_filter_pyodide() -> None:
@@ -109,8 +108,8 @@ def test_build_filter_pyodide() -> None:
enable=frozenset(), enable=frozenset(),
) )
assert build_selector("cp313-pyodide_wasm32") assert build_selector("cp313-pyodide_wasm32")
assert build_selector("cp314-pyodide_wasm32")
assert not build_selector("cp312-pyodide_wasm32") assert not build_selector("cp312-pyodide_wasm32")
assert not build_selector("cp314-pyodide_wasm32")
def test_build_filter_pyodide_eol() -> None: def test_build_filter_pyodide_eol() -> None:
@@ -121,7 +120,7 @@ def test_build_filter_pyodide_eol() -> None:
) )
assert build_selector("cp312-pyodide_wasm32") assert build_selector("cp312-pyodide_wasm32")
assert build_selector("cp313-pyodide_wasm32") assert build_selector("cp313-pyodide_wasm32")
assert build_selector("cp314-pyodide_wasm32") assert not build_selector("cp314-pyodide_wasm32")
def test_skip() -> None: def test_skip() -> None:
@@ -200,7 +199,7 @@ def test_build_limited_python() -> None:
assert build_selector("cp37-win32") assert build_selector("cp37-win32")
assert build_selector("cp38-win32") assert build_selector("cp38-win32")
assert build_selector("pp37-win_amd64") assert build_selector("pp37-win_amd64")
assert build_selector("gp312_250-win_amd64") assert build_selector("gp311_242-win_amd64")
def test_build_limited_python_partial() -> None: def test_build_limited_python_partial() -> None:
+2 -24
View File
@@ -3,10 +3,7 @@ from __future__ import annotations
import textwrap import textwrap
from pprint import pprint from pprint import pprint
import pytest
import cibuildwheel.platforms.linux import cibuildwheel.platforms.linux
from cibuildwheel.errors import ConfigurationError
from cibuildwheel.oci_container import OCIContainerEngineConfig from cibuildwheel.oci_container import OCIContainerEngineConfig
from cibuildwheel.options import CommandLineArguments, Options from cibuildwheel.options import CommandLineArguments, Options
@@ -14,6 +11,8 @@ TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from pathlib import Path from pathlib import Path
import pytest
def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
""" """
@@ -100,24 +99,3 @@ def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
] ]
assert before_alls(build_steps[3]) == [""] * 4 assert before_alls(build_steps[3]) == [""] * 4
assert container_engines(build_steps[3]) == [default_container_engine] * 4 assert container_engines(build_steps[3]) == [default_container_engine] * 4
def test_package_dir_outside_working_directory_raises_configuration_error(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
work_dir = tmp_path / "work"
work_dir.mkdir()
package_dir = tmp_path / "package"
package_dir.mkdir()
package_dir.joinpath("pyproject.toml").touch()
monkeypatch.chdir(work_dir)
command_line_arguments = CommandLineArguments.defaults()
command_line_arguments.package_dir = package_dir
options = Options(platform="linux", command_line_arguments=command_line_arguments, env={})
with pytest.raises(
ConfigurationError, match="package_dir must be inside the working directory"
):
cibuildwheel.platforms.linux.build(options, tmp_path / "build")

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