Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a76b6fc338 | ||
|
|
ef60c822df | ||
|
|
4aa7d7e9c1 | ||
|
|
03a2ba0bec | ||
|
|
4aaa823c8e | ||
|
|
e6b4e2d355 | ||
|
|
c90accef51 | ||
|
|
2346c5f6e0 | ||
|
|
2125d7117e | ||
|
|
ea08120e25 | ||
|
|
f8168e2a89 | ||
|
|
3431adedba | ||
|
|
733573feb3 | ||
|
|
c5a3ced8c8 | ||
|
|
6f2d68febf | ||
|
|
e8a7a374ee | ||
|
|
cf078b0954 | ||
|
|
b9f1942e8d | ||
|
|
2d6c328457 | ||
|
|
0e8f4f777d | ||
|
|
7e099863cd | ||
|
|
c41b47f7c2 | ||
|
|
6379772957 | ||
|
|
7298563b25 | ||
|
|
db2d59be22 | ||
|
|
e18ab66cca | ||
|
|
b8814b8148 | ||
|
|
e92147f52a | ||
|
|
3bbc772778 | ||
|
|
2b4a8535d9 | ||
|
|
2d6b40d669 | ||
|
|
b1d944060a | ||
|
|
e2b6431822 | ||
|
|
44d6ccfade | ||
|
|
dded469d60 | ||
|
|
1bfec0e7c9 | ||
|
|
327f5c327d | ||
|
|
163864158d | ||
|
|
c3c260dff7 | ||
|
|
fcdbed860e | ||
|
|
9dd7192d89 | ||
|
|
bd641d11de |
@@ -195,7 +195,7 @@ jobs:
|
||||
run: uv run --no-sync pytest --run-emulation ${{ matrix.arch }} test/test_emulation.py
|
||||
|
||||
test-pyodide:
|
||||
name: Test cibuildwheel building Pyodide wheels
|
||||
name: Test pyodide
|
||||
needs: lint
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 180
|
||||
@@ -222,6 +222,19 @@ jobs:
|
||||
env:
|
||||
CIBW_PLATFORM: pyodide
|
||||
|
||||
- name: Run a sample build (GitHub Action) for an overridden Pyodide version
|
||||
uses: ./
|
||||
with:
|
||||
package-dir: sample_proj
|
||||
output-dir: wheelhouse
|
||||
# In case this breaks at any point in time, switch to using the latest version
|
||||
# available or any other version that is not the same as the default one set
|
||||
# in cibuildwheel/resources/build-platforms.toml.
|
||||
env:
|
||||
CIBW_PLATFORM: pyodide
|
||||
CIBW_BUILD: "cp312*"
|
||||
CIBW_PYODIDE_VERSION: "0.27.6"
|
||||
|
||||
- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
|
||||
run: |
|
||||
uv run --no-sync ./bin/run_tests.py
|
||||
|
||||
@@ -55,3 +55,7 @@ jobs:
|
||||
sign-commits: true
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
delete-branch: true
|
||||
labels: |
|
||||
CI: GraalPy
|
||||
CI: PyPy
|
||||
dependencies
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ windows:
|
||||
variables:
|
||||
PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code
|
||||
before_script:
|
||||
- choco install python -y --version 3.12.4
|
||||
- choco install python -y --allow-downgrade --version 3.12.4
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
variables:
|
||||
|
||||
+12
-10
@@ -14,14 +14,14 @@ repos:
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.11.9
|
||||
rev: v0.11.12
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix", "--show-fixes"]
|
||||
- id: ruff-format
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.15.0
|
||||
rev: v1.16.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy 3.11 on cibuildwheel/
|
||||
@@ -62,20 +62,21 @@ repos:
|
||||
name: Disallow improper capitalization
|
||||
language: pygrep
|
||||
entry: PyBind|Numpy|Cmake|Github|PyTest
|
||||
types:
|
||||
- markdown
|
||||
types: [markdown]
|
||||
exclude: ^docs/working-examples\.md$ # Autogenerated
|
||||
- id: update-readme-changelog
|
||||
name: Update README changelog
|
||||
- id: cog
|
||||
name: Cog the README
|
||||
language: python
|
||||
entry: bin/update_readme_changelog.py
|
||||
files: ^docs/changelog.md$
|
||||
pass_filenames: false
|
||||
entry: cog -c -P -r -I ./bin README.md
|
||||
files: '^(README\.md|docs/changelog\.md|docs/options\.md|bin/readme.*)$'
|
||||
additional_dependencies: [cogapp]
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: ["-L", "sur,assertin,hep", "-w"]
|
||||
args: ["-w"]
|
||||
exclude: ^docs/working-examples\.md$ # Autogenerated
|
||||
|
||||
|
||||
@@ -86,7 +87,8 @@ repos:
|
||||
- id: check-github-actions
|
||||
- id: check-github-workflows
|
||||
- id: check-gitlab-ci
|
||||
- id: check-readthedocs
|
||||
# Disabled due to schema issue for now:
|
||||
# - id: check-readthedocs
|
||||
- id: check-travis
|
||||
- id: check-jsonschema
|
||||
name: Check projects
|
||||
|
||||
+3
-3
@@ -3,10 +3,10 @@
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.12"
|
||||
os: ubuntu-24.04
|
||||
commands:
|
||||
- asdf install python 3.14-dev
|
||||
- asdf global python 3.14-dev
|
||||
- asdf plugin add uv
|
||||
- asdf install uv latest
|
||||
- asdf global uv latest
|
||||
|
||||
+8
-2
@@ -16,7 +16,8 @@ jobs:
|
||||
services: docker
|
||||
env:
|
||||
- PYTHON=python
|
||||
- CIBW_ENABLE=all
|
||||
# a build using CIBW_ENABLE=all does not fit into Travis' time limit,
|
||||
# so only the defaults are tested
|
||||
|
||||
- name: Linux | arm64 | Python 3.12
|
||||
python: 3.12
|
||||
@@ -42,10 +43,15 @@ jobs:
|
||||
os: windows
|
||||
language: shell
|
||||
before_install:
|
||||
# http://woshub.com/updating-trusted-root-certificates-in-windows-10
|
||||
- certutil -generateSSTFromWU roots.sst
|
||||
- powershell -Command 'Get-ChildItem -Path roots.sst | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root'
|
||||
- rm -f roots.sst
|
||||
- choco upgrade python3 -y --version 3.12.8 --limit-output --params "/InstallDir:C:\\Python312"
|
||||
env:
|
||||
- PYTHON=C:\\Python312\\python
|
||||
- CIBW_ENABLE=all
|
||||
# a build using CIBW_ENABLE=all does not fit into Travis' time limit,
|
||||
# so only the defaults are tested
|
||||
|
||||
- name: Linux | s390x | Python 3.12
|
||||
python: 3.12
|
||||
|
||||
@@ -23,24 +23,24 @@ What does it do?
|
||||
|
||||
While cibuildwheel itself requires a recent Python version to run (we support the last three releases), it can target the following versions to build wheels:
|
||||
|
||||
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | iOS | Pyodide |
|
||||
|----------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|---|-----|-----|
|
||||
| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | ✅⁴ |
|
||||
| CPython 3.13³ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | ✅ | N/A |
|
||||
| CPython 3.14³ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | ✅ | N/A |
|
||||
| PyPy 3.8 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.9 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.10 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| GraalPy 24.2 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | N/A | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | iOS | Pyodide |
|
||||
|--------------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|---|-----|-----|
|
||||
| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | N/A |
|
||||
| CPython 3.12 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | N/A | ✅⁴ |
|
||||
| CPython 3.13³ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | ✅ | N/A |
|
||||
| CPython 3.14³ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ | ✅⁵ | ✅ | N/A |
|
||||
| PyPy 3.8 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.9 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.10 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
| GraalPy 3.11 v24.2 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | N/A | ✅¹ | N/A | N/A | N/A | N/A | N/A |
|
||||
|
||||
<sup>¹ PyPy & GraalPy are only supported for manylinux wheels.</sup><br>
|
||||
<sup>² Windows arm64 support is experimental.</sup><br>
|
||||
<sup>³ Free-threaded mode requires opt-in using [`CIBW_ENABLE`](https://cibuildwheel.pypa.io/en/stable/options/#enable).</sup><br>
|
||||
<sup>³ Free-threaded mode requires opt-in using [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable).</sup><br>
|
||||
<sup>⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use `--platform pyodide` to build.</sup><br>
|
||||
<sup>⁵ 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>
|
||||
|
||||
@@ -63,7 +63,7 @@ Usage
|
||||
| Travis CI | ✅ | | ✅ | ✅ | | | |
|
||||
| CircleCI | ✅ | ✅ | | ✅ | ✅ | | ✅³ |
|
||||
| Gitlab CI | ✅ | ✅ | ✅ | ✅¹ | ✅ | | ✅³ |
|
||||
| Cirrus CI | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅³ |
|
||||
| Cirrus CI | ✅ | ✅ | ✅ | ✅ | ✅ | | |
|
||||
|
||||
<sup>¹ [Requires emulation](https://cibuildwheel.pypa.io/en/stable/faq/#emulation), distributed separately. Other services may also support Linux ARM through emulation or third-party build hosts, but these are not tested in our CI.</sup><br>
|
||||
<sup>² [Uses cross-compilation](https://cibuildwheel.pypa.io/en/stable/faq/#windows-arm64). It is not possible to test `arm64` on this CI platform.</sup><br>
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
- name: Install cibuildwheel
|
||||
run: python -m pip install cibuildwheel==3.0.0b1
|
||||
run: python -m pip install cibuildwheel==3.0.0b5
|
||||
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
@@ -124,35 +124,47 @@ The following diagram summarises the steps that cibuildwheel takes on each platf
|
||||
|
||||
<sup>Explore an interactive version of this diagram [in the docs](https://cibuildwheel.pypa.io/en/stable/#how-it-works).</sup>
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
<!--[[[cog from readme_options_table import get_table; print(get_table()) ]]]-->
|
||||
|
||||
<!-- This table is auto-generated from docs/options.md by bin/readme_options_table.py -->
|
||||
|
||||
| | Option | Description |
|
||||
|---|--------|-------------|
|
||||
| **Build selection** | [`CIBW_PLATFORM`](https://cibuildwheel.pypa.io/en/stable/options/#platform) | Override the auto-detected target platform |
|
||||
| | [`CIBW_BUILD`](https://cibuildwheel.pypa.io/en/stable/options/#build-skip) <br> [`CIBW_SKIP`](https://cibuildwheel.pypa.io/en/stable/options/#build-skip) | Choose the Python versions to build |
|
||||
| | [`CIBW_ARCHS`](https://cibuildwheel.pypa.io/en/stable/options/#archs) | Change the architectures built on your machine by default. |
|
||||
| | [`CIBW_PROJECT_REQUIRES_PYTHON`](https://cibuildwheel.pypa.io/en/stable/options/#requires-python) | Manually set the Python compatibility of your project |
|
||||
| | [`CIBW_PRERELEASE_PYTHONS`](https://cibuildwheel.pypa.io/en/stable/options/#prerelease-pythons) | Enable building with pre-release versions of Python if available |
|
||||
| **Build customization** | [`CIBW_BUILD_FRONTEND`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) | Set the tool to use to build, either "pip" (default for now) or "build" |
|
||||
| | [`CIBW_ENVIRONMENT`](https://cibuildwheel.pypa.io/en/stable/options/#environment) | Set environment variables needed during the build |
|
||||
| | [`CIBW_ENVIRONMENT_PASS_LINUX`](https://cibuildwheel.pypa.io/en/stable/options/#environment-pass) | Set environment variables on the host to pass-through to the container during the build. |
|
||||
| | [`CIBW_BEFORE_ALL`](https://cibuildwheel.pypa.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. |
|
||||
| | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build |
|
||||
| | [`CIBW_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. |
|
||||
| | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each built wheel |
|
||||
| | [`CIBW_MANYLINUX_*_IMAGE`<br/>`CIBW_MUSLLINUX_*_IMAGE`](https://cibuildwheel.pypa.io/en/stable/options/#linux-image) | Specify alternative manylinux / musllinux Docker images |
|
||||
| | [`CIBW_CONTAINER_ENGINE`](https://cibuildwheel.pypa.io/en/stable/options/#container-engine) | Specify which container engine to use when building Linux wheels |
|
||||
| | [`CIBW_DEPENDENCY_VERSIONS`](https://cibuildwheel.pypa.io/en/stable/options/#dependency-versions) | Specify how cibuildwheel controls the versions of the tools it uses |
|
||||
| **Testing** | [`CIBW_TEST_COMMAND`](https://cibuildwheel.pypa.io/en/stable/options/#test-command) | Execute a shell command to test each built wheel |
|
||||
| | [`CIBW_BEFORE_TEST`](https://cibuildwheel.pypa.io/en/stable/options/#before-test) | Execute a shell command before testing each wheel |
|
||||
| | [`CIBW_TEST_SOURCES`](https://cibuildwheel.pypa.io/en/stable/options/#test-sources) | Files and folders from the source tree that are copied into an isolated tree before running the tests |
|
||||
| | [`CIBW_TEST_REQUIRES`](https://cibuildwheel.pypa.io/en/stable/options/#test-requires) | Install Python dependencies before running the tests |
|
||||
| | [`CIBW_TEST_EXTRAS`](https://cibuildwheel.pypa.io/en/stable/options/#test-extras) | Install your wheel for testing using extras_require |
|
||||
| | [`CIBW_TEST_SKIP`](https://cibuildwheel.pypa.io/en/stable/options/#test-skip) | Skip running tests on some builds |
|
||||
| **Other** | [`CIBW_BUILD_VERBOSITY`](https://cibuildwheel.pypa.io/en/stable/options/#build-verbosity) | Increase/decrease the output of pip wheel |
|
||||
|---|---|---|
|
||||
| **Build selection** | [`platform`](https://cibuildwheel.pypa.io/en/stable/options/#platform) | Override the auto-detected target platform |
|
||||
| | [`build`<br>`skip`](https://cibuildwheel.pypa.io/en/stable/options/#build-skip) | Choose the Python versions to build |
|
||||
| | [`archs`](https://cibuildwheel.pypa.io/en/stable/options/#archs) | Change the architectures built on your machine by default. |
|
||||
| | [`project-requires-python`](https://cibuildwheel.pypa.io/en/stable/options/#requires-python) | Manually set the Python compatibility of your project |
|
||||
| | [`enable`](https://cibuildwheel.pypa.io/en/stable/options/#enable) | Enable building with extra categories of selectors present. |
|
||||
| | [`allow-empty`](https://cibuildwheel.pypa.io/en/stable/options/#allow-empty) | Suppress the error code if no wheels match the specified build identifiers |
|
||||
| **Build customization** | [`build-frontend`](https://cibuildwheel.pypa.io/en/stable/options/#build-frontend) | Set the tool to use to build, either "build" (default), "build\[uv\]", or "pip" |
|
||||
| | [`config-settings`](https://cibuildwheel.pypa.io/en/stable/options/#config-settings) | Specify config-settings for the build backend. |
|
||||
| | [`environment`](https://cibuildwheel.pypa.io/en/stable/options/#environment) | Set environment variables |
|
||||
| | [`environment-pass`](https://cibuildwheel.pypa.io/en/stable/options/#environment-pass) | Set environment variables on the host to pass-through to the container. |
|
||||
| | [`before-all`](https://cibuildwheel.pypa.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. |
|
||||
| | [`before-build`](https://cibuildwheel.pypa.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build |
|
||||
| | [`xbuild-tools`](https://cibuildwheel.pypa.io/en/stable/options/#xbuild-tools) | Binaries on the path that should be included in an isolated cross-build environment. |
|
||||
| | [`repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each built wheel |
|
||||
| | [`manylinux-*-image`<br>`musllinux-*-image`](https://cibuildwheel.pypa.io/en/stable/options/#linux-image) | Specify manylinux / musllinux container images |
|
||||
| | [`container-engine`](https://cibuildwheel.pypa.io/en/stable/options/#container-engine) | Specify the container engine to use when building Linux wheels |
|
||||
| | [`dependency-versions`](https://cibuildwheel.pypa.io/en/stable/options/#dependency-versions) | Control the versions of the tools cibuildwheel uses |
|
||||
| | [`pyodide-version`](https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version) | Specify the Pyodide version to use for `pyodide` platform builds |
|
||||
| **Testing** | [`test-command`](https://cibuildwheel.pypa.io/en/stable/options/#test-command) | The command to test each built wheel |
|
||||
| | [`before-test`](https://cibuildwheel.pypa.io/en/stable/options/#before-test) | Execute a shell command before testing each wheel |
|
||||
| | [`test-sources`](https://cibuildwheel.pypa.io/en/stable/options/#test-sources) | Files and folders from the source tree that are copied into an isolated tree before running the tests |
|
||||
| | [`test-requires`](https://cibuildwheel.pypa.io/en/stable/options/#test-requires) | Install Python dependencies before running the tests |
|
||||
| | [`test-extras`](https://cibuildwheel.pypa.io/en/stable/options/#test-extras) | Install your wheel for testing using `extras_require` |
|
||||
| | [`test-groups`](https://cibuildwheel.pypa.io/en/stable/options/#test-groups) | Specify test dependencies from your project's `dependency-groups` |
|
||||
| | [`test-skip`](https://cibuildwheel.pypa.io/en/stable/options/#test-skip) | Skip running tests on some builds |
|
||||
| | [`test-environment`](https://cibuildwheel.pypa.io/en/stable/options/#test-environment) | Set environment variables for the test environment |
|
||||
| **Debugging** | [`debug-keep-container`](https://cibuildwheel.pypa.io/en/stable/options/#debug-keep-container) | Keep the container after running for debugging. |
|
||||
| | [`debug-traceback`](https://cibuildwheel.pypa.io/en/stable/options/#debug-traceback) | Print full traceback when errors occur. |
|
||||
| | [`build-verbosity`](https://cibuildwheel.pypa.io/en/stable/options/#build-verbosity) | Increase/decrease the output of the build |
|
||||
|
||||
These options can be specified in a pyproject.toml file, as well; see [configuration](https://cibuildwheel.pypa.io/en/stable/options/#configuration).
|
||||
|
||||
<!--[[[end]]] (checksum: 4d6a8418630e9ed43251973d93798a1b) -->
|
||||
|
||||
These options can be specified in a pyproject.toml file, or as environment variables, see [configuration docs](https://cibuildwheel.pypa.io/en/latest/configuration/).
|
||||
|
||||
Working examples
|
||||
----------------
|
||||
@@ -167,8 +179,8 @@ Here are some repos that use cibuildwheel.
|
||||
|-----------------------------------|----|----|:------|
|
||||
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
|
||||
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
|
||||
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
|
||||
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an analytical in-process SQL database management system |
|
||||
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
|
||||
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
|
||||
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
|
||||
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The venerable Matplotlib, a Python library with C++ portions |
|
||||
@@ -178,8 +190,8 @@ Here are some repos that use cibuildwheel.
|
||||
|
||||
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
|
||||
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
|
||||
[NumPy]: https://github.com/numpy/numpy
|
||||
[duckdb]: https://github.com/duckdb/duckdb
|
||||
[NumPy]: https://github.com/numpy/numpy
|
||||
[Tornado]: https://github.com/tornadoweb/tornado
|
||||
[NCNN]: https://github.com/Tencent/ncnn
|
||||
[Matplotlib]: https://github.com/matplotlib/matplotlib
|
||||
@@ -213,53 +225,57 @@ This is similar to static linking, so it might have some license implications. C
|
||||
Changelog
|
||||
=========
|
||||
|
||||
<!-- START bin/update_readme_changelog.py -->
|
||||
|
||||
<!-- this section was generated by bin/update_readme_changelog.py -- do not edit manually -->
|
||||
<!-- [[[cog from readme_changelog import mini_changelog; print(mini_changelog()) ]]] -->
|
||||
|
||||
### v3.0.0
|
||||
|
||||
Not yet released, but available for testing
|
||||
Not yet released, but available for testing.
|
||||
|
||||
#### v3.0.0b1
|
||||
Note - when using a beta version, be sure to check the [latest docs](https://cibuildwheel.pypa.io/en/latest/), rather than the stable version, which is still on v2.X.
|
||||
|
||||
_19 May 2025_
|
||||
<!--
|
||||
note to self, when doing final release, change to docs URLs in this section to the stable version!
|
||||
-->
|
||||
|
||||
- 🌟 Adds the ability to [build wheels for iOS](https://cibuildwheel.pypa.io/en/latest/platforms/#ios)! Set the [`platform` option](https://cibuildwheel.pypa.io/en/latest/options/#platform) to `ios` on a Mac with the iOS toolchain to try it out!
|
||||
- 🌟 Adds support for the GraalPy interpreter! Enable for your project using the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable). (#1538)
|
||||
- ✨ Adds CPython 3.14 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.14.0b1.
|
||||
If you've used previous versions of the beta:
|
||||
- ⚠️ Previous betas of v3.0 changed the working directory for tests. This has been rolled back to the v2.x behaviour, so you might need to change configs if you adapted to the beta 1 or 2 behaviour. See [issue #2406](https://github.com/pypa/cibuildwheel/issues/2406) for more information.
|
||||
- ⚠️ GraalPy shipped with the identifier `gp242-*` in previous betas, this has been changed to `gp311_242-*` to be consistent with other interpreters, and to fix a bug with GraalPy and project requires-python detection. If you were using GraalPy, you might need to update your config to use the new identifier.
|
||||
- ⚠️ `test-sources` now uses `project` directory instead of the `package` directory (matching the docs).
|
||||
|
||||
_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 the [test-sources option](https://cibuildwheel.pypa.io/en/latest/options/#test-sources). \[discussion about the test cwd change and how to use to come!\]
|
||||
- ✨ Added `dependency-versions` inline syntax (#2123)
|
||||
- 🛠 EOL manylinux options can no longer be specified by their shortname. Full OCI URL can still be used for these images, if you wish (#2316)
|
||||
- 🛠 Build environments no longer have setuptools and wheel preinstalled. (#2329)
|
||||
- ⚠️ PyPy wheels no longer built by default, due to a change to our options system. To continue building PyPy wheels, you'll now need to set the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) to `pypy` or `pypy-eol`.
|
||||
- ⚠️ Dropped official support for Appveyor. If it was working for you before, it will probably continue to do so, but we can't be sure, because our CI doesn't run there anymore. (#2386)
|
||||
- 📚 A reorganisation of the docs, and numerous updates (#2280)
|
||||
#### v3.0.0b5
|
||||
|
||||
### v2.23.3
|
||||
_3 June 2025_
|
||||
|
||||
_26 April 2025_
|
||||
- ✨ Support multiple commands on iOS, joined by `&&`, like the other platforms. (#2432)
|
||||
- ✨ Add `pyodide-prerelease` enable option, with an early build of 0.28 (Python 3.13). (#2431)
|
||||
- 🛠 test-sources now uses the `project` directory instead of the `package` directory (matching the docs). (#2437)
|
||||
- 🛠 Fixed a bug with GraalPy if vsdevcmd prints an error. Cirrus CI works again. (#2414)
|
||||
- 🛠 Use the standard Schema line for the integrated JSONSchema. (#2433)
|
||||
- 📚 Use Python 3.14 color output in docs CLI output. (#2407)
|
||||
|
||||
- 🛠 Dependency updates, including Python 3.13.3 (#2371)
|
||||
#### v3.0.0b4
|
||||
|
||||
### v2.23.2
|
||||
_29 May 2025_
|
||||
|
||||
_24 March 2025_
|
||||
- 🛠 Dependency updates, including Python 3.14.0b2. (#2371)
|
||||
- 🛠 Remove the addition of `PYTHONSAFEPATH` to `test-environment`. (#2429)
|
||||
- 📚 README table now matches docs and auto-updates. (#2427, #2428)
|
||||
|
||||
- 🐛 Workaround an issue with pyodide builds when running cibuildwheel with a Python that was installed via UV (#2328 via #2331)
|
||||
- 🛠 Dependency updates, including a manylinux update that fixes an ['undefined symbol' error](https://github.com/pypa/manylinux/issues/1760) in gcc-toolset (#2334)
|
||||
-
|
||||
#### v3.0.0b3
|
||||
|
||||
### v2.23.1
|
||||
_28 May 2025_
|
||||
|
||||
_15 March 2025_
|
||||
- 🛠 Reverts the test working dir (when test-sources isn't set) to a temporary dir, rather than the project. (#2420)
|
||||
- 📚 Docs now primarily use the pyproject.toml name of options, rather than the environment variable name. (#2389)
|
||||
|
||||
- ⚠️ Added warnings when the shorthand values `manylinux1`, `manylinux2010`, `manylinux_2_24`, and `musllinux_1_1` are used to specify the images in linux builds. The shorthand to these (unmaintainted) images will be removed in v3.0. If you want to keep using these images, explicitly opt-in using the full image URL, which can be found in [this file](https://github.com/pypa/cibuildwheel/blob/v2.23.1/cibuildwheel/resources/pinned_docker_images.cfg). (#2312)
|
||||
- 🛠 Dependency updates, including a manylinux update which fixes an [issue with rustup](https://github.com/pypa/cibuildwheel/issues/2303). (#2315)
|
||||
#### v3.0.0b2
|
||||
|
||||
<!-- END bin/update_readme_changelog.py -->
|
||||
_25 May 2025_
|
||||
|
||||
- ✨ Adds the [`CIBW_TEST_ENVIRONMENT`](https://cibuildwheel.pypa.io/en/latest/options/#test-environment) option, which allows you to set environment variables for the test command. cibuildwheel now sets `PYTHONSAFEPATH=1` in test environments by default, to avoid picking up package imports from the local directory - we want to test the installed wheel, not the source tree! You can change that, or any other environment variable in the test environment using this option. (#2388)
|
||||
- ✨ Improves support for Pyodide builds and adds the [`CIBW_PYODIDE_VERSION`](https://cibuildwheel.pypa.io/en/latest/options/#pyodide-version) option, which allows you to specify the version of Pyodide to use for builds. (#2002)
|
||||
|
||||
<!-- [[[end]]] (checksum: c95d170eee4d70055d927723c033426a) -->
|
||||
|
||||
---
|
||||
|
||||
|
||||
+1
-2
@@ -24,11 +24,10 @@ branding:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
# Set up the version of Python that supports pyodide
|
||||
- uses: actions/setup-python@v5
|
||||
id: python
|
||||
with:
|
||||
python-version: "3.12"
|
||||
python-version: "3.11 - 3.13"
|
||||
update-environment: false
|
||||
|
||||
- id: cibw
|
||||
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
|
||||
from cibuildwheel.extra import get_pyodide_xbuildenv_info
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument(
|
||||
"pyodide-version",
|
||||
type=str,
|
||||
)
|
||||
@click.option(
|
||||
"--output-file",
|
||||
type=click.Path(),
|
||||
default=None,
|
||||
help="Output file to write the constraints to. If not provided, the constraints will be printed to stdout.",
|
||||
)
|
||||
def generate_pyodide_constraints(pyodide_version: str, output_file: str | None = None) -> None:
|
||||
"""
|
||||
Generate constraints for a specific Pyodide version. The constraints are
|
||||
generated based on the Pyodide version's xbuildenv info, which is retrieved
|
||||
from the Pyodide repository.
|
||||
|
||||
These constraints should then be 'pinned' using `uv pip compile`.
|
||||
|
||||
Example usage:
|
||||
|
||||
bin/generate_pyodide_constraints.py 0.27.0
|
||||
"""
|
||||
xbuildenv_info = get_pyodide_xbuildenv_info()
|
||||
try:
|
||||
pyodide_version_xbuildenv_info = xbuildenv_info["releases"][pyodide_version]
|
||||
except KeyError as e:
|
||||
msg = f"Pyodide version {pyodide_version} not found in xbuildenv info. Versions available: {', '.join(xbuildenv_info['releases'].keys())}"
|
||||
raise click.BadParameter(msg) from e
|
||||
|
||||
pyodide_build_min_version = pyodide_version_xbuildenv_info.get("min_pyodide_build_version")
|
||||
pyodide_build_max_version = pyodide_version_xbuildenv_info.get("max_pyodide_build_version")
|
||||
|
||||
pyodide_build_specifier_parts: list[str] = []
|
||||
|
||||
if pyodide_build_min_version:
|
||||
pyodide_build_specifier_parts.append(f">={pyodide_build_min_version}")
|
||||
if pyodide_build_max_version:
|
||||
pyodide_build_specifier_parts.append(f"<={pyodide_build_max_version}")
|
||||
|
||||
pyodide_build_specifier = ",".join(pyodide_build_specifier_parts)
|
||||
|
||||
constraints_txt = textwrap.dedent(f"""
|
||||
pip
|
||||
build[virtualenv]
|
||||
pyodide-build{pyodide_build_specifier}
|
||||
click<8.2
|
||||
""")
|
||||
|
||||
if output_file is None:
|
||||
print(constraints_txt)
|
||||
else:
|
||||
Path(output_file).write_text(constraints_txt)
|
||||
print(f"Constraints written to {output_file}", file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_pyodide_constraints()
|
||||
+11
-3
@@ -21,7 +21,7 @@ parser.add_argument("--schemastore", action="store_true", help="Generate schema_
|
||||
args = parser.parse_args()
|
||||
|
||||
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
|
||||
$defs:
|
||||
inherit:
|
||||
@@ -33,11 +33,13 @@ $defs:
|
||||
description: How to inherit the parent's value.
|
||||
enable:
|
||||
enum:
|
||||
- cpython-experimental-riscv64
|
||||
- cpython-freethreading
|
||||
- cpython-prerelease
|
||||
- graalpy
|
||||
- pyodide-prerelease
|
||||
- pypy
|
||||
- pypy-eol
|
||||
- cpython-experimental-riscv64
|
||||
description: A Python version or flavor to enable.
|
||||
additionalProperties: false
|
||||
description: cibuildwheel's settings.
|
||||
@@ -197,6 +199,9 @@ properties:
|
||||
xbuild-tools:
|
||||
description: Binaries on the path that should be included in an isolated cross-build environment
|
||||
type: string_array
|
||||
pyodide-version:
|
||||
type: string
|
||||
description: Specify the version of Pyodide to use
|
||||
repair-wheel-command:
|
||||
description: Execute a shell command to repair each built wheel.
|
||||
type: string_array
|
||||
@@ -221,6 +226,9 @@ properties:
|
||||
test-skip:
|
||||
description: Skip running tests on some builds.
|
||||
type: string_array
|
||||
test-environment:
|
||||
description: Set environment variables for the test environment
|
||||
type: string_table
|
||||
"""
|
||||
|
||||
schema = yaml.safe_load(starter)
|
||||
@@ -300,6 +308,7 @@ items:
|
||||
test-extras: {"$ref": "#/$defs/inherit"}
|
||||
test-sources: {"$ref": "#/$defs/inherit"}
|
||||
test-requires: {"$ref": "#/$defs/inherit"}
|
||||
test-environment: {"$ref": "#/$defs/inherit"}
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -358,7 +367,6 @@ schema["properties"] |= oses
|
||||
|
||||
if args.schemastore:
|
||||
schema["$id"] = "https://json.schemastore.org/partial-cibuildwheel.json"
|
||||
schema["$schema"] = "http://json-schema.org/draft-07/schema#"
|
||||
schema["description"] = (
|
||||
"cibuildwheel's toml file, generated with ./bin/generate_schema.py --schemastore from cibuildwheel."
|
||||
)
|
||||
|
||||
@@ -135,6 +135,7 @@ def fetch_icon(icon_name: str) -> None:
|
||||
|
||||
document = xml.dom.minidom.parseString(original_svg_data)
|
||||
svgElement = document.documentElement
|
||||
assert svgElement is not None
|
||||
assert svgElement.nodeName == "svg"
|
||||
svgElement.setAttribute("width", "16px")
|
||||
svgElement.setAttribute("fill", "#606060")
|
||||
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).parent / ".."
|
||||
CHANGELOG_FILE = PROJECT_ROOT / "docs" / "changelog.md"
|
||||
|
||||
# https://regexr.com/622ds
|
||||
FIRST_5_CHANGELOG_ENTRIES_REGEX = re.compile(r"""(^###.*?(?=###)){5}""", re.DOTALL | re.MULTILINE)
|
||||
|
||||
|
||||
def mini_changelog() -> str:
|
||||
changelog_text = CHANGELOG_FILE.read_text()
|
||||
|
||||
mini_changelog_match = FIRST_5_CHANGELOG_ENTRIES_REGEX.search(changelog_text)
|
||||
assert mini_changelog_match, "Failed to find the first few changelog entries"
|
||||
|
||||
return f"\n{mini_changelog_match.group(0).strip()}\n"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(mini_changelog())
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import dataclasses
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
DIR: Final[Path] = Path(__file__).parent.parent.resolve()
|
||||
OPTIONS_MD: Final[Path] = DIR / "docs" / "options.md"
|
||||
|
||||
SECTION_HEADER_REGEX = re.compile(r"^## (?P<name>.*?)$", re.MULTILINE)
|
||||
|
||||
# https://regexr.com/8f1ff
|
||||
OPTION_HEADER_REGEX = re.compile(
|
||||
r"^### (?P<name>.*?){.*#(?P<id>\S+).*}\n+> ?(?P<desc>.*)$", re.MULTILINE
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass(kw_only=True)
|
||||
class Option:
|
||||
name: str
|
||||
id: str
|
||||
desc: str
|
||||
section: str
|
||||
|
||||
|
||||
def get_table() -> str:
|
||||
options_md = OPTIONS_MD.read_text(encoding="utf-8")
|
||||
|
||||
sections = SECTION_HEADER_REGEX.split(options_md)[1:]
|
||||
|
||||
options = []
|
||||
|
||||
for section_name, section_content in zip(sections[0::2], sections[1::2], strict=True):
|
||||
for match in OPTION_HEADER_REGEX.finditer(section_content):
|
||||
option = Option(
|
||||
name=match.group("name").strip(),
|
||||
id=match.group("id").strip(),
|
||||
desc=match.group("desc").strip(),
|
||||
section=section_name.strip(),
|
||||
)
|
||||
options.append(option)
|
||||
|
||||
table_md = "\n<!-- This table is auto-generated from docs/options.md by bin/readme_options_table.py -->\n\n"
|
||||
table_md += "| | Option | Description |\n"
|
||||
table_md += "|---|---|---|\n"
|
||||
last_section: str | None = None
|
||||
|
||||
for option in options:
|
||||
cells: list[str] = []
|
||||
|
||||
cells.append(f"**{option.section}**" if option.section != last_section else "")
|
||||
last_section = option.section
|
||||
|
||||
url = f"https://cibuildwheel.pypa.io/en/stable/options/#{option.id}"
|
||||
name = option.name.replace(", ", "<br>") # Replace commas with line breaks
|
||||
cells.append(f"[{name}]({url})")
|
||||
|
||||
cells.append(option.desc)
|
||||
|
||||
table_md += "| " + " | ".join(cells) + " |\n"
|
||||
table_md += "\n"
|
||||
|
||||
return table_md
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(get_table())
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import configparser
|
||||
from dataclasses import dataclass
|
||||
import dataclasses
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
@@ -11,7 +11,7 @@ DIR = Path(__file__).parent.resolve()
|
||||
RESOURCES = DIR.parent / "cibuildwheel/resources"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Image:
|
||||
manylinux_version: str
|
||||
platforms: list[str]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import dataclasses
|
||||
import difflib
|
||||
import logging
|
||||
import tomllib
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
@@ -27,7 +27,7 @@ NODEJS_DIST: Final[str] = "https://nodejs.org/dist/"
|
||||
NODEJS_INDEX: Final[str] = f"{NODEJS_DIST}index.json"
|
||||
|
||||
|
||||
@dataclass(frozen=True, order=True)
|
||||
@dataclasses.dataclass(frozen=True, order=True)
|
||||
class VersionTuple:
|
||||
version: Version
|
||||
version_string: str
|
||||
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
|
||||
from cibuildwheel.extra import github_api_request
|
||||
from cibuildwheel.util.python_build_standalone import (
|
||||
PythonBuildStandaloneAsset,
|
||||
PythonBuildStandaloneReleaseData,
|
||||
)
|
||||
from cibuildwheel.util.resources import PYTHON_BUILD_STANDALONE_RELEASES
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""
|
||||
This script updates the vendored list of release assets to the latest
|
||||
version of astral-sh/python-build-standalone.
|
||||
"""
|
||||
|
||||
# Get the latest release tag from the GitHub API
|
||||
latest_release = github_api_request("repos/astral-sh/python-build-standalone/releases/latest")
|
||||
latest_tag = latest_release["tag_name"]
|
||||
|
||||
# Get the list of assets for the latest release
|
||||
github_assets = github_api_request(
|
||||
f"repos/astral-sh/python-build-standalone/releases/tags/{latest_tag}"
|
||||
)["assets"]
|
||||
|
||||
assets: list[PythonBuildStandaloneAsset] = []
|
||||
|
||||
for github_asset in github_assets:
|
||||
name = github_asset["name"]
|
||||
if not name.endswith("install_only.tar.gz"):
|
||||
continue
|
||||
url = github_asset["browser_download_url"]
|
||||
assets.append({"name": name, "url": url})
|
||||
|
||||
# Write the assets to the JSON file. One day, we might need to support
|
||||
# multiple releases, but for now, we only support the latest one
|
||||
json_file_contents: PythonBuildStandaloneReleaseData = {
|
||||
"releases": [
|
||||
{
|
||||
"tag": latest_tag,
|
||||
"assets": assets,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
with PYTHON_BUILD_STANDALONE_RELEASES.open("w", encoding="utf-8") as f:
|
||||
json.dump(json_file_contents, f, indent=2)
|
||||
# Add a trailing newline, our pre-commit hook requires it
|
||||
f.write("\n")
|
||||
|
||||
print(
|
||||
f"Updated {PYTHON_BUILD_STANDALONE_RELEASES.name} with {len(assets)} assets for tag {latest_tag}"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+61
-4
@@ -19,7 +19,7 @@ from packaging.version import Version
|
||||
from rich.logging import RichHandler
|
||||
from rich.syntax import Syntax
|
||||
|
||||
from cibuildwheel.extra import dump_python_configurations
|
||||
from cibuildwheel.extra import dump_python_configurations, get_pyodide_xbuildenv_info
|
||||
|
||||
log = logging.getLogger("cibw")
|
||||
|
||||
@@ -57,7 +57,14 @@ class ConfigApple(TypedDict):
|
||||
url: str
|
||||
|
||||
|
||||
AnyConfig = ConfigWinCP | ConfigWinPP | ConfigWinGP | ConfigApple
|
||||
class ConfigPyodide(TypedDict):
|
||||
identifier: str
|
||||
version: str
|
||||
default_pyodide_version: str
|
||||
node_version: str
|
||||
|
||||
|
||||
AnyConfig = ConfigWinCP | ConfigWinPP | ConfigWinGP | ConfigApple | ConfigPyodide
|
||||
|
||||
|
||||
# The following set of "Versions" classes allow the initial call to the APIs to
|
||||
@@ -140,7 +147,11 @@ class GraalPyVersions:
|
||||
msg = f"{identifier} not supported yet on GraalPy"
|
||||
raise RuntimeError(msg)
|
||||
|
||||
gpspec_str = identifier.split("-")[0].split("_")[1]
|
||||
gpspec = Specifier("==24.2.*") if gpspec_str == "242" else Specifier(f"=={gpspec_str}.*")
|
||||
|
||||
releases = [r for r in self.releases if spec.contains(r["python_version"])]
|
||||
releases = [r for r in self.releases if gpspec.contains(r["graalpy_version"])]
|
||||
releases = sorted(releases, key=lambda r: r["graalpy_version"])
|
||||
|
||||
if not releases:
|
||||
@@ -269,8 +280,12 @@ class CPythonVersions:
|
||||
|
||||
self.versions_dict: dict[Version, int] = {}
|
||||
for release in releases_info:
|
||||
# Removing the prefix, Python 3.9 would use: release["name"].removeprefix("Python ")
|
||||
version = Version(release["name"][7:])
|
||||
# Skip the pymanager releases
|
||||
if not release["slug"].startswith("python"):
|
||||
continue
|
||||
|
||||
# Removing the prefix
|
||||
version = Version(release["name"].removeprefix("Python "))
|
||||
|
||||
uri = int(release["resource_uri"].rstrip("/").split("/")[-1])
|
||||
self.versions_dict[version] = uri
|
||||
@@ -347,6 +362,39 @@ class CPythonIOSVersions:
|
||||
return None
|
||||
|
||||
|
||||
class PyodideVersions:
|
||||
def __init__(self) -> None:
|
||||
xbuildenv_info = get_pyodide_xbuildenv_info()
|
||||
self.releases = xbuildenv_info["releases"]
|
||||
|
||||
def update_version_pyodide(
|
||||
self, identifier: str, version: Version, spec: Specifier, node_version: str
|
||||
) -> ConfigPyodide | None:
|
||||
# get releases that match the python version
|
||||
releases = [
|
||||
r for r in self.releases.values() if spec.contains(Version(r["python_version"]))
|
||||
]
|
||||
# sort by version, latest first
|
||||
releases.sort(key=lambda r: Version(r["version"]), reverse=True)
|
||||
|
||||
if not releases:
|
||||
msg = f"Pyodide not found for {spec}!"
|
||||
raise ValueError(msg)
|
||||
|
||||
final_releases = [r for r in releases if not Version(r["version"]).is_prerelease]
|
||||
|
||||
# prefer a final release if available, otherwise use the latest
|
||||
# pre-release
|
||||
release = final_releases[0] if final_releases else releases[0]
|
||||
|
||||
return ConfigPyodide(
|
||||
identifier=identifier,
|
||||
version=str(version),
|
||||
default_pyodide_version=release["version"],
|
||||
node_version=node_version,
|
||||
)
|
||||
|
||||
|
||||
# This is a universal interface to all the above Versions classes. Given an
|
||||
# identifier, it updates a config dict.
|
||||
|
||||
@@ -369,6 +417,8 @@ class AllVersions:
|
||||
|
||||
self.graalpy = GraalPyVersions()
|
||||
|
||||
self.pyodide = PyodideVersions()
|
||||
|
||||
def update_config(self, config: MutableMapping[str, str]) -> None:
|
||||
identifier = config["identifier"]
|
||||
version = Version(config["version"])
|
||||
@@ -407,6 +457,10 @@ class AllVersions:
|
||||
config_update = self.windows_arm64.update_version_windows(spec)
|
||||
elif "ios" in identifier:
|
||||
config_update = self.ios_cpython.update_version_ios(identifier, version)
|
||||
elif "pyodide" in identifier:
|
||||
config_update = self.pyodide.update_version_pyodide(
|
||||
identifier, version, spec, config["node_version"]
|
||||
)
|
||||
|
||||
assert config_update is not None, f"{identifier} not found!"
|
||||
config.update(**config_update)
|
||||
@@ -445,6 +499,9 @@ def update_pythons(force: bool, level: str) -> None:
|
||||
for config in configs["ios"]["python_configurations"]:
|
||||
all_versions.update_config(config)
|
||||
|
||||
for config in configs["pyodide"]["python_configurations"]:
|
||||
all_versions.update_config(config)
|
||||
|
||||
result_toml = dump_python_configurations(configs)
|
||||
|
||||
rich.print() # spacer
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).parent / ".."
|
||||
CHANGELOG_FILE = PROJECT_ROOT / "docs" / "changelog.md"
|
||||
README_FILE = PROJECT_ROOT / "README.md"
|
||||
|
||||
# https://regexr.com/622ds
|
||||
FIRST_5_CHANGELOG_ENTRIES_REGEX = re.compile(r"""(^###.*?(?=###)){5}""", re.DOTALL | re.MULTILINE)
|
||||
|
||||
# https://regexr.com/622e5
|
||||
README_CHANGELOG_SECTION = re.compile(
|
||||
r"""(?<=<!-- START bin\/update_readme_changelog.py -->\n).*(?=<!-- END bin\/update_readme_changelog.py -->)""",
|
||||
re.DOTALL,
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
changelog_text = CHANGELOG_FILE.read_text()
|
||||
readme_text = README_FILE.read_text()
|
||||
|
||||
mini_changelog_match = FIRST_5_CHANGELOG_ENTRIES_REGEX.search(changelog_text)
|
||||
assert mini_changelog_match, "Failed to find the first few changelog entries"
|
||||
|
||||
mini_changelog = "\n".join(
|
||||
[
|
||||
"",
|
||||
"<!-- this section was generated by bin/update_readme_changelog.py -- do not edit manually -->",
|
||||
"",
|
||||
mini_changelog_match.group(0).strip(),
|
||||
"",
|
||||
"",
|
||||
]
|
||||
)
|
||||
|
||||
if not re.search(README_CHANGELOG_SECTION, readme_text):
|
||||
sys.exit("Changelog section not found in README")
|
||||
|
||||
readme_text = re.sub(README_CHANGELOG_SECTION, mini_changelog, readme_text)
|
||||
README_FILE.write_text(readme_text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import dataclasses
|
||||
import difflib
|
||||
import logging
|
||||
import subprocess
|
||||
import tomllib
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
@@ -28,7 +28,7 @@ GET_VIRTUALENV_URL_TEMPLATE: Final[str] = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True, order=True)
|
||||
@dataclasses.dataclass(frozen=True, order=True)
|
||||
class VersionTuple:
|
||||
version: Version
|
||||
version_string: str
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "3.0.0b1"
|
||||
__version__ = "3.0.0b5"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import dataclasses
|
||||
import subprocess
|
||||
from collections.abc import (
|
||||
Callable,
|
||||
@@ -5,7 +6,6 @@ from collections.abc import (
|
||||
Mapping,
|
||||
Sequence,
|
||||
)
|
||||
from dataclasses import dataclass
|
||||
|
||||
import bashlex
|
||||
|
||||
@@ -17,7 +17,7 @@ def local_environment_executor(command: Sequence[str], env: Mapping[str, str]) -
|
||||
return subprocess.run(command, env=env, text=True, stdout=subprocess.PIPE, check=True).stdout
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class NodeExecutionContext:
|
||||
environment: dict[str, str]
|
||||
input: str
|
||||
|
||||
@@ -102,7 +102,7 @@ class EnvironmentAssignmentBash:
|
||||
return False
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(kw_only=True)
|
||||
class ParsedEnvironment:
|
||||
assignments: list[EnvironmentAssignment]
|
||||
|
||||
|
||||
+70
-1
@@ -2,9 +2,16 @@
|
||||
These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
|
||||
"""
|
||||
|
||||
import json
|
||||
import time
|
||||
import typing
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from collections.abc import Mapping, Sequence
|
||||
from io import StringIO
|
||||
from typing import Protocol
|
||||
from typing import Any, NotRequired, Protocol
|
||||
|
||||
from cibuildwheel import __version__ as cibw_version
|
||||
|
||||
__all__ = ("Printable", "dump_python_configurations")
|
||||
|
||||
@@ -30,3 +37,65 @@ def dump_python_configurations(
|
||||
output.write("\n")
|
||||
# Strip the final newline, to avoid two blank lines at the end.
|
||||
return output.getvalue()[:-1]
|
||||
|
||||
|
||||
def _json_request(request: urllib.request.Request, timeout: int = 30) -> dict[str, Any]:
|
||||
with urllib.request.urlopen(request, timeout=timeout) as response:
|
||||
return typing.cast(dict[str, Any], json.load(response))
|
||||
|
||||
|
||||
def github_api_request(path: str, *, max_retries: int = 3) -> dict[str, Any]:
|
||||
"""
|
||||
Makes a GitHub API request to the given path and returns the JSON response.
|
||||
"""
|
||||
api_url = f"https://api.github.com/{path}"
|
||||
headers = {
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"User-Agent": f"cibuildwheel/{cibw_version}",
|
||||
}
|
||||
request = urllib.request.Request(api_url, headers=headers)
|
||||
|
||||
for retry_count in range(max_retries):
|
||||
try:
|
||||
return _json_request(request)
|
||||
except (urllib.error.URLError, TimeoutError) as e:
|
||||
# pylint: disable=E1101
|
||||
if (
|
||||
isinstance(e, urllib.error.HTTPError)
|
||||
and (e.code == 403 or e.code == 429)
|
||||
and e.headers.get("x-ratelimit-remaining") == "0"
|
||||
):
|
||||
reset_time = int(e.headers.get("x-ratelimit-reset", 0))
|
||||
wait_time = max(0, reset_time - int(e.headers.get("date", 0)))
|
||||
print(f"Github rate limit exceeded. Waiting for {wait_time} seconds.")
|
||||
time.sleep(wait_time)
|
||||
else:
|
||||
print(f"Retrying GitHub API request due to error: {e}")
|
||||
|
||||
if retry_count == max_retries - 1:
|
||||
print(f"GitHub API request failed (Network error: {e}). Check network connection.")
|
||||
raise e
|
||||
|
||||
# Should never be reached but to keep the type checker happy
|
||||
msg = "Unexpected execution path in github_api_request"
|
||||
raise RuntimeError(msg)
|
||||
|
||||
|
||||
class PyodideXBuildEnvRelease(typing.TypedDict):
|
||||
version: str
|
||||
python_version: str
|
||||
emscripten_version: str
|
||||
min_pyodide_build_version: NotRequired[str]
|
||||
max_pyodide_build_version: NotRequired[str]
|
||||
|
||||
|
||||
class PyodideXBuildEnvInfo(typing.TypedDict):
|
||||
releases: dict[str, PyodideXBuildEnvRelease]
|
||||
|
||||
|
||||
def get_pyodide_xbuildenv_info() -> PyodideXBuildEnvInfo:
|
||||
xbuildenv_info_url = (
|
||||
"https://pyodide.github.io/pyodide/api/pyodide-cross-build-environments.json"
|
||||
)
|
||||
with urllib.request.urlopen(xbuildenv_info_url) as response:
|
||||
return typing.cast(PyodideXBuildEnvInfo, json.loads(response.read().decode("utf-8")))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dataclasses
|
||||
import shlex
|
||||
import typing
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
from typing import Literal, Self, get_args
|
||||
|
||||
from .logger import log
|
||||
@@ -10,7 +10,7 @@ from .util.helpers import parse_key_value_string
|
||||
BuildFrontendName = Literal["pip", "build", "build[uv]"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class BuildFrontendConfig:
|
||||
name: BuildFrontendName
|
||||
args: Sequence[str] = ()
|
||||
|
||||
@@ -237,7 +237,8 @@ def build_description_from_identifier(identifier: str) -> str:
|
||||
build_description = ""
|
||||
|
||||
python_interpreter = python_identifier[0:2]
|
||||
python_version = python_identifier[2:]
|
||||
version_parts = python_identifier[2:].split("_")
|
||||
python_version = version_parts[0]
|
||||
|
||||
if python_interpreter == "cp":
|
||||
build_description += "CPython"
|
||||
@@ -250,6 +251,8 @@ def build_description_from_identifier(identifier: str) -> str:
|
||||
raise Exception(msg)
|
||||
|
||||
build_description += f" {python_version[0]}.{python_version[1:]} "
|
||||
if len(version_parts) > 1:
|
||||
build_description += f"(ABI {version_parts[1]}) "
|
||||
|
||||
try:
|
||||
build_description += PLATFORM_IDENTIFIER_DESCRIPTIONS[platform_identifier]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import dataclasses
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
@@ -10,7 +11,6 @@ import textwrap
|
||||
import typing
|
||||
import uuid
|
||||
from collections.abc import Mapping, Sequence
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from pathlib import Path, PurePath, PurePosixPath
|
||||
from types import TracebackType
|
||||
@@ -37,10 +37,11 @@ class OCIPlatform(Enum):
|
||||
S390X = "linux/s390x"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class OCIContainerEngineConfig:
|
||||
name: ContainerEngineName
|
||||
create_args: tuple[str, ...] = field(default_factory=tuple)
|
||||
_: dataclasses.KW_ONLY
|
||||
create_args: tuple[str, ...] = dataclasses.field(default_factory=tuple)
|
||||
disable_host_mount: bool = False
|
||||
|
||||
@classmethod
|
||||
@@ -342,6 +343,7 @@ class OCIContainer:
|
||||
)
|
||||
else:
|
||||
exec_process: subprocess.Popen[bytes]
|
||||
self.call(["mkdir", "-p", to_path.parent])
|
||||
with subprocess.Popen(
|
||||
[
|
||||
self.engine.name,
|
||||
|
||||
+18
-3
@@ -51,7 +51,7 @@ MUSLLINUX_ARCHS: Final[tuple[str, ...]] = (
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(kw_only=True)
|
||||
class CommandLineArguments:
|
||||
platform: Literal["auto", "linux", "macos", "windows"] | None
|
||||
archs: str | None
|
||||
@@ -80,7 +80,7 @@ class CommandLineArguments:
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class GlobalOptions:
|
||||
package_dir: Path
|
||||
output_dir: Path
|
||||
@@ -90,7 +90,7 @@ class GlobalOptions:
|
||||
allow_empty: bool
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class BuildOptions:
|
||||
globals: GlobalOptions
|
||||
environment: ParsedEnvironment
|
||||
@@ -107,10 +107,12 @@ class BuildOptions:
|
||||
test_requires: list[str]
|
||||
test_extras: str
|
||||
test_groups: list[str]
|
||||
test_environment: ParsedEnvironment
|
||||
build_verbosity: int
|
||||
build_frontend: BuildFrontendConfig | None
|
||||
config_settings: str
|
||||
container_engine: OCIContainerEngineConfig
|
||||
pyodide_version: str | None
|
||||
|
||||
@property
|
||||
def package_dir(self) -> Path:
|
||||
@@ -739,6 +741,15 @@ class Options:
|
||||
"test-sources", option_format=ListFormat(sep=" ", quote=shlex.quote)
|
||||
)
|
||||
)
|
||||
test_environment_config = self.reader.get(
|
||||
"test-environment", option_format=EnvironmentFormat()
|
||||
)
|
||||
try:
|
||||
test_environment = parse_environment(test_environment_config)
|
||||
except (EnvironmentParseError, ValueError) as e:
|
||||
msg = f"Malformed environment option {test_environment_config!r}"
|
||||
raise errors.ConfigurationError(msg) from e
|
||||
|
||||
test_requires = self.reader.get(
|
||||
"test-requires", option_format=ListFormat(sep=" ")
|
||||
).split()
|
||||
@@ -840,10 +851,13 @@ class Options:
|
||||
msg = f"Failed to parse container config. {e}"
|
||||
raise errors.ConfigurationError(msg) from e
|
||||
|
||||
pyodide_version = self.reader.get("pyodide-version", env_plat=False)
|
||||
|
||||
return BuildOptions(
|
||||
globals=self.globals,
|
||||
test_command=test_command,
|
||||
test_sources=test_sources,
|
||||
test_environment=test_environment,
|
||||
test_requires=[*test_requires, *test_requirements_from_groups],
|
||||
test_extras=test_extras,
|
||||
test_groups=test_groups,
|
||||
@@ -860,6 +874,7 @@ class Options:
|
||||
build_frontend=build_frontend,
|
||||
config_settings=config_settings,
|
||||
container_engine=container_engine,
|
||||
pyodide_version=pyodide_version or None,
|
||||
)
|
||||
|
||||
def check_for_invalid_configuration(self, identifiers: Iterable[str]) -> None:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
@@ -7,7 +8,6 @@ import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
from collections.abc import Sequence, Set
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import assert_never
|
||||
|
||||
@@ -25,7 +25,7 @@ from ..logger import log
|
||||
from ..options import Options
|
||||
from ..selector import BuildSelector
|
||||
from ..util import resources
|
||||
from ..util.cmd import call, shell
|
||||
from ..util.cmd import call, shell, split_command
|
||||
from ..util.file import (
|
||||
CIBW_CACHE_PATH,
|
||||
copy_test_sources,
|
||||
@@ -42,7 +42,7 @@ from ..venv import constraint_flags, virtualenv
|
||||
from .macos import install_cpython as install_build_cpython
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
@@ -536,13 +536,17 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
elif config.arch != os.uname().machine:
|
||||
log.step("Skipping tests on non-native simulator architecture")
|
||||
else:
|
||||
test_env = build_options.test_environment.as_dictionary(
|
||||
prev_environment=build_env
|
||||
)
|
||||
|
||||
if build_options.before_test:
|
||||
before_test_prepared = prepare_command(
|
||||
build_options.before_test,
|
||||
project=".",
|
||||
package=build_options.package_dir,
|
||||
)
|
||||
shell(before_test_prepared, env=env)
|
||||
shell(before_test_prepared, env=test_env)
|
||||
|
||||
log.step("Setting up test harness...")
|
||||
# Clone the testbed project into the build directory
|
||||
@@ -552,29 +556,29 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
target_install_path / "testbed",
|
||||
"clone",
|
||||
testbed_path,
|
||||
env=build_env,
|
||||
env=test_env,
|
||||
)
|
||||
|
||||
if not build_options.test_sources:
|
||||
# iOS requires an explicit test-sources, as the project directory
|
||||
# isn't visible on the simulator.
|
||||
|
||||
msg = "Testing on iOS requires a definition of test-sources."
|
||||
raise errors.FatalError(msg)
|
||||
testbed_app_path = testbed_path / "iOSTestbed" / "app"
|
||||
|
||||
# Copy the test sources to the testbed app
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
build_options.package_dir,
|
||||
testbed_path / "iOSTestbed" / "app",
|
||||
)
|
||||
if build_options.test_sources:
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
Path.cwd(),
|
||||
testbed_app_path,
|
||||
)
|
||||
else:
|
||||
(testbed_app_path / "test_fail.py").write_text(
|
||||
resources.TEST_FAIL_CWD_FILE.read_text()
|
||||
)
|
||||
|
||||
log.step("Installing test requirements...")
|
||||
# Install the compiled wheel (with any test extras), plus
|
||||
# the test requirements. Use the --platform tag to force
|
||||
# the installation of iOS wheels; this requires the use of
|
||||
# --only-binary=:all:
|
||||
ios_version = build_env["IPHONEOS_DEPLOYMENT_TARGET"]
|
||||
ios_version = test_env["IPHONEOS_DEPLOYMENT_TARGET"]
|
||||
platform_tag = f"ios_{ios_version.replace('.', '_')}_{config.arch}_{config.sdk}"
|
||||
|
||||
call(
|
||||
@@ -589,67 +593,83 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
testbed_path / "iOSTestbed" / "app_packages",
|
||||
f"{test_wheel}{build_options.test_extras}",
|
||||
*build_options.test_requires,
|
||||
env=build_env,
|
||||
env=test_env,
|
||||
)
|
||||
|
||||
log.step("Running test suite...")
|
||||
|
||||
test_command_parts = shlex.split(build_options.test_command)
|
||||
if test_command_parts[0:2] != ["python", "-m"]:
|
||||
first_part = test_command_parts[0]
|
||||
if first_part == "pytest":
|
||||
# pytest works exactly the same as a module, so we
|
||||
# can just run it as a module.
|
||||
log.warning(
|
||||
unwrap_preserving_paragraphs(f"""
|
||||
iOS tests configured with a test command which doesn't start
|
||||
with 'python -m'. iOS tests must execute python modules - other
|
||||
entrypoints are not supported.
|
||||
# iOS doesn't support placeholders in the test command,
|
||||
# because the source dir isn't visible on the simulator.
|
||||
if (
|
||||
"{project}" in build_options.test_command
|
||||
or "{package}" in build_options.test_command
|
||||
):
|
||||
msg = unwrap_preserving_paragraphs(
|
||||
f"""
|
||||
iOS tests configured with a test command that uses the "{{project}}" or
|
||||
"{{package}}" placeholder. iOS tests cannot use placeholders, because the
|
||||
source directory is not visible on the simulator.
|
||||
|
||||
cibuildwheel will try to execute it as if it started with
|
||||
'python -m'. If this works, all you need to do is add that to
|
||||
your test command.
|
||||
In addition, iOS tests must run as a Python module, so the test command
|
||||
must begin with 'python -m'.
|
||||
|
||||
Test command: {build_options.test_command!r}
|
||||
""")
|
||||
)
|
||||
else:
|
||||
msg = unwrap_preserving_paragraphs(
|
||||
f"""
|
||||
iOS tests configured with a test command which doesn't start
|
||||
with 'python -m'. iOS tests must execute python modules - other
|
||||
entrypoints are not supported.
|
||||
|
||||
Test command: {build_options.test_command!r}
|
||||
"""
|
||||
)
|
||||
raise errors.FatalError(msg)
|
||||
else:
|
||||
# the testbed run command actually doesn't want the
|
||||
# python -m prefix - it's implicit, so we remove it
|
||||
# here.
|
||||
test_command_parts = test_command_parts[2:]
|
||||
|
||||
try:
|
||||
call(
|
||||
"python",
|
||||
testbed_path,
|
||||
"run",
|
||||
*(["--verbose"] if build_options.build_verbosity > 0 else []),
|
||||
"--",
|
||||
*test_command_parts,
|
||||
env=build_env,
|
||||
Test command: {build_options.test_command!r}
|
||||
"""
|
||||
)
|
||||
failed = False
|
||||
raise errors.FatalError(msg)
|
||||
|
||||
test_command_list = shlex.split(build_options.test_command)
|
||||
try:
|
||||
for test_command_parts in split_command(test_command_list):
|
||||
match test_command_parts:
|
||||
case ["python", "-m", *rest]:
|
||||
final_command = rest
|
||||
case ["pytest", *rest]:
|
||||
# pytest works exactly the same as a module, so we
|
||||
# can just run it as a module.
|
||||
msg = unwrap_preserving_paragraphs(f"""
|
||||
iOS tests configured with a test command which doesn't start
|
||||
with 'python -m'. iOS tests must execute python modules - other
|
||||
entrypoints are not supported.
|
||||
|
||||
cibuildwheel will try to execute it as if it started with
|
||||
'python -m'. If this works, all you need to do is add that to
|
||||
your test command.
|
||||
|
||||
Test command: {build_options.test_command!r}
|
||||
""")
|
||||
log.warning(msg)
|
||||
final_command = ["pytest", *rest]
|
||||
case _:
|
||||
msg = unwrap_preserving_paragraphs(
|
||||
f"""
|
||||
iOS tests configured with a test command which doesn't start
|
||||
with 'python -m'. iOS tests must execute python modules - other
|
||||
entrypoints are not supported.
|
||||
|
||||
Test command: {build_options.test_command!r}
|
||||
"""
|
||||
)
|
||||
raise errors.FatalError(msg)
|
||||
|
||||
call(
|
||||
"python",
|
||||
testbed_path,
|
||||
"run",
|
||||
*(["--verbose"] if build_options.build_verbosity > 0 else []),
|
||||
"--",
|
||||
*final_command,
|
||||
env=test_env,
|
||||
)
|
||||
except subprocess.CalledProcessError:
|
||||
failed = True
|
||||
|
||||
log.step_end(success=not failed)
|
||||
|
||||
if failed:
|
||||
# catches the first test command failure in the loop,
|
||||
# implementing short-circuiting
|
||||
log.step_end(success=False)
|
||||
log.error(f"Test suite failed on {config.identifier}")
|
||||
sys.exit(1)
|
||||
|
||||
log.step_end()
|
||||
|
||||
# We're all done here; move it to output (overwrite existing)
|
||||
if compatible_wheel is None:
|
||||
output_wheel = build_options.output_dir.joinpath(built_wheel.name)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import contextlib
|
||||
import dataclasses
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
from collections import OrderedDict
|
||||
from collections.abc import Iterable, Iterator, Sequence, Set
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path, PurePath, PurePosixPath
|
||||
from typing import assert_never
|
||||
|
||||
@@ -32,7 +32,7 @@ ARCHITECTURE_OCI_PLATFORM_MAP = {
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
@@ -43,7 +43,7 @@ class PythonConfiguration:
|
||||
return PurePosixPath(self.path_str)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class BuildStep:
|
||||
platform_configs: list[PythonConfiguration]
|
||||
platform_tag: str
|
||||
@@ -361,6 +361,9 @@ def build_in_container(
|
||||
virtualenv_env = env.copy()
|
||||
virtualenv_env["PATH"] = f"{venv_dir / 'bin'}:{virtualenv_env['PATH']}"
|
||||
virtualenv_env["VIRTUAL_ENV"] = str(venv_dir)
|
||||
virtualenv_env = build_options.test_environment.as_dictionary(
|
||||
prev_environment=virtualenv_env
|
||||
)
|
||||
|
||||
if build_options.before_test:
|
||||
before_test_prepared = prepare_command(
|
||||
@@ -394,18 +397,20 @@ def build_in_container(
|
||||
wheel=wheel_to_test,
|
||||
)
|
||||
|
||||
test_cwd = testing_temp_dir / "test_cwd"
|
||||
container.call(["mkdir", "-p", test_cwd])
|
||||
|
||||
if build_options.test_sources:
|
||||
test_cwd = testing_temp_dir / "test_cwd"
|
||||
container.call(["mkdir", "-p", test_cwd])
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
build_options.package_dir,
|
||||
Path.cwd(),
|
||||
test_cwd,
|
||||
copy_into=container.copy_into,
|
||||
)
|
||||
else:
|
||||
# There are no test sources. Run the tests in the project directory.
|
||||
test_cwd = PurePosixPath(container_project_path)
|
||||
# Use the test_fail.py file to raise a nice error if the user
|
||||
# tries to run tests in the cwd
|
||||
container.copy_into(resources.TEST_FAIL_CWD_FILE, test_cwd / "test_fail.py")
|
||||
|
||||
container.call(["sh", "-c", test_command_prepared], cwd=test_cwd, env=virtualenv_env)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import dataclasses
|
||||
import functools
|
||||
import inspect
|
||||
import os
|
||||
@@ -8,7 +9,6 @@ import subprocess
|
||||
import sys
|
||||
import typing
|
||||
from collections.abc import Set
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Literal, assert_never
|
||||
|
||||
@@ -76,7 +76,7 @@ def get_macos_sdks() -> list[str]:
|
||||
return [m.group(1) for m in re.finditer(r"-sdk (macosx\S+)", output)]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
@@ -648,6 +648,10 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
|
||||
virtualenv_env["MACOSX_DEPLOYMENT_TARGET"] = get_test_macosx_deployment_target()
|
||||
|
||||
virtualenv_env = build_options.test_environment.as_dictionary(
|
||||
prev_environment=virtualenv_env
|
||||
)
|
||||
|
||||
# check that we are using the Python from the virtual environment
|
||||
call_with_arch("which", "python", env=virtualenv_env)
|
||||
|
||||
@@ -699,20 +703,25 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
wheel=repaired_wheel,
|
||||
)
|
||||
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
|
||||
if build_options.test_sources:
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
# only create test_cwd if it doesn't already exist - it
|
||||
# may have been created during a previous `testing_arch`
|
||||
if not test_cwd.exists():
|
||||
test_cwd.mkdir()
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
build_options.package_dir,
|
||||
Path.cwd(),
|
||||
test_cwd,
|
||||
)
|
||||
else:
|
||||
# There are no test sources. Run the tests in the project directory.
|
||||
test_cwd = Path.cwd()
|
||||
# Use the test_fail.py file to raise a nice error if the user
|
||||
# tries to run tests in the cwd
|
||||
test_cwd.mkdir(exist_ok=True)
|
||||
(test_cwd / "test_fail.py").write_text(
|
||||
resources.TEST_FAIL_CWD_FILE.read_text()
|
||||
)
|
||||
|
||||
shell_with_arch(test_command_prepared, cwd=test_cwd, env=virtualenv_env)
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import dataclasses
|
||||
import functools
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tomllib
|
||||
import typing
|
||||
from collections.abc import Set
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
from typing import Final
|
||||
from typing import Final, TypedDict
|
||||
|
||||
from filelock import FileLock
|
||||
|
||||
@@ -28,23 +30,38 @@ from ..util.file import (
|
||||
extract_zip,
|
||||
move_file,
|
||||
)
|
||||
from ..util.helpers import prepare_command
|
||||
from ..util.helpers import prepare_command, unwrap, unwrap_preserving_paragraphs
|
||||
from ..util.packaging import combine_constraints, find_compatible_wheel, get_pip_version
|
||||
from ..util.python_build_standalone import (
|
||||
PythonBuildStandaloneError,
|
||||
create_python_build_standalone_environment,
|
||||
)
|
||||
from ..venv import constraint_flags, virtualenv
|
||||
|
||||
IS_WIN: Final[bool] = sys.platform.startswith("win")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
pyodide_version: str
|
||||
pyodide_build_version: str
|
||||
emscripten_version: str
|
||||
default_pyodide_version: str
|
||||
node_version: str
|
||||
|
||||
|
||||
class PyodideXBuildEnvInfoVersionRange(TypedDict):
|
||||
min: str | None
|
||||
max: str | None
|
||||
|
||||
|
||||
class PyodideXBuildEnvInfo(TypedDict):
|
||||
version: str
|
||||
python: str
|
||||
emscripten: str
|
||||
pyodide_build: PyodideXBuildEnvInfoVersionRange
|
||||
compatible: bool
|
||||
|
||||
|
||||
@functools.cache
|
||||
def ensure_node(major_version: str) -> Path:
|
||||
with resources.NODEJS.open("rb") as f:
|
||||
@@ -77,8 +94,6 @@ def ensure_node(major_version: str) -> Path:
|
||||
|
||||
|
||||
def install_emscripten(tmp: Path, version: str) -> Path:
|
||||
# We don't need to match the emsdk version to the version we install, but
|
||||
# we do for stability
|
||||
url = f"https://github.com/emscripten-core/emsdk/archive/refs/tags/{version}.zip"
|
||||
installation_path = CIBW_CACHE_PATH / f"emsdk-{version}"
|
||||
emsdk_path = installation_path / f"emsdk-{version}/emsdk"
|
||||
@@ -96,16 +111,82 @@ def install_emscripten(tmp: Path, version: str) -> Path:
|
||||
return emcc_path
|
||||
|
||||
|
||||
def get_all_xbuildenv_version_info(env: dict[str, str]) -> list[PyodideXBuildEnvInfo]:
|
||||
xbuildenvs_info_str = call(
|
||||
"pyodide",
|
||||
"xbuildenv",
|
||||
"search",
|
||||
"--json",
|
||||
"--all",
|
||||
env=env,
|
||||
cwd=CIBW_CACHE_PATH,
|
||||
capture_stdout=True,
|
||||
).strip()
|
||||
|
||||
xbuildenvs_info = json.loads(xbuildenvs_info_str)
|
||||
|
||||
if "environments" not in xbuildenvs_info:
|
||||
msg = f"Invalid xbuildenvs info, got {xbuildenvs_info}"
|
||||
raise ValueError(msg)
|
||||
|
||||
return typing.cast(list[PyodideXBuildEnvInfo], xbuildenvs_info["environments"])
|
||||
|
||||
|
||||
def get_xbuildenv_version_info(
|
||||
env: dict[str, str], version: str, pyodide_build_version: str
|
||||
) -> PyodideXBuildEnvInfo:
|
||||
xbuildenvs_info = get_all_xbuildenv_version_info(env)
|
||||
for xbuildenv_info in xbuildenvs_info:
|
||||
if xbuildenv_info["version"] == version:
|
||||
return xbuildenv_info
|
||||
|
||||
msg = unwrap(f"""
|
||||
Could not find Pyodide cross-build environment version {version} in the available
|
||||
versions as reported by pyodide-build v{pyodide_build_version}.
|
||||
Available pyodide xbuildenv versions are:
|
||||
{", ".join(e["version"] for e in xbuildenvs_info if e["compatible"])}
|
||||
""")
|
||||
raise errors.FatalError(msg)
|
||||
|
||||
|
||||
# The default pyodide xbuildenv version that's specified in
|
||||
# build-platforms.toml is compatible with the pyodide-build version that's
|
||||
# pinned in the bundled constraints file. But if the user changes
|
||||
# pyodide-version and/or dependency-constraints in the cibuildwheel config, we
|
||||
# need to check if the xbuildenv version is compatible with the pyodide-build
|
||||
# version.
|
||||
def validate_pyodide_build_version(
|
||||
xbuildenv_info: PyodideXBuildEnvInfo, pyodide_build_version: str
|
||||
) -> None:
|
||||
"""
|
||||
Validate the Pyodide version is compatible with the installed
|
||||
pyodide-build version.
|
||||
"""
|
||||
|
||||
pyodide_version = xbuildenv_info["version"]
|
||||
|
||||
if not xbuildenv_info["compatible"]:
|
||||
msg = unwrap_preserving_paragraphs(f"""
|
||||
The Pyodide xbuildenv version {pyodide_version} is not compatible
|
||||
with the pyodide-build version {pyodide_build_version}. Please use
|
||||
the 'pyodide xbuildenv search --all' command to find a compatible
|
||||
version.
|
||||
|
||||
Set the pyodide-build version using the `dependency-constraints`
|
||||
option, or set the Pyodide xbuildenv version using the
|
||||
`pyodide-version` option.
|
||||
""")
|
||||
raise errors.FatalError(msg)
|
||||
|
||||
|
||||
def install_xbuildenv(env: dict[str, str], pyodide_build_version: str, pyodide_version: str) -> str:
|
||||
"""Install a particular Pyodide xbuildenv version and set a path to the Pyodide root."""
|
||||
# Since pyodide-build was unvendored from Pyodide v0.27.0, the versions of pyodide-build are
|
||||
# not guaranteed to match the versions of Pyodide or be in sync with them. Hence, we shall
|
||||
# specify the pyodide-build version in the root path, which will set up the xbuildenv for
|
||||
# the requested Pyodide version.
|
||||
pyodide_root = (
|
||||
CIBW_CACHE_PATH
|
||||
/ f".pyodide-xbuildenv-{pyodide_build_version}/{pyodide_version}/xbuildenv/pyodide-root"
|
||||
)
|
||||
# Since pyodide-build was unvendored from Pyodide v0.27.0, the versions of
|
||||
# pyodide-build are uncoupled from the versions of Pyodide. So, we specify
|
||||
# both the pyodide-build version and the Pyodide version in the temp path.
|
||||
xbuildenv_cache_path = CIBW_CACHE_PATH / f"pyodide-build-{pyodide_build_version}"
|
||||
pyodide_root = xbuildenv_cache_path / pyodide_version / "xbuildenv" / "pyodide-root"
|
||||
|
||||
with FileLock(CIBW_CACHE_PATH / "xbuildenv.lock"):
|
||||
if pyodide_root.exists():
|
||||
return str(pyodide_root)
|
||||
@@ -114,31 +195,36 @@ def install_xbuildenv(env: dict[str, str], pyodide_build_version: str, pyodide_v
|
||||
# PYODIDE_ROOT so copy it first.
|
||||
env = dict(env)
|
||||
env.pop("PYODIDE_ROOT", None)
|
||||
|
||||
# Install the xbuildenv
|
||||
call(
|
||||
"pyodide",
|
||||
"xbuildenv",
|
||||
"install",
|
||||
"--path",
|
||||
str(xbuildenv_cache_path),
|
||||
pyodide_version,
|
||||
env=env,
|
||||
cwd=CIBW_CACHE_PATH,
|
||||
)
|
||||
assert pyodide_root.exists()
|
||||
|
||||
return str(pyodide_root)
|
||||
|
||||
|
||||
def get_base_python(identifier: str) -> Path:
|
||||
implementation_id = identifier.split("-")[0]
|
||||
majorminor = implementation_id[len("cp") :]
|
||||
version_info = (int(majorminor[0]), int(majorminor[1:]))
|
||||
if version_info == sys.version_info[:2]:
|
||||
return Path(sys.executable)
|
||||
|
||||
major_minor = ".".join(str(v) for v in version_info)
|
||||
python_name = f"python{major_minor}"
|
||||
which_python = shutil.which(python_name)
|
||||
if which_python is None:
|
||||
msg = f"CPython {major_minor} is not installed."
|
||||
raise errors.FatalError(msg)
|
||||
return Path(which_python)
|
||||
def get_base_python(tmp: Path, python_configuration: PythonConfiguration) -> Path:
|
||||
try:
|
||||
return create_python_build_standalone_environment(
|
||||
python_version=python_configuration.version,
|
||||
temp_dir=tmp,
|
||||
cache_dir=CIBW_CACHE_PATH,
|
||||
)
|
||||
except PythonBuildStandaloneError as e:
|
||||
msg = unwrap(f"""
|
||||
Failed to create a Python build environment:
|
||||
{e}
|
||||
""")
|
||||
raise errors.FatalError(msg) from e
|
||||
|
||||
|
||||
def setup_python(
|
||||
@@ -146,10 +232,13 @@ def setup_python(
|
||||
python_configuration: PythonConfiguration,
|
||||
constraints_path: Path | None,
|
||||
environment: ParsedEnvironment,
|
||||
user_pyodide_version: str | None,
|
||||
) -> dict[str, str]:
|
||||
base_python = get_base_python(python_configuration.identifier)
|
||||
log.step("Installing a base python environment...")
|
||||
base_python = get_base_python(tmp / "base", python_configuration)
|
||||
|
||||
log.step("Setting up build environment...")
|
||||
pyodide_version = user_pyodide_version or python_configuration.default_pyodide_version
|
||||
venv_path = tmp / "venv"
|
||||
env = virtualenv(python_configuration.version, base_python, venv_path, None, use_uv=False)
|
||||
venv_bin_path = venv_path / "bin"
|
||||
@@ -201,15 +290,28 @@ def setup_python(
|
||||
env=env,
|
||||
)
|
||||
|
||||
log.step(f"Installing Emscripten version: {python_configuration.emscripten_version} ...")
|
||||
emcc_path = install_emscripten(tmp, python_configuration.emscripten_version)
|
||||
pyodide_build_version = call(
|
||||
"python",
|
||||
"-c",
|
||||
"from importlib.metadata import version; print(version('pyodide-build'))",
|
||||
env=env,
|
||||
capture_stdout=True,
|
||||
).strip()
|
||||
|
||||
xbuildenv_info = get_xbuildenv_version_info(env, pyodide_version, pyodide_build_version)
|
||||
validate_pyodide_build_version(
|
||||
xbuildenv_info=xbuildenv_info,
|
||||
pyodide_build_version=pyodide_build_version,
|
||||
)
|
||||
|
||||
emscripten_version = xbuildenv_info["emscripten"]
|
||||
log.step(f"Installing Emscripten version: {emscripten_version} ...")
|
||||
emcc_path = install_emscripten(tmp, emscripten_version)
|
||||
|
||||
env["PATH"] = os.pathsep.join([str(emcc_path.parent), env["PATH"]])
|
||||
|
||||
log.step(f"Installing Pyodide xbuildenv version: {python_configuration.pyodide_version} ...")
|
||||
env["PYODIDE_ROOT"] = install_xbuildenv(
|
||||
env, python_configuration.pyodide_build_version, python_configuration.pyodide_version
|
||||
)
|
||||
log.step(f"Installing Pyodide xbuildenv version: {pyodide_version} ...")
|
||||
env["PYODIDE_ROOT"] = install_xbuildenv(env, pyodide_build_version, pyodide_version)
|
||||
|
||||
return env
|
||||
|
||||
@@ -259,6 +361,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
log.build_start(config.identifier)
|
||||
|
||||
identifier_tmp_dir = tmp_path / config.identifier
|
||||
|
||||
built_wheel_dir = identifier_tmp_dir / "built_wheel"
|
||||
repaired_wheel_dir = identifier_tmp_dir / "repaired_wheel"
|
||||
identifier_tmp_dir.mkdir()
|
||||
@@ -270,10 +373,11 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
)
|
||||
|
||||
env = setup_python(
|
||||
identifier_tmp_dir / "build",
|
||||
config,
|
||||
constraints_path,
|
||||
build_options.environment,
|
||||
tmp=identifier_tmp_dir / "build",
|
||||
python_configuration=config,
|
||||
constraints_path=constraints_path,
|
||||
environment=build_options.environment,
|
||||
user_pyodide_version=build_options.pyodide_version,
|
||||
)
|
||||
pip_version = get_pip_version(env)
|
||||
# The Pyodide command line runner mounts all directories in the host
|
||||
@@ -380,6 +484,10 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
)
|
||||
virtualenv_env["VIRTUAL_ENV"] = str(venv_dir)
|
||||
|
||||
virtualenv_env = build_options.test_environment.as_dictionary(
|
||||
prev_environment=virtualenv_env
|
||||
)
|
||||
|
||||
# check that we are using the Python from the virtual environment
|
||||
call("which", "python", env=virtualenv_env)
|
||||
|
||||
@@ -388,6 +496,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
build_options.before_test,
|
||||
project=".",
|
||||
package=build_options.package_dir,
|
||||
wheel=repaired_wheel,
|
||||
)
|
||||
shell(before_test_prepared, env=virtualenv_env)
|
||||
|
||||
@@ -412,17 +521,19 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
package=build_options.package_dir.resolve(),
|
||||
)
|
||||
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
test_cwd.mkdir(exist_ok=True)
|
||||
|
||||
if build_options.test_sources:
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
test_cwd.mkdir(exist_ok=True)
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
build_options.package_dir,
|
||||
Path.cwd(),
|
||||
test_cwd,
|
||||
)
|
||||
else:
|
||||
# There are no test sources. Run the tests in the project directory.
|
||||
test_cwd = Path.cwd()
|
||||
# Use the test_fail.py file to raise a nice error if the user
|
||||
# tries to run tests in the cwd
|
||||
(test_cwd / "test_fail.py").write_text(resources.TEST_FAIL_CWD_FILE.read_text())
|
||||
|
||||
shell(test_command_prepared, cwd=test_cwd, env=virtualenv_env)
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import dataclasses
|
||||
import json
|
||||
import os
|
||||
import platform as platform_module
|
||||
import shutil
|
||||
import subprocess
|
||||
import textwrap
|
||||
from collections.abc import MutableMapping, Set
|
||||
from dataclasses import dataclass
|
||||
from functools import cache
|
||||
from pathlib import Path
|
||||
from typing import assert_never
|
||||
@@ -50,7 +51,7 @@ def get_nuget_args(
|
||||
]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
arch: str
|
||||
@@ -335,43 +336,36 @@ def setup_python(
|
||||
# variables. Adapted from
|
||||
# https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
|
||||
# Remove when https://github.com/oracle/graalpython/issues/492 is fixed.
|
||||
vcpath = subprocess.check_output(
|
||||
[
|
||||
Path(os.environ["PROGRAMFILES(X86)"])
|
||||
/ "Microsoft Visual Studio"
|
||||
/ "Installer"
|
||||
/ "vswhere.exe",
|
||||
"-products",
|
||||
"*",
|
||||
"-latest",
|
||||
"-property",
|
||||
"installationPath",
|
||||
],
|
||||
text=True,
|
||||
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}")
|
||||
env.update(
|
||||
dict(
|
||||
[
|
||||
envvar.strip().split("=", 1)
|
||||
for envvar in subprocess.check_output(
|
||||
[
|
||||
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
|
||||
"-no_logo",
|
||||
"-arch=amd64",
|
||||
"-host_arch=amd64",
|
||||
"&&",
|
||||
"set",
|
||||
],
|
||||
shell=True,
|
||||
text=True,
|
||||
env=env,
|
||||
)
|
||||
.strip()
|
||||
.split("\n")
|
||||
]
|
||||
)
|
||||
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
|
||||
|
||||
@@ -558,6 +552,10 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
pip_version=pip_version,
|
||||
)
|
||||
|
||||
virtualenv_env = build_options.test_environment.as_dictionary(
|
||||
prev_environment=virtualenv_env
|
||||
)
|
||||
|
||||
# check that we are using the Python from the virtual environment
|
||||
call("where", "python", env=virtualenv_env)
|
||||
|
||||
@@ -586,24 +584,26 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
# run the tests from a temp dir, with an absolute path in the command
|
||||
# (this ensures that Python runs the tests against the installed wheel
|
||||
# and not the repo code)
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
test_cwd.mkdir()
|
||||
|
||||
if build_options.test_sources:
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
Path.cwd(),
|
||||
test_cwd,
|
||||
)
|
||||
else:
|
||||
# Use the test_fail.py file to raise a nice error if the user
|
||||
# tries to run tests in the cwd
|
||||
(test_cwd / "test_fail.py").write_text(resources.TEST_FAIL_CWD_FILE.read_text())
|
||||
|
||||
test_command_prepared = prepare_command(
|
||||
build_options.test_command,
|
||||
project=Path.cwd(),
|
||||
package=options.globals.package_dir.resolve(),
|
||||
wheel=repaired_wheel,
|
||||
)
|
||||
if build_options.test_sources:
|
||||
test_cwd = identifier_tmp_dir / "test_cwd"
|
||||
test_cwd.mkdir()
|
||||
copy_test_sources(
|
||||
build_options.test_sources,
|
||||
build_options.package_dir,
|
||||
test_cwd,
|
||||
)
|
||||
else:
|
||||
# There are no test sources. Run the tests in the project directory.
|
||||
test_cwd = Path.cwd()
|
||||
|
||||
shell(test_command_prepared, cwd=test_cwd, env=virtualenv_env)
|
||||
|
||||
# we're all done here; move it to output (remove if already exists)
|
||||
|
||||
@@ -22,7 +22,7 @@ python_configurations = [
|
||||
{ identifier = "pp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },
|
||||
{ identifier = "pp310-manylinux_x86_64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
|
||||
{ identifier = "pp311-manylinux_x86_64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" },
|
||||
{ identifier = "gp242-manylinux_x86_64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
|
||||
{ identifier = "gp311_242-manylinux_x86_64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
|
||||
{ identifier = "cp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
|
||||
{ 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" },
|
||||
@@ -72,7 +72,7 @@ python_configurations = [
|
||||
{ identifier = "pp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },
|
||||
{ identifier = "pp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" },
|
||||
{ identifier = "pp311-manylinux_aarch64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" },
|
||||
{ identifier = "gp242-manylinux_aarch64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
|
||||
{ identifier = "gp311_242-manylinux_aarch64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" },
|
||||
{ identifier = "pp38-manylinux_i686", version = "3.8", path_str = "/opt/python/pp38-pypy38_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" },
|
||||
@@ -165,12 +165,12 @@ python_configurations = [
|
||||
{ identifier = "cp313t-macosx_x86_64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.3/python-3.13.3-macos11.pkg" },
|
||||
{ identifier = "cp313t-macosx_arm64", version = "3.13", url = "https://www.python.org/ftp/python/3.13.3/python-3.13.3-macos11.pkg" },
|
||||
{ identifier = "cp313t-macosx_universal2", version = "3.13", url = "https://www.python.org/ftp/python/3.13.3/python-3.13.3-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "cp314-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_arm64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "cp314t-macosx_universal2", version = "3.14", url = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b2-macos11.pkg" },
|
||||
{ identifier = "pp38-macosx_x86_64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2" },
|
||||
{ identifier = "pp38-macosx_arm64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2" },
|
||||
{ identifier = "pp39-macosx_x86_64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_x86_64.tar.bz2" },
|
||||
@@ -179,8 +179,8 @@ python_configurations = [
|
||||
{ identifier = "pp310-macosx_arm64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-macos_arm64.tar.bz2" },
|
||||
{ identifier = "pp311-macosx_x86_64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.19-macos_x86_64.tar.bz2" },
|
||||
{ identifier = "pp311-macosx_arm64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.19-macos_arm64.tar.bz2" },
|
||||
{ identifier = "gp242-macosx_x86_64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-macos-amd64.tar.gz" },
|
||||
{ identifier = "gp242-macosx_arm64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-macos-aarch64.tar.gz" },
|
||||
{ identifier = "gp311_242-macosx_x86_64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-macos-amd64.tar.gz" },
|
||||
{ identifier = "gp311_242-macosx_arm64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-macos-aarch64.tar.gz" },
|
||||
]
|
||||
|
||||
[windows]
|
||||
@@ -199,28 +199,29 @@ python_configurations = [
|
||||
{ identifier = "cp313t-win32", version = "3.13.3", arch = "32" },
|
||||
{ identifier = "cp313-win_amd64", version = "3.13.3", arch = "64" },
|
||||
{ identifier = "cp313t-win_amd64", version = "3.13.3", arch = "64" },
|
||||
{ identifier = "cp314-win32", version = "3.14.0-b1", arch = "32" },
|
||||
{ identifier = "cp314t-win32", version = "3.14.0-b1", arch = "32" },
|
||||
{ identifier = "cp314-win_amd64", version = "3.14.0-b1", arch = "64" },
|
||||
{ identifier = "cp314t-win_amd64", version = "3.14.0-b1", arch = "64" },
|
||||
{ identifier = "cp314-win32", version = "3.14.0-b2", arch = "32" },
|
||||
{ identifier = "cp314t-win32", version = "3.14.0-b2", arch = "32" },
|
||||
{ identifier = "cp314-win_amd64", version = "3.14.0-b2", arch = "64" },
|
||||
{ identifier = "cp314t-win_amd64", version = "3.14.0-b2", arch = "64" },
|
||||
{ identifier = "cp39-win_arm64", version = "3.9.10", arch = "ARM64" },
|
||||
{ identifier = "cp310-win_arm64", version = "3.10.11", arch = "ARM64" },
|
||||
{ identifier = "cp311-win_arm64", version = "3.11.9", arch = "ARM64" },
|
||||
{ identifier = "cp312-win_arm64", version = "3.12.10", arch = "ARM64" },
|
||||
{ identifier = "cp313-win_arm64", version = "3.13.3", arch = "ARM64" },
|
||||
{ identifier = "cp313t-win_arm64", version = "3.13.3", arch = "ARM64" },
|
||||
{ identifier = "cp314-win_arm64", version = "3.14.0-b1", arch = "ARM64" },
|
||||
{ identifier = "cp314t-win_arm64", version = "3.14.0-b1", arch = "ARM64" },
|
||||
{ identifier = "cp314-win_arm64", version = "3.14.0-b2", arch = "ARM64" },
|
||||
{ identifier = "cp314t-win_arm64", version = "3.14.0-b2", arch = "ARM64" },
|
||||
{ identifier = "pp38-win_amd64", version = "3.8", arch = "64", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip" },
|
||||
{ identifier = "pp39-win_amd64", version = "3.9", arch = "64", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.16-win64.zip" },
|
||||
{ identifier = "pp310-win_amd64", version = "3.10", arch = "64", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-win64.zip" },
|
||||
{ identifier = "pp311-win_amd64", version = "3.11", arch = "64", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.19-win64.zip" },
|
||||
{ identifier = "gp242-win_amd64", version = "3.11", arch = "64", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-windows-amd64.zip" },
|
||||
{ identifier = "gp311_242-win_amd64", version = "3.11", arch = "64", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.1/graalpy-24.2.1-windows-amd64.zip" },
|
||||
]
|
||||
|
||||
[pyodide]
|
||||
python_configurations = [
|
||||
{ identifier = "cp312-pyodide_wasm32", version = "3.12", pyodide_version = "0.27.0", pyodide_build_version = "0.29.2", emscripten_version = "3.1.58", node_version = "v20" },
|
||||
{ identifier = "cp312-pyodide_wasm32", version = "3.12", default_pyodide_version = "0.27.6", node_version = "v22" },
|
||||
{ identifier = "cp313-pyodide_wasm32", version = "3.13", default_pyodide_version = "0.28.0a3", node_version = "v22" },
|
||||
]
|
||||
|
||||
[ios]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$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",
|
||||
"$defs": {
|
||||
"inherit": {
|
||||
@@ -13,11 +13,13 @@
|
||||
},
|
||||
"enable": {
|
||||
"enum": [
|
||||
"cpython-experimental-riscv64",
|
||||
"cpython-freethreading",
|
||||
"cpython-prerelease",
|
||||
"graalpy",
|
||||
"pyodide-prerelease",
|
||||
"pypy",
|
||||
"pypy-eol",
|
||||
"cpython-experimental-riscv64"
|
||||
"pypy-eol"
|
||||
]
|
||||
},
|
||||
"description": "A Python version or flavor to enable."
|
||||
@@ -424,6 +426,11 @@
|
||||
],
|
||||
"title": "CIBW_XBUILD_TOOLS"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"type": "string",
|
||||
"description": "Specify the version of Pyodide to use",
|
||||
"title": "CIBW_PYODIDE_VERSION"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"description": "Execute a shell command to repair each built wheel.",
|
||||
"oneOf": [
|
||||
@@ -544,6 +551,24 @@
|
||||
],
|
||||
"title": "CIBW_TEST_SKIP"
|
||||
},
|
||||
"test-environment": {
|
||||
"description": "Set environment variables for the test environment",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
".+": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"title": "CIBW_TEST_ENVIRONMENT"
|
||||
},
|
||||
"overrides": {
|
||||
"type": "array",
|
||||
"description": "An overrides array",
|
||||
@@ -610,6 +635,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/$defs/inherit"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/$defs/inherit"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -697,6 +725,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"$ref": "#/properties/repair-wheel-command"
|
||||
},
|
||||
@@ -714,6 +745,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -806,6 +840,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"description": "Execute a shell command to repair each built wheel.",
|
||||
"oneOf": [
|
||||
@@ -836,6 +873,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -873,6 +913,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"$ref": "#/properties/repair-wheel-command"
|
||||
},
|
||||
@@ -890,6 +933,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -927,6 +973,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"description": "Execute a shell command to repair each built wheel.",
|
||||
"oneOf": [
|
||||
@@ -957,6 +1006,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -994,6 +1046,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"$ref": "#/properties/repair-wheel-command"
|
||||
},
|
||||
@@ -1011,6 +1066,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1048,6 +1106,9 @@
|
||||
"xbuild-tools": {
|
||||
"$ref": "#/properties/xbuild-tools"
|
||||
},
|
||||
"pyodide-version": {
|
||||
"$ref": "#/properties/pyodide-version"
|
||||
},
|
||||
"repair-wheel-command": {
|
||||
"$ref": "#/properties/repair-wheel-command"
|
||||
},
|
||||
@@ -1065,6 +1126,9 @@
|
||||
},
|
||||
"test-requires": {
|
||||
"$ref": "#/properties/test-requires"
|
||||
},
|
||||
"test-environment": {
|
||||
"$ref": "#/properties/test-environment"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ annotated-types==0.7.0
|
||||
# via pydantic
|
||||
anyio==4.9.0
|
||||
# via httpx
|
||||
auditwheel-emscripten==0.0.16
|
||||
auditwheel-emscripten==0.1.0
|
||||
# via pyodide-build
|
||||
build==1.2.2.post1
|
||||
# via
|
||||
@@ -21,8 +21,6 @@ click==8.1.8
|
||||
# via
|
||||
# -r .nox/update_constraints/tmp/constraints-pyodide.in
|
||||
# typer
|
||||
cmake==4.0.2
|
||||
# via pyodide-build
|
||||
distlib==0.3.9
|
||||
# via virtualenv
|
||||
filelock==3.18.0
|
||||
@@ -53,8 +51,10 @@ packaging==25.0
|
||||
pip==25.1.1
|
||||
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
|
||||
platformdirs==4.3.8
|
||||
# via virtualenv
|
||||
pydantic==2.11.4
|
||||
# via
|
||||
# pyodide-build
|
||||
# virtualenv
|
||||
pydantic==2.11.5
|
||||
# via
|
||||
# pyodide-build
|
||||
# pyodide-lock
|
||||
@@ -62,9 +62,9 @@ pydantic-core==2.33.2
|
||||
# via pydantic
|
||||
pygments==2.19.1
|
||||
# via rich
|
||||
pyodide-build==0.29.2
|
||||
pyodide-build==0.30.4
|
||||
# via -r .nox/update_constraints/tmp/constraints-pyodide.in
|
||||
pyodide-cli==0.2.4
|
||||
pyodide-cli==0.3.0
|
||||
# via
|
||||
# auditwheel-emscripten
|
||||
# pyodide-build
|
||||
@@ -81,7 +81,7 @@ rich==14.0.0
|
||||
# pyodide-build
|
||||
# pyodide-cli
|
||||
# typer
|
||||
ruamel-yaml==0.18.10
|
||||
ruamel-yaml==0.18.12
|
||||
# via pyodide-build
|
||||
ruamel-yaml-clib==0.2.12
|
||||
# via ruamel-yaml
|
||||
@@ -89,7 +89,7 @@ shellingham==1.5.4
|
||||
# via typer
|
||||
sniffio==1.3.1
|
||||
# via anyio
|
||||
typer==0.15.4
|
||||
typer==0.16.0
|
||||
# via
|
||||
# auditwheel-emscripten
|
||||
# pyodide-build
|
||||
@@ -101,7 +101,7 @@ typing-extensions==4.13.2
|
||||
# pydantic-core
|
||||
# typer
|
||||
# typing-inspection
|
||||
typing-inspection==0.4.0
|
||||
typing-inspection==0.4.1
|
||||
# via pydantic
|
||||
unearth==0.17.5
|
||||
# via pyodide-build
|
||||
|
||||
@@ -30,5 +30,5 @@ typing-extensions==4.13.2
|
||||
# via delocate
|
||||
virtualenv==20.31.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
zipp==3.21.0
|
||||
zipp==3.22.0
|
||||
# via importlib-metadata
|
||||
|
||||
@@ -30,5 +30,5 @@ typing-extensions==4.13.2
|
||||
# via delocate
|
||||
virtualenv==20.31.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
zipp==3.21.0
|
||||
zipp==3.22.0
|
||||
# via importlib-metadata
|
||||
|
||||
@@ -24,9 +24,12 @@ test-sources = []
|
||||
test-requires = []
|
||||
test-extras = []
|
||||
test-groups = []
|
||||
test-environment = {}
|
||||
|
||||
container-engine = "docker"
|
||||
|
||||
pyodide-version = ""
|
||||
|
||||
manylinux-x86_64-image = "manylinux_2_28"
|
||||
manylinux-i686-image = "manylinux2014"
|
||||
manylinux-aarch64-image = "manylinux_2_28"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
url = "https://nodejs.org/dist/"
|
||||
v22 = "v22.15.1"
|
||||
v22 = "v22.16.0"
|
||||
v20 = "v20.19.2"
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
[x86_64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_x86_64:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_x86_64:2025.05.31-1
|
||||
|
||||
[i686]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_i686:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_i686:2025.05.31-1
|
||||
|
||||
[aarch64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_aarch64:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_aarch64:2025.05.31-1
|
||||
|
||||
[ppc64le]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_ppc64le:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_ppc64le:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_ppc64le:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_ppc64le:2025.05.31-1
|
||||
|
||||
[s390x]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_s390x:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_s390x:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_s390x:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_s390x:2025.05.31-1
|
||||
|
||||
[pypy_x86_64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_x86_64:2025.05.31-1
|
||||
|
||||
[pypy_i686]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2025.05.31-1
|
||||
|
||||
[pypy_aarch64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2025.05.16-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2025.05.16-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2025.05.16-1
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2025.05.31-1
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2025.05.28-1
|
||||
manylinux_2_34 = quay.io/pypa/manylinux_2_34_aarch64:2025.05.31-1
|
||||
|
||||
[armv7l]
|
||||
manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l:2025.05.16-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2025.05.16-1
|
||||
manylinux_2_31 = quay.io/pypa/manylinux_2_31_armv7l:2025.05.31-1
|
||||
musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2025.05.31-1
|
||||
|
||||
[riscv64]
|
||||
|
||||
|
||||
@@ -0,0 +1,441 @@
|
||||
{
|
||||
"releases": [
|
||||
{
|
||||
"tag": "20250529",
|
||||
"assets": [
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.10.17+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.10.17%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.11.12+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.11.12%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.13.3+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.13.3%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.12.10+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.12.10%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.14.0a7+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.14.0a7%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-aarch64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-aarch64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-aarch64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-aarch64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-armv7-unknown-linux-gnueabi-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-armv7-unknown-linux-gnueabihf-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-i686-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-i686-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-ppc64le-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-riscv64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-riscv64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-s390x-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-s390x-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64-apple-darwin-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64-apple-darwin-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64-pc-windows-msvc-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64-pc-windows-msvc-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v2-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v2-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v3-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v4-unknown-linux-gnu-install_only.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "cpython-3.9.22+20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz",
|
||||
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250529/cpython-3.9.22%2B20250529-x86_64_v4-unknown-linux-musl-install_only.tar.gz"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
# this file is copied to the testing cwd, to raise the below error message if
|
||||
# pytest/unittest is run from there.
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
from typing import NoReturn
|
||||
|
||||
|
||||
class TestStringMethods(unittest.TestCase):
|
||||
def test_fail(self) -> NoReturn:
|
||||
if sys.platform == "ios":
|
||||
msg = (
|
||||
"You tried to run tests from the testbed app's working "
|
||||
"directory, without specifying `test-sources`. "
|
||||
"On iOS, you must copy your test files to the testbed app by "
|
||||
"setting the `test-sources` option in your cibuildwheel "
|
||||
"configuration."
|
||||
)
|
||||
else:
|
||||
msg = (
|
||||
"cibuildwheel executes tests from a different working directory to "
|
||||
"your project. This ensures only your wheel is imported, preventing "
|
||||
"Python from accessing files that haven't been packaged into the "
|
||||
"wheel. "
|
||||
"\n\n"
|
||||
"Please specify a path to your tests when invoking pytest "
|
||||
"using the {project} placeholder, e.g. `pytest {project}` or "
|
||||
"`pytest {project}/tests`. cibuildwheel will replace {project} with "
|
||||
"the path to your project. "
|
||||
"\n\n"
|
||||
"Alternatively, you can specify your test files using the "
|
||||
"`test-sources` option, and cibuildwheel will copy them to the "
|
||||
"working directory for testing."
|
||||
)
|
||||
|
||||
self.fail(msg)
|
||||
@@ -1,5 +1,5 @@
|
||||
import dataclasses
|
||||
import itertools
|
||||
from dataclasses import dataclass
|
||||
from enum import StrEnum
|
||||
from fnmatch import fnmatch
|
||||
from typing import Any
|
||||
@@ -29,12 +29,13 @@ class EnableGroup(StrEnum):
|
||||
Groups of build selectors that are not enabled by default.
|
||||
"""
|
||||
|
||||
CPythonExperimentalRiscV64 = "cpython-experimental-riscv64"
|
||||
CPythonFreeThreading = "cpython-freethreading"
|
||||
CPythonPrerelease = "cpython-prerelease"
|
||||
GraalPy = "graalpy"
|
||||
PyPy = "pypy"
|
||||
PyPyEoL = "pypy-eol"
|
||||
CPythonExperimentalRiscV64 = "cpython-experimental-riscv64"
|
||||
GraalPy = "graalpy"
|
||||
PyodidePrerelease = "pyodide-prerelease"
|
||||
|
||||
@classmethod
|
||||
def all_groups(cls) -> frozenset["EnableGroup"]:
|
||||
@@ -58,7 +59,7 @@ class EnableGroup(StrEnum):
|
||||
return frozenset(result)
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class BuildSelector:
|
||||
"""
|
||||
This class holds a set of build/skip patterns. You call an instance with a
|
||||
@@ -75,7 +76,7 @@ class BuildSelector:
|
||||
def __call__(self, build_id: str) -> bool:
|
||||
# Filter build selectors by python_requires if set
|
||||
if self.requires_python is not None:
|
||||
py_ver_str = build_id.split("-")[0]
|
||||
py_ver_str = build_id.split("-")[0].split("_")[0]
|
||||
py_ver_str = py_ver_str.removesuffix("t")
|
||||
major = int(py_ver_str[2])
|
||||
minor = int(py_ver_str[3:])
|
||||
@@ -98,6 +99,10 @@ class BuildSelector:
|
||||
return False
|
||||
if EnableGroup.GraalPy not in self.enable and fnmatch(build_id, "gp*"):
|
||||
return False
|
||||
if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
|
||||
build_id, "cp313-pyodide_*"
|
||||
):
|
||||
return False
|
||||
|
||||
should_build = selector_matches(self.build_config, build_id)
|
||||
should_skip = selector_matches(self.skip_config, build_id)
|
||||
@@ -113,7 +118,7 @@ class BuildSelector:
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||
class TestSelector:
|
||||
"""
|
||||
A build selector that can only skip tests according to a skip pattern.
|
||||
|
||||
@@ -4,7 +4,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import typing
|
||||
from collections.abc import Mapping
|
||||
from collections.abc import Iterator, Mapping
|
||||
from typing import Final, Literal
|
||||
|
||||
from ..errors import FatalError
|
||||
@@ -81,3 +81,18 @@ def shell(
|
||||
command = " ".join(commands)
|
||||
print(f"+ {command}")
|
||||
subprocess.run(command, env=env, cwd=cwd, shell=True, check=True)
|
||||
|
||||
|
||||
def split_command(lst: list[str]) -> Iterator[list[str]]:
|
||||
"""
|
||||
Split a shell-style command, as returned by shlex.split, into a sequence
|
||||
of commands, separated by '&&'.
|
||||
"""
|
||||
items = list[str]()
|
||||
for item in lst:
|
||||
if item == "&&":
|
||||
yield items
|
||||
items = []
|
||||
else:
|
||||
items.append(item)
|
||||
yield items
|
||||
|
||||
@@ -111,21 +111,21 @@ def copy_into_local(src: Path, dst: PurePath) -> None:
|
||||
|
||||
def copy_test_sources(
|
||||
test_sources: list[str],
|
||||
package_dir: Path,
|
||||
project_dir: Path,
|
||||
test_dir: PurePath,
|
||||
copy_into: Callable[[Path, PurePath], None] = copy_into_local,
|
||||
) -> None:
|
||||
"""Copy the list of test sources from the package to the test directory.
|
||||
|
||||
:param test_sources: A list of test paths, relative to the package_dir.
|
||||
:param package_dir: The root of the package directory.
|
||||
:param test_sources: A list of test paths, relative to the project_dir.
|
||||
:param project_dir: The root of the project.
|
||||
:param test_dir: The folder where test sources should be placed.
|
||||
:param copy_info: The copy function to use. By default, does a local
|
||||
:param copy_into: The copy function to use. By default, does a local
|
||||
filesystem copy; but an OCIContainer.copy_info method (or equivalent)
|
||||
can be provided.
|
||||
"""
|
||||
for test_path in test_sources:
|
||||
source = package_dir.resolve() / test_path
|
||||
source = project_dir.resolve() / test_path
|
||||
|
||||
if not source.exists():
|
||||
msg = f"Test source {test_path} does not exist."
|
||||
|
||||
@@ -11,7 +11,7 @@ from .cmd import call
|
||||
from .helpers import parse_key_value_string, unwrap
|
||||
|
||||
|
||||
@dataclass()
|
||||
@dataclass(kw_only=True)
|
||||
class DependencyConstraints:
|
||||
base_file_path: Path | None = None
|
||||
packages: list[str] = field(default_factory=list)
|
||||
@@ -135,6 +135,7 @@ def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> T | None:
|
||||
"""
|
||||
|
||||
interpreter, platform = identifier.split("-", 1)
|
||||
interpreter = interpreter.split("_")[0]
|
||||
free_threaded = interpreter.endswith("t")
|
||||
if free_threaded:
|
||||
interpreter = interpreter[:-1]
|
||||
@@ -165,6 +166,9 @@ def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> T | None:
|
||||
continue
|
||||
if not tag.platform.endswith(f"_{arch}"):
|
||||
continue
|
||||
elif platform.startswith("pyodide"):
|
||||
# each Pyodide version has its own platform tag
|
||||
continue
|
||||
else:
|
||||
# Windows should exactly match
|
||||
if tag.platform != platform:
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
import fnmatch
|
||||
import functools
|
||||
import json
|
||||
import platform
|
||||
import typing
|
||||
from pathlib import Path
|
||||
|
||||
from filelock import FileLock
|
||||
|
||||
from cibuildwheel.util.file import download, extract_tar
|
||||
from cibuildwheel.util.resources import PYTHON_BUILD_STANDALONE_RELEASES
|
||||
|
||||
|
||||
class PythonBuildStandaloneAsset(typing.TypedDict):
|
||||
name: str
|
||||
url: str
|
||||
|
||||
|
||||
class PythonBuildStandaloneRelease(typing.TypedDict):
|
||||
tag: str
|
||||
assets: list[PythonBuildStandaloneAsset]
|
||||
|
||||
|
||||
class PythonBuildStandaloneReleaseData(typing.TypedDict):
|
||||
releases: list[PythonBuildStandaloneRelease]
|
||||
|
||||
|
||||
@functools.cache
|
||||
def get_python_build_standalone_release_data() -> PythonBuildStandaloneReleaseData:
|
||||
with open(PYTHON_BUILD_STANDALONE_RELEASES, "rb") as f:
|
||||
return typing.cast(PythonBuildStandaloneReleaseData, json.load(f))
|
||||
|
||||
|
||||
class PythonBuildStandaloneError(Exception):
|
||||
"""Errors related to python-build-standalone."""
|
||||
|
||||
|
||||
def _get_platform_identifiers() -> tuple[str, str, str | None]:
|
||||
"""
|
||||
Detects the current platform and returns architecture, platform, and libc
|
||||
identifiers.
|
||||
"""
|
||||
system = platform.system()
|
||||
machine = platform.machine()
|
||||
machine_lower = machine.lower()
|
||||
|
||||
arch_identifier: str
|
||||
platform_identifier: str
|
||||
libc_identifier: str | None = None
|
||||
|
||||
# Map Architecture
|
||||
if machine_lower in ["x86_64", "amd64"]:
|
||||
arch_identifier = "x86_64"
|
||||
elif machine_lower in ["aarch64", "arm64"]:
|
||||
arch_identifier = "aarch64"
|
||||
else:
|
||||
msg = f"Unsupported architecture: {system} {machine}. Cannot download appropriate Python build."
|
||||
raise PythonBuildStandaloneError(msg)
|
||||
|
||||
# Map OS + Libc
|
||||
if system == "Linux":
|
||||
platform_identifier = "unknown-linux"
|
||||
libc_identifier = "musl" if "musl" in (platform.libc_ver() or ("", "")) else "gnu"
|
||||
elif system == "Darwin":
|
||||
platform_identifier = "apple-darwin"
|
||||
elif system == "Windows":
|
||||
platform_identifier = "pc-windows-msvc"
|
||||
else:
|
||||
msg = f"Unsupported operating system: {system}. Cannot download appropriate Python build."
|
||||
raise PythonBuildStandaloneError(msg)
|
||||
|
||||
print(
|
||||
f"Detected platform: arch='{arch_identifier}', platform='{platform_identifier}', libc='{libc_identifier}'"
|
||||
)
|
||||
return arch_identifier, platform_identifier, libc_identifier
|
||||
|
||||
|
||||
def _get_pbs_asset(
|
||||
*,
|
||||
python_version: str,
|
||||
arch_identifier: str,
|
||||
platform_identifier: str,
|
||||
libc_identifier: str | None,
|
||||
) -> tuple[str, str, str]:
|
||||
"""Finds the asset, returning (tag, filename, url)."""
|
||||
release_data = get_python_build_standalone_release_data()
|
||||
|
||||
expected_suffix = f"{arch_identifier}-{platform_identifier}"
|
||||
if libc_identifier:
|
||||
expected_suffix += f"-{libc_identifier}"
|
||||
expected_suffix += "-install_only.tar.gz"
|
||||
|
||||
asset_pattern = f"cpython-{python_version}.*-{expected_suffix}"
|
||||
print(f"Looking for file with pattern {asset_pattern}")
|
||||
|
||||
for release in release_data["releases"]:
|
||||
for asset in release["assets"]:
|
||||
asset_name = asset["name"]
|
||||
if not fnmatch.fnmatch(asset_name, asset_pattern):
|
||||
continue
|
||||
|
||||
asset_url = asset["url"]
|
||||
return release["tag"], asset_url, asset_name
|
||||
|
||||
# If loop completes without finding a match
|
||||
msg = f"Could not find python-build-standalone release asset matching {asset_pattern!r}."
|
||||
raise PythonBuildStandaloneError(msg)
|
||||
|
||||
|
||||
def _download_or_get_from_cache(asset_url: str, asset_filename: str, cache_dir: Path) -> Path:
|
||||
with FileLock(cache_dir / (asset_filename + ".lock")):
|
||||
asset_cache_path = cache_dir / asset_filename
|
||||
if asset_cache_path.is_file():
|
||||
print(f"Using cached python_build_standalone: {asset_cache_path}")
|
||||
return asset_cache_path
|
||||
|
||||
print(f"Downloading python_build_standalone: {asset_url} to {asset_cache_path}")
|
||||
download(asset_url, asset_cache_path)
|
||||
return asset_cache_path
|
||||
|
||||
|
||||
def _find_python_executable(extracted_dir: Path) -> Path:
|
||||
"""Finds the python executable within the extracted directory structure."""
|
||||
# Structure is typically 'python/bin/python' or 'python/python.exe'
|
||||
base_install_dir = extracted_dir / "python"
|
||||
|
||||
if platform.system() == "Windows":
|
||||
executable_path = base_install_dir / "python.exe"
|
||||
else:
|
||||
executable_path = base_install_dir / "bin" / "python"
|
||||
|
||||
if not executable_path.is_file():
|
||||
msg = f"Could not locate python executable at expected path {executable_path} within {extracted_dir}."
|
||||
raise PythonBuildStandaloneError(msg)
|
||||
|
||||
print(f"Found python executable: {executable_path}")
|
||||
return executable_path.resolve() # Return absolute path
|
||||
|
||||
|
||||
def create_python_build_standalone_environment(
|
||||
python_version: str, temp_dir: Path, cache_dir: Path
|
||||
) -> Path:
|
||||
"""
|
||||
Returns a Python environment from python-build-standalone, downloading it
|
||||
if necessary using a cache, and expanding it into a fresh base path.
|
||||
|
||||
Args:
|
||||
python_version: The Python version string (e.g., "3.12").
|
||||
temp_dir: A directory where the Python environment will be created.
|
||||
cache_dir: A directory to store/retrieve downloaded archives.
|
||||
|
||||
Returns:
|
||||
The absolute path to the python executable within the created environment (in temp_dir).
|
||||
|
||||
Raises:
|
||||
PythonBuildStandaloneError: If the platform is unsupported, the build cannot be found,
|
||||
download/extraction fails, or configuration is invalid.
|
||||
"""
|
||||
|
||||
print(f"Creating python-build-standalone environment: version={python_version}")
|
||||
|
||||
arch_id, platform_id, libc_id = _get_platform_identifiers()
|
||||
|
||||
pbs_tag, asset_url, asset_filename = _get_pbs_asset(
|
||||
python_version=python_version,
|
||||
arch_identifier=arch_id,
|
||||
platform_identifier=platform_id,
|
||||
libc_identifier=libc_id,
|
||||
)
|
||||
|
||||
print(f"Using python-build-standalone release: {pbs_tag}")
|
||||
|
||||
archive_path = _download_or_get_from_cache(
|
||||
asset_url=asset_url, asset_filename=asset_filename, cache_dir=cache_dir
|
||||
)
|
||||
|
||||
python_base_dir = temp_dir / "pbs"
|
||||
assert not python_base_dir.exists()
|
||||
extract_tar(archive_path, python_base_dir)
|
||||
|
||||
return _find_python_executable(python_base_dir)
|
||||
@@ -16,6 +16,8 @@ BUILD_PLATFORMS: Final[Path] = PATH / "build-platforms.toml"
|
||||
CONSTRAINTS: Final[Path] = PATH / "constraints.txt"
|
||||
VIRTUALENV: Final[Path] = PATH / "virtualenv.toml"
|
||||
CIBUILDWHEEL_SCHEMA: Final[Path] = PATH / "cibuildwheel.schema.json"
|
||||
PYTHON_BUILD_STANDALONE_RELEASES: Final[Path] = PATH / "python-build-standalone-releases.json"
|
||||
TEST_FAIL_CWD_FILE: Final[Path] = PATH / "testing_temp_dir_file.py"
|
||||
|
||||
|
||||
# this value is cached because it's used a lot in unit tests
|
||||
|
||||
+59
-6
@@ -6,7 +6,51 @@ title: Changelog
|
||||
|
||||
### v3.0.0
|
||||
|
||||
Not yet released, but available for testing
|
||||
Not yet released, but available for testing.
|
||||
|
||||
Note - when using a beta version, be sure to check the [latest docs](https://cibuildwheel.pypa.io/en/latest/), rather than the stable version, which is still on v2.X.
|
||||
|
||||
<!--
|
||||
note to self, when doing final release, change to docs URLs in this section to the stable version!
|
||||
-->
|
||||
|
||||
If you've used previous versions of the beta:
|
||||
- ⚠️ Previous betas of v3.0 changed the working directory for tests. This has been rolled back to the v2.x behaviour, so you might need to change configs if you adapted to the beta 1 or 2 behaviour. See [issue #2406](https://github.com/pypa/cibuildwheel/issues/2406) for more information.
|
||||
- ⚠️ GraalPy shipped with the identifier `gp242-*` in previous betas, this has been changed to `gp311_242-*` to be consistent with other interpreters, and to fix a bug with GraalPy and project requires-python detection. If you were using GraalPy, you might need to update your config to use the new identifier.
|
||||
- ⚠️ `test-sources` now uses `project` directory instead of the `package` directory (matching the docs).
|
||||
|
||||
#### v3.0.0b5
|
||||
|
||||
_3 June 2025_
|
||||
|
||||
- ✨ Support multiple commands on iOS, joined by `&&`, like the other platforms. (#2432)
|
||||
- ✨ Add `pyodide-prerelease` enable option, with an early build of 0.28 (Python 3.13). (#2431)
|
||||
- 🛠 test-sources now uses the `project` directory instead of the `package` directory (matching the docs). (#2437)
|
||||
- 🛠 Fixed a bug with GraalPy if vsdevcmd prints an error. Cirrus CI works again. (#2414)
|
||||
- 🛠 Use the standard Schema line for the integrated JSONSchema. (#2433)
|
||||
- 📚 Use Python 3.14 color output in docs CLI output. (#2407)
|
||||
|
||||
#### v3.0.0b4
|
||||
|
||||
_29 May 2025_
|
||||
|
||||
- 🛠 Dependency updates, including Python 3.14.0b2. (#2371)
|
||||
- 🛠 Remove the addition of `PYTHONSAFEPATH` to `test-environment`. (#2429)
|
||||
- 📚 README table now matches docs and auto-updates. (#2427, #2428)
|
||||
|
||||
#### v3.0.0b3
|
||||
|
||||
_28 May 2025_
|
||||
|
||||
- 🛠 Reverts the test working dir (when test-sources isn't set) to a temporary dir, rather than the project. (#2420)
|
||||
- 📚 Docs now primarily use the pyproject.toml name of options, rather than the environment variable name. (#2389)
|
||||
|
||||
#### v3.0.0b2
|
||||
|
||||
_25 May 2025_
|
||||
|
||||
- ✨ Adds the [`CIBW_TEST_ENVIRONMENT`](https://cibuildwheel.pypa.io/en/latest/options/#test-environment) option, which allows you to set environment variables for the test command. cibuildwheel now sets `PYTHONSAFEPATH=1` in test environments by default, to avoid picking up package imports from the local directory - we want to test the installed wheel, not the source tree! You can change that, or any other environment variable in the test environment using this option. (#2388)
|
||||
- ✨ Improves support for Pyodide builds and adds the [`CIBW_PYODIDE_VERSION`](https://cibuildwheel.pypa.io/en/latest/options/#pyodide-version) option, which allows you to specify the version of Pyodide to use for builds. (#2002)
|
||||
|
||||
#### v3.0.0b1
|
||||
|
||||
@@ -17,11 +61,21 @@ _19 May 2025_
|
||||
- ✨ Adds CPython 3.14 support, under the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) `cpython-prerelease`. This version of cibuildwheel uses 3.14.0b1.
|
||||
|
||||
_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 the [test-sources option](https://cibuildwheel.pypa.io/en/latest/options/#test-sources). \[discussion about the test cwd change and how to use to come!\]
|
||||
- ✨ Added `dependency-versions` inline syntax (#2123)
|
||||
- 🛠 EOL manylinux options can no longer be specified by their shortname. Full OCI URL can still be used for these images, if you wish (#2316)
|
||||
- ✨ Adds the [test-sources option](https://cibuildwheel.pypa.io/en/latest/options/#test-sources), and changes the working directory for tests.
|
||||
|
||||
- If this option is set, cibuildwheel will copy the files and folders specified in `test-sources` into a temporary directory, and run the tests from there. This is required for iOS builds, but also useful for other platforms, as it allows you to test the installed wheel without any chance of accidentally importing from the source tree.
|
||||
- ~If this option is not set, cibuildwheel will run the tests in the source tree. This is a change from the previous behavior, where cibuildwheel would run the tests from a temporary directory. We're still investigating what's best here, so if you encounter any issues with this, please let us know in [issue #2406](https://github.com/pypa/cibuildwheel/issues/2406).~
|
||||
- If this option is not set, behaviour matches v2.x - cibuildwheel will run the tests from a temporary directory, and you can use the `{project}` placeholder in the `test-command` to refer to the project directory.
|
||||
|
||||
- ✨ Added´ `dependency-versions` inline syntax (#2123)
|
||||
- 🛠 The default [manylinux image](https://cibuildwheel.pypa.io/en/latest/options/#linux-image) has changed from `manylinux2014` to `manylinux_2_28` (#2330)
|
||||
- 🛠 Invokes `build` rather than `pip wheel` to build wheels by default. You can control this via the [`build-frontend`](https://cibuildwheel.pypa.io/en/latest/options/#build-frontend) option. You might notice that you can see your build log output now! (#2321)
|
||||
- 🛠 Removed the `CIBW_PRERELEASE_PYTHONS` and `CIBW_FREE_THREADED_SUPPORT` options - these have been folded into the [`enable`](https://cibuildwheel.pypa.io/en/latest/options/#enable) option instead. (#2095)
|
||||
- 🛠 EOL images `manylinux1`, `manylinux2010`, `manylinux_2_24` and `musllinux_1_1` can no longer be specified by their shortname. The full OCI name can still be used for these images, if you wish (#2316)
|
||||
- 🛠 Build environments no longer have setuptools and wheel preinstalled. (#2329)
|
||||
- ⚠️ PyPy wheels no longer built by default, due to a change to our options system. To continue building PyPy wheels, you'll now need to set the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) to `pypy` or `pypy-eol`.
|
||||
- ⚠️ Dropped support for building Python 3.6 and 3.7 wheels. If you need to build wheels for these versions, use cibuildwheel v2.23.3 or earlier. (#2282)
|
||||
- ⚠️ The minimum Python version required to run cibuildwheel is now Python 3.11. You can still build wheels for Python 3.8 and newer. (#1912)
|
||||
- ⚠️ PyPy wheels no longer built by default, due to a change to our options system. To continue building PyPy wheels, you'll now need to set the [`enable` option](https://cibuildwheel.pypa.io/en/latest/options/#enable) to `pypy` or `pypy-eol`. (#2095)
|
||||
- ⚠️ Dropped official support for Appveyor. If it was working for you before, it will probably continue to do so, but we can't be sure, because our CI doesn't run there anymore. (#2386)
|
||||
- 📚 A reorganisation of the docs, and numerous updates (#2280)
|
||||
|
||||
@@ -37,7 +91,6 @@ _24 March 2025_
|
||||
|
||||
- 🐛 Workaround an issue with pyodide builds when running cibuildwheel with a Python that was installed via UV (#2328 via #2331)
|
||||
- 🛠 Dependency updates, including a manylinux update that fixes an ['undefined symbol' error](https://github.com/pypa/manylinux/issues/1760) in gcc-toolset (#2334)
|
||||
-
|
||||
|
||||
### v2.23.1
|
||||
|
||||
|
||||
+7
-18
@@ -17,7 +17,7 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
|
||||
```yaml
|
||||
env:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest ./tests"
|
||||
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
||||
```
|
||||
|
||||
!!! tab "Azure Pipelines"
|
||||
@@ -27,7 +27,7 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
|
||||
```yaml
|
||||
variables:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest ./tests"
|
||||
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
||||
```
|
||||
|
||||
!!! tab "Travis CI"
|
||||
@@ -38,18 +38,7 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
|
||||
env:
|
||||
global:
|
||||
- CIBW_TEST_REQUIRES=pytest
|
||||
- CIBW_TEST_COMMAND="pytest ./tests"
|
||||
```
|
||||
|
||||
!!! tab "AppVeyor"
|
||||
|
||||
> appveyor.yml ([docs](https://www.appveyor.com/docs/build-configuration/#environment-variables))
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
global:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest {project}\\tests"
|
||||
- CIBW_TEST_COMMAND="pytest {project}/tests"
|
||||
```
|
||||
|
||||
!!! tab "CircleCI"
|
||||
@@ -61,18 +50,18 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
|
||||
job_name:
|
||||
environment:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest ./tests"
|
||||
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
||||
```
|
||||
|
||||
!!! tab "Gitlab CI"
|
||||
|
||||
> .gitlab-ci.yml ([docs](https://docs.gitlab.com/ee/ci/variables/README.html#create-a-custom-variable-in-gitlab-ciyml))
|
||||
> .gitlab-ci.yml ([docs](https://docs.gitlab.com/ci/yaml/#variables))
|
||||
|
||||
```yaml
|
||||
linux:
|
||||
variables:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest ./tests"
|
||||
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
||||
```
|
||||
|
||||
!!! tab "Cirrus CI"
|
||||
@@ -82,7 +71,7 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
|
||||
```yaml
|
||||
env:
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: "pytest ./tests"
|
||||
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
||||
```
|
||||
|
||||
## Configuration file {: #configuration-file}
|
||||
|
||||
@@ -16,7 +16,7 @@ Everyone contributing to the cibuildwheel project is expected to follow the [PSF
|
||||
|
||||
- `cibuildwheel` should wrap the complexity of wheel building.
|
||||
- The user interface to `cibuildwheel` is the build script (e.g. `.travis.yml`). Feature additions should not increase the complexity of this script.
|
||||
- Options should be environment variables (these lend themselves better to YML config files). They should be prefixed with `CIBW_`.
|
||||
- Options should be environment variables (these lend themselves better to YAML config files). They should be prefixed with `CIBW_`.
|
||||
- Options should be generalised to all platforms. If platform-specific options are required, they should be namespaced e.g. `CIBW_TEST_COMMAND_MACOS`
|
||||
|
||||
Other notes:
|
||||
|
||||
@@ -79,7 +79,7 @@ for an example configuration.
|
||||
|
||||
## Manual method
|
||||
|
||||
On your development machine, install [pipx](https://pypa.github.io/pipx/) and do the following:
|
||||
On your development machine, install [pipx](https://pipx.pypa.io/) and do the following:
|
||||
|
||||
```bash
|
||||
# Either download the SDist from your CI, or make it:
|
||||
|
||||
@@ -45,6 +45,42 @@ h1, h2, h3, h4, h5, h6 {
|
||||
border-bottom: 1px solid #e1e4e5;
|
||||
margin-bottom: 0.8em;
|
||||
padding-bottom: 0.2em;
|
||||
scroll-margin: 1.5em 0;
|
||||
}
|
||||
|
||||
/* make it so tables can overflow the content area, make the most of the content area */
|
||||
.wy-nav-content-wrap {
|
||||
container-type: inline-size;
|
||||
}
|
||||
.wy-table-responsive {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
left: -3.236em;
|
||||
max-width: calc(100cqw);
|
||||
width: fit-content;
|
||||
min-width: calc(100% + 3.236em + 3.236em);
|
||||
}
|
||||
.rst-content .section .wy-table-responsive .docutils {
|
||||
padding-left: 3.236em;
|
||||
padding-right: 3.236em;
|
||||
}
|
||||
.rst-content .section .wy-table-responsive .docutils thead,
|
||||
.rst-content .section .wy-table-responsive .docutils tbody {
|
||||
background-color: white;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.wy-table-responsive {
|
||||
left: -1em;
|
||||
}
|
||||
.rst-content .section .wy-table-responsive .docutils {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.wy-nav-content {
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.rst-content blockquote {
|
||||
|
||||
+14
-14
@@ -33,7 +33,7 @@ The CPython Limited API is a subset of the Python C Extension API that's declare
|
||||
|
||||
To create a package that builds ABI3 wheels, you'll need to configure your build backend to compile libraries correctly create wheels with the right tags. [Check this repo](https://github.com/joerick/python-abi3-package-sample) for an example of how to do this with setuptools.
|
||||
|
||||
You could also consider running [abi3audit](https://github.com/trailofbits/abi3audit) against the produced wheels in order to check for abi3 violations or inconsistencies. You can run it alongside the default in your [CIBW_REPAIR_WHEEL_COMMAND](options.md#repair-wheel-command).
|
||||
You could also consider running [abi3audit](https://github.com/trailofbits/abi3audit) against the produced wheels in order to check for abi3 violations or inconsistencies. You can run it alongside the default in your [repair-wheel-command](options.md#repair-wheel-command).
|
||||
|
||||
### Packages with optional C extensions {: #optional-extensions}
|
||||
|
||||
@@ -60,7 +60,7 @@ There are two suggested methods for keeping cibuildwheel up to date that instead
|
||||
If you use GitHub Actions for builds, you can use cibuildwheel as an action:
|
||||
|
||||
```yaml
|
||||
uses: pypa/cibuildwheel@v3.0.0b1
|
||||
uses: pypa/cibuildwheel@v3.0.0b5
|
||||
```
|
||||
|
||||
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.
|
||||
@@ -82,7 +82,7 @@ The second option, and the only one that supports other CI systems, is using a `
|
||||
|
||||
```bash
|
||||
# requirements-cibw.txt
|
||||
cibuildwheel==3.0.0b1
|
||||
cibuildwheel==3.0.0b5
|
||||
```
|
||||
|
||||
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:
|
||||
@@ -108,7 +108,7 @@ package 'sdist' will also benefit.
|
||||
|
||||
#### Missing build dependencies {: #cibw-options-alternatives-deps}
|
||||
|
||||
If your build needs Python dependencies, rather than using `CIBW_BEFORE_BUILD`, it's best to add these to the
|
||||
If your build needs Python dependencies, rather than using `before-build`, it's best to add these to the
|
||||
[`build-system.requires`](https://www.python.org/dev/peps/pep-0518/#build-system-table)
|
||||
section of your pyproject.toml. For example, if your project requires Cython
|
||||
to build, your pyproject.toml might include a section like this:
|
||||
@@ -129,7 +129,7 @@ You might need to run some other commands before building, like running a
|
||||
script that performs codegen or downloading some data that's not stored in
|
||||
your source tree.
|
||||
|
||||
Rather than using `CIBW_BEFORE_ALL` or `CIBW_BEFORE_BUILD`, you could incorporate
|
||||
Rather than using `before-all` or `before-build`, you could incorporate
|
||||
these steps into your package's build process. For example, if you're using
|
||||
setuptools, you can add steps to your package's `setup.py` using a structure
|
||||
like this:
|
||||
@@ -163,7 +163,7 @@ setuptools.setup(
|
||||
|
||||
Your build might need some compiler flags to be set through environment variables.
|
||||
Consider incorporating these into your package, for example, in `setup.py` using [`extra_compile_args` or
|
||||
`extra_link_args`](https://docs.python.org/3/distutils/setupscript.html#other-options).
|
||||
`extra_link_args`](https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#setuptools.Extension).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -177,16 +177,16 @@ Sometimes a build will fail due to a missing dependency.
|
||||
|
||||
**If the build is missing a Python package**, you should [add it to pyproject.toml](#cibw-options-alternatives-deps).
|
||||
|
||||
**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 [`CIBW_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 [`CIBW_BEFORE_ALL`](options.md#before-all). However, on Linux, Mac (and Windows if you're using [delvewheel]), the library that you install will be bundled into the wheel in the [repair step]. So take care to ensure that
|
||||
**If your build is linking into a native library dependency**, you can build/install that in [`before-all`](options.md#before-all). However, on Linux, Mac (and Windows 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 matches the architecture of the wheel you're building when cross-compiling
|
||||
|
||||
This is particularly an issue on macOS, where de facto package manager Homebrew will install libraries that are compiled for the specific version of macOS that the build machine is running, rendering the wheels useless for any previous version. And brew will not install the right arch for cross compilation of Apple Silicon wheels.
|
||||
|
||||
For these reasons, it's strongly recommended to not use brew for native library dependencies. Instead, we recommend compiling the library yourself. If you compile in the [`CIBW_BEFORE_ALL`](options.md#before-all) step, cibuildwheel will have already set the appropriate `MACOSX_DEPLOYMENT_TARGET` env var, so the library will target the correct version of macOS.
|
||||
For these reasons, it's strongly recommended to not use brew for native library dependencies. Instead, we recommend compiling the library yourself. If you compile in the [`before-all`](options.md#before-all) step, cibuildwheel will have already set the appropriate `MACOSX_DEPLOYMENT_TARGET` env var, so the library will target the correct version of macOS.
|
||||
|
||||
!!! tip
|
||||
For build steps, Homebrew is still a great resource - you can [look up the build formula](https://formulae.brew.sh/) and use that as a starting point.
|
||||
@@ -247,15 +247,15 @@ Solutions to this vary, but the simplest is to use pipx:
|
||||
# most runners have pipx preinstalled, but in case you don't
|
||||
python3 -m pip install pipx
|
||||
|
||||
pipx run cibuildwheel==3.0.0b1 --output-dir wheelhouse
|
||||
pipx run cibuildwheel==3.0.0b5 --output-dir wheelhouse
|
||||
pipx run twine upload wheelhouse/*.whl
|
||||
```
|
||||
|
||||
### macOS: Passing DYLD_LIBRARY_PATH to delocate
|
||||
|
||||
macOS has built-in [System Integrity protections](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html) which limits the use of `DYLD_LIBRARY_PATH` and `LD_LIBRARY_PATH` so that it does not automatically pass to children processes. This means if you set `DYLD_LIBRARY_PATH` before running cibuildwheel, or even set it in `CIBW_ENVIRONMENT`, it will be stripped out of the environment before delocate is called.
|
||||
macOS has built-in [System Integrity protections](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html) which limits the use of `DYLD_LIBRARY_PATH` and `LD_LIBRARY_PATH` so that it does not automatically pass to children processes. This means if you set `DYLD_LIBRARY_PATH` before running cibuildwheel, or even set it in `environment`, it will be stripped out of the environment before delocate is called.
|
||||
|
||||
To work around this, use a different environment variable such as `REPAIR_LIBRARY_PATH` to store the library path, and set `DYLD_LIBRARY_PATH` in [`CIBW_REPAIR_WHEEL_COMMAND_MACOS`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command), like this:
|
||||
To work around this, use a different environment variable such as `REPAIR_LIBRARY_PATH` to store the library path, and set `DYLD_LIBRARY_PATH` in [`macos.repair-wheel-command`](https://cibuildwheel.pypa.io/en/stable/options/#repair-wheel-command), like this:
|
||||
|
||||
!!! tab examples "Environment variables"
|
||||
|
||||
@@ -307,13 +307,13 @@ Then cibuildwheel will detect that it's installed and use it instead. However, y
|
||||
### macOS: Library dependencies do not satisfy target MacOS
|
||||
|
||||
Since delocate 0.11.0 there is added verification that the library binary dependencies match the target macOS version. This is to prevent the situation where a wheel platform tag is lower than the actual minimum macOS version required by the library. To resolve this error you need to build the library to the same macOS version as the target wheel (for example using `MACOSX_DEPLOYMENT_TARGET` environment variable).
|
||||
Alternatively, you could set `MACOSX_DEPLOYMENT_TARGET` in `CIBW_ENVIRONMENT` to correctly label the wheel as incompatible with older macOS versions.
|
||||
Alternatively, you could set `MACOSX_DEPLOYMENT_TARGET` in `environment` to correctly label the wheel as incompatible with older macOS versions.
|
||||
|
||||
This error may happen when you install a library using a package manager like Homebrew, which compiles the library for the macOS version of the build machine. This is not suitable for wheels, as the library will only work on the same macOS version as the build machine. You should compile the library yourself, or use a precompiled binary that matches the target macOS version.
|
||||
|
||||
### Windows: 'ImportError: DLL load failed: The specific module could not be found'
|
||||
|
||||
Visual Studio and MSVC link the compiled binary wheels to the Microsoft Visual C++ Runtime. Normally, the C parts of the runtime are included with Python, but the C++ components are not. When compiling modules using C++, it is possible users will run into problems on systems that do not have the full set of runtime libraries installed. The solution is to ask users to download the corresponding Visual C++ Redistributable from the [Microsoft website](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) and install it.
|
||||
Visual Studio and MSVC link the compiled binary wheels to the Microsoft Visual C++ Runtime. Normally, the C parts of the runtime are included with Python, but the C++ components are not. When compiling modules using C++, it is possible users will run into problems on systems that do not have the full set of runtime libraries installed. The solution is to ask users to download the corresponding Visual C++ Redistributable from the [Microsoft website](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist) and install it.
|
||||
|
||||
Additionally, Visual Studio 2019 started linking to an even newer DLL, `VCRUNTIME140_1.dll`, besides the `VCRUNTIME140.dll` that is included with recent Python versions (starting from Python 3.5; see [here](https://wiki.python.org/moin/WindowsCompilers) for more details on the corresponding Visual Studio & MSVC versions used to compile the different Python versions). To avoid this extra dependency on `VCRUNTIME140_1.dll`, the [`/d2FH4-` flag](https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/) can be added to the MSVC invocations (check out [this issue](https://github.com/pypa/cibuildwheel/issues/423) for details and references). CPython 3.8.3 and all versions after it have this extra DLL, so it is only needed for 3.8 and earlier.
|
||||
|
||||
|
||||
+15
-1
@@ -1,8 +1,12 @@
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sysconfig
|
||||
from typing import Any
|
||||
|
||||
import rich.console
|
||||
import rich.text
|
||||
|
||||
|
||||
def define_env(env: Any) -> None:
|
||||
"Hook function for mkdocs-macros"
|
||||
@@ -12,5 +16,15 @@ def define_env(env: Any) -> None:
|
||||
"Run a subprocess and return the stdout"
|
||||
env = os.environ.copy()
|
||||
scripts = sysconfig.get_path("scripts")
|
||||
env.pop("NO_COLOR", None)
|
||||
env["PATH"] = f"{scripts}{os.pathsep}{env.get('PATH', '')}"
|
||||
return subprocess.run(args, check=True, capture_output=True, text=True, env=env).stdout
|
||||
env["PYTHON_COLORS"] = "1"
|
||||
output = subprocess.run(args, check=True, capture_output=True, text=True, env=env).stdout
|
||||
rich_text = rich.text.Text.from_ansi(output)
|
||||
console = rich.console.Console(record=True, force_terminal=True)
|
||||
console.print(rich_text)
|
||||
page = console.export_html(inline_styles=True)
|
||||
result = re.search(r"<body.*?>(.*?)</body>", page, re.DOTALL | re.IGNORECASE)
|
||||
assert result
|
||||
txt = result.group(1).strip()
|
||||
return txt.replace("code ", 'code class="nohighlight" ')
|
||||
|
||||
+693
-522
File diff suppressed because it is too large
Load Diff
+29
-19
@@ -3,7 +3,7 @@ title: Platforms
|
||||
---
|
||||
# Platforms
|
||||
|
||||
## Linux
|
||||
## Linux {: #linux}
|
||||
|
||||
### System requirements
|
||||
|
||||
@@ -25,13 +25,13 @@ Linux wheels are built in [`manylinux`/`musllinux` containers](https://github.co
|
||||
|
||||
- Programs and libraries are not installed on the CI runner host, but rather should be installed inside the container - using `yum` for `manylinux2014`, `apt-get` for `manylinux_2_31`, `dnf` for `manylinux_2_28` and `apk` for `musllinux_1_1` or `musllinux_1_2`, or manually. The same goes for environment variables that are potentially needed to customize the wheel building.
|
||||
|
||||
`cibuildwheel` supports this by providing the [`CIBW_ENVIRONMENT`](options.md#environment) and [`CIBW_BEFORE_ALL`](options.md#before-all) options to setup the build environment inside the running container.
|
||||
`cibuildwheel` supports this by providing the [`environment`](options.md#environment) and [`before-all`](options.md#before-all) options to setup the build environment inside the running container.
|
||||
|
||||
- The project directory is copied into the container as `/project`, the output directory for the wheels to be copied out is `/output`. In general, this is handled transparently by `cibuildwheel`. For a more finegrained level of control however, the root of the host file system is mounted as `/host`, allowing for example to access shared files, caches, etc. on the host file system. Note that `/host` is not available on CircleCI and GitLab CI due to their Docker policies.
|
||||
|
||||
- Alternative Docker images can be specified with the `CIBW_MANYLINUX_*_IMAGE`/`CIBW_MUSLLINUX_*_IMAGE` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#linux-image) for more details.
|
||||
- Alternative Docker images can be specified with the `manylinux-*-image`/`musllinux-*-image` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#linux-image) for more details.
|
||||
|
||||
## macOS
|
||||
## macOS {: #macos}
|
||||
|
||||
### System requirements
|
||||
|
||||
@@ -80,7 +80,7 @@ If you set the value lower, cibuildwheel will cap it to the lowest supported val
|
||||
|
||||
`cibuildwheel` supports both native builds and cross-compiling between `arm64` (Apple Silicon) and `x86_64` (Intel) architectures, including the cross-compatible `universal2` format. By default, macOS builds will build a single architecture wheel, using the build machine's architecture.
|
||||
|
||||
If you need to support both x86_64 and Apple Silicon, you can use the `CIBW_ARCHS` environment variable to specify the architectures you want to build, or the value `universal2` to build a multi-architecture wheel. cibuildwheel _will_ test x86_64 wheels (or the x86_64 slice of a `universal2` wheel) when running on Apple Silicon hardware using Rosetta 2 emulation, but it is *not* possible to test Apple Silicon wheels on x86_64 hardware.
|
||||
If you need to support both `x86_64` and Apple Silicon, you can use the [`macos.archs`](options.md#archs) setting to specify the architectures you want to build, or the value `universal2` to build a multi-architecture wheel. cibuildwheel _will_ test `x86_64` wheels (or the `x86_64` slice of a `universal2` wheel) when running on Apple Silicon hardware using Rosetta 2 emulation, but it is *not* possible to test Apple Silicon wheels on `x86_64` hardware.
|
||||
|
||||
#### Overview of Mac architectures
|
||||
|
||||
@@ -129,8 +129,8 @@ If your CI provider doesn't offer arm64 runners yet, or you want to create `univ
|
||||
|
||||
Regarding testing,
|
||||
|
||||
- On an arm64 runner, it is possible to test x86_64 wheels and both parts of a universal2 wheel using Rosetta 2 emulation.
|
||||
- On an x86_64 runner, arm64 code can be compiled but it can't be tested. `cibuildwheel` will raise a warning to notify you of this - these warnings can be silenced by skipping testing on these platforms: `CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"`.
|
||||
- On an arm64 runner, it is possible to test `x86_64` wheels and both parts of a `universal2` wheel using Rosetta 2 emulation.
|
||||
- On an `x86_64` runner, arm64 code can be compiled but it can't be tested. `cibuildwheel` will raise a warning to notify you of this - these warnings can be silenced by skipping testing on these platforms: `test-skip = ["*_arm64", "*_universal2:arm64"]`.
|
||||
|
||||
!!! note
|
||||
If your project uses **Poetry** as a build backend, cross-compiling on macOS [does not currently work](https://github.com/python-poetry/poetry/issues/7107). In some cases arm64 wheels can be built but their tags will be incorrect, with the platform tag showing `x86_64` instead of `arm64`.
|
||||
@@ -138,7 +138,7 @@ Regarding testing,
|
||||
As a workaround, the tag can be fixed before running delocate to repair the wheel. The [`wheel tags`](https://wheel.readthedocs.io/en/stable/reference/wheel_tags.html) command is ideal for this. See [this workflow](https://gist.github.com/anderssonjohan/49f07e33fc5cb2420515a8ac76dc0c95#file-build-pendulum-wheels-yml-L39-L53) for an example usage of `wheel tags`.
|
||||
|
||||
|
||||
## Windows
|
||||
## Windows {: #windows}
|
||||
|
||||
### System requirements
|
||||
|
||||
@@ -150,25 +150,35 @@ In order to speed-up builds, cibuildwheel will cache the tools it needs to be re
|
||||
|
||||
### Windows ARM64 builds {: #windows-arm64}
|
||||
|
||||
`cibuildwheel` supports cross-compiling `ARM64` wheels on all Windows runners, but a native ARM64 runner is required for testing. On non-native runners, tests for ARM64 wheels will be automatically skipped with a warning. Add `"*-win_arm64"` to your `CIBW_TEST_SKIP` setting to suppress the warning.
|
||||
`cibuildwheel` supports cross-compiling `ARM64` wheels on all Windows runners, but a native `ARM64` runner is required for testing. On non-native runners, tests for `ARM64` wheels will be automatically skipped with a warning. Add `"*-win_arm64"` to your `test-skip` setting to suppress the warning.
|
||||
|
||||
Cross-compilation on Windows relies on a supported build backend. Supported backends use an environment variable to specify their target platform (the one they are compiling native modules for, as opposed to the one they are running on), which is set in [cibuildwheels/windows.py](https://github.com/pypa/cibuildwheel/blob/main/cibuildwheel/windows.py) before building. Currently, `setuptools>=65.4.1` and `setuptools_rust` are the only supported backends.
|
||||
Cross-compilation on Windows relies on a supported build backend. Supported backends use an environment variable to specify their target platform (the one they are compiling native modules for, as opposed to the one they are running on), which is set in [cibuildwheel's windows.py](https://github.com/pypa/cibuildwheel/blob/main/cibuildwheel/platforms/windows.py) before building. Currently, `setuptools>=65.4.1` and `setuptools_rust` are the only supported backends.
|
||||
|
||||
By default, `ARM64` is not enabled when running on non-ARM64 runners. Use [`CIBW_ARCHS`](options.md#archs) to select it.
|
||||
By default, `ARM64` is not enabled when running on non-`ARM64` runners. Use [`CIBW_ARCHS`](options.md#archs) to select it.
|
||||
|
||||
## Pyodide/WebAssembly {: #pyodide}
|
||||
|
||||
Pyodide is offered as an experimental feature in cibuildwheel.
|
||||
|
||||
### Prerequisites
|
||||
### System requirements
|
||||
|
||||
You need to have a matching host version of Python (unlike all other cibuildwheel platforms). Linux host highly recommended; macOS hosts may work (e.g. invoking `pytest` directly in [`CIBW_TEST_COMMAND`](options.md#test-command) is [currently failing](https://github.com/pyodide/pyodide/issues/4802)) and Windows hosts will not work.
|
||||
Pyodide builds require a Linux or macOS machine.
|
||||
|
||||
### Specifying a pyodide build
|
||||
|
||||
You must target pyodide with `--platform pyodide` (or use `--only` on the identifier).
|
||||
|
||||
## iOS
|
||||
### Choosing a Pyodide version {: #pyodide-choosing-a-version}
|
||||
|
||||
It is also possible to target a specific Pyodide version by setting the [`pyodide-version`](options.md#pyodide-version) option to the desired version. Users are responsible for setting an appropriate Pyodide version according to the `pyodide-build` version. A list is available in Pyodide's [cross-build environments metadata file](https://github.com/pyodide/pyodide/blob/main/pyodide-cross-build-environments.json), which can be viewed more easily by installing `pyodide-build` from PyPI and using `pyodide xbuildenv search --all` to see a compatibility table.
|
||||
|
||||
If there are pre-releases available for a newer Python version, the `pyodide-prerelease` [`enable`](options.md#enable) can be used to include pre-release versions.
|
||||
|
||||
### Running tests
|
||||
|
||||
Currently, it's recommended to run tests using a `python -m` entrypoint, rather than a command line entrypoint, or a shell script. This is because custom entrypoints have some issues in the Pyodide virtual environment. For example, `pytest` may not work as a command line entrypoint, but will work as a `python -m pytest` entrypoint.
|
||||
|
||||
## iOS {: #ios}
|
||||
|
||||
### System requirements
|
||||
|
||||
@@ -184,11 +194,11 @@ iOS is effectively 2 platforms - physical devices, and simulators. While the API
|
||||
* `arm64_iphonesimulator` (for iOS simulators running on Apple Silicon macOS machines); and
|
||||
* `x64_64_iphonesimulator` (for iOS simulators running on Intel macOS machines).
|
||||
|
||||
By default, cibuildwheel will build wheels for all three of these targets.
|
||||
By default, cibuildwheel will build all wheels for the CPU architecture of the build machine. You can build all wheels for all architectures by specifying `--archs all`.
|
||||
|
||||
If you need to specify different compilation flags or other properties on a per-ABI or per-CPU basis, you can use [configuration overrides](configuration.md#overrides) with a `select` clause that targets the specific ABI or architecture. For example, consider the following example:
|
||||
|
||||
```
|
||||
```toml
|
||||
[tool.cibuildwheel.ios]
|
||||
test-sources = ["tests"]
|
||||
test-requires = ["pytest"]
|
||||
@@ -225,12 +235,12 @@ iOS builds support both the `pip` and `build` build frontends. In principle, sup
|
||||
|
||||
The environment used to run builds does not inherit the full user environment - in particular, `PATH` is deliberately re-written. This is because UNIX C tooling doesn't do a great job differentiating between "macOS ARM64" and "iOS ARM64" binaries. If (for example) Homebrew is on the path when compilation commands are invoked, it's easy for a macOS version of a library to be linked into the iOS binary, rendering it unusable on iOS. To prevent this, iOS builds always force `PATH` to a "known minimal" path, that includes only the bare system utilities, and the iOS compiler toolchain.
|
||||
|
||||
If your project requires additional tools to build (such as `cmake`, `ninja`, or `rustc`), those tools must be explicitly declared as cross-build tools using [`CIBW_XBUILD_TOOLS`](options.md#xbuild-tools). *Any* tool used by the build process must be included in the `CIBW_XBUILD_TOOLS` list, not just tools that cibuildwheel will invoke directly. For example, if your build script invokes `cmake`, and the `cmake` script invokes `magick` to perform some image transformations, both `cmake` and `magick` must be included in your cross-build tools list.
|
||||
If your project requires additional tools to build (such as `cmake`, `ninja`, or `rustc`), those tools must be explicitly declared as cross-build tools using [`xbuild-tools`](options.md#xbuild-tools). *Any* tool used by the build process must be included in the `xbuild-tools` list, not just tools that cibuildwheel will invoke directly. For example, if your build script invokes `cmake`, and the `cmake` script invokes `magick` to perform some image transformations, both `cmake` and `magick` must be included in your cross-build tools list.
|
||||
|
||||
### Tests
|
||||
|
||||
If tests have been configured, the test suite will be executed on the simulator matching the architecture of the build machine - that is, if you're building on an ARM64 macOS machine, the ARM64 wheel will be tested on an ARM64 simulator. It is not possible to use cibuildwheel to test wheels on other simulators, or on physical devices.
|
||||
|
||||
The iOS test environment can't support running shell scripts, so the [`CIBW_TEST_COMMAND`](options.md#test-command) value must be specified as if it were a command line being passed to `python -m ...`. In addition, the project must use [`CIBW_TEST_SOURCES`](options.md#test-sources) to specify the minimum subset of files that should be copied to the test environment. This is because the test must be run "on device", and the simulator device will not have access to the local project directory.
|
||||
The iOS test environment can't support running shell scripts, so the [`test-command`](options.md#test-command) value must be specified as if it were a command line being passed to `python -m ...`. In addition, the project must use [`test-sources`](options.md#test-sources) to specify the minimum subset of files that should be copied to the test environment. This is because the test must be run "on device", and the simulator device will not have access to the local project directory.
|
||||
|
||||
The test process uses the same testbed used by CPython itself to run the CPython test suite. It is an Xcode project that has been configured to have a single Xcode "XCUnit" test - the result of which reports the success or failure of running `python -m <CIBW_TEST_COMMAND>`.
|
||||
The test process uses the same testbed used by CPython itself to run the CPython test suite. It is an Xcode project that has been configured to have a single Xcode "XCUnit" test - the result of which reports the success or failure of running `python -m <test-command>`.
|
||||
|
||||
+18
-18
@@ -23,7 +23,24 @@ cibuildwheel
|
||||
!!!tip
|
||||
You can pass the `--platform linux` option to cibuildwheel to build Linux wheels, even if you're not on Linux. On most machines, the easiest builds to try are the Linux builds. You don't need any software installed except a Docker daemon, such as [Docker Desktop](https://www.docker.com/get-started/). Each platform that cibuildwheel supports has its own system requirements and platform-specific behaviors. See the [platforms page](platforms.md) for details.
|
||||
|
||||
You should see the builds taking place. You can experiment with [options](options.md) using environment variables or pyproject.toml.
|
||||
You should see the builds taking place. You can experiment with [options](options.md) using pyproject.toml or environment variables.
|
||||
|
||||
!!! tab "pyproject.toml"
|
||||
|
||||
If you write your options into [`pyproject.toml`](configuration.md#configuration-file), you can work on your options locally, and they'll be automatically picked up when running in CI.
|
||||
|
||||
> pyproject.toml
|
||||
|
||||
```
|
||||
[tool.cibuildwheel]
|
||||
before-all = "uname -a"
|
||||
```
|
||||
|
||||
Then invoke cibuildwheel, like:
|
||||
|
||||
```console
|
||||
cibuildwheel
|
||||
```
|
||||
|
||||
!!! tab "Environment variables"
|
||||
|
||||
@@ -46,23 +63,6 @@ You should see the builds taking place. You can experiment with [options](option
|
||||
cibuildwheel
|
||||
```
|
||||
|
||||
!!! tab "pyproject.toml"
|
||||
|
||||
If you write your options into [`pyproject.toml`](configuration.md#configuration-file), you can work on your options locally, and they'll be automatically picked up when running in CI.
|
||||
|
||||
> pyproject.toml
|
||||
|
||||
```
|
||||
[tool.cibuildwheel]
|
||||
before-all = "uname -a"
|
||||
```
|
||||
|
||||
Then invoke cibuildwheel, like:
|
||||
|
||||
```console
|
||||
cibuildwheel
|
||||
```
|
||||
|
||||
- Once you've got a build working locally, you can move on to [setting up a CI service](ci-services.md).
|
||||
- View the [full options reference](options.md) to see what cibuildwheel can do.
|
||||
- Check out the [FAQ](faq.md) for common questions.
|
||||
|
||||
@@ -10,8 +10,8 @@ title: Working examples
|
||||
|-----------------------------------|----|----|:------|
|
||||
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
|
||||
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
|
||||
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
|
||||
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an analytical in-process SQL database management system |
|
||||
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
|
||||
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
|
||||
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
|
||||
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The venerable Matplotlib, a Python library with C++ portions |
|
||||
@@ -52,8 +52,8 @@ title: Working examples
|
||||
| [PyYAML][] | ![github icon][] | ![apple icon][] | Canonical source repository for PyYAML |
|
||||
| [pikepdf][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python library for reading and writing PDF, powered by QPDF |
|
||||
| [numexpr][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Fast numerical array expression evaluator for Python, NumPy, Pandas, PyTables and more |
|
||||
| [h5py][] | ![azurepipelines icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | HDF5 for Python -- The h5py package is a Pythonic interface to the HDF5 binary data format. |
|
||||
| [Wrapt][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python module for decorators, wrappers and monkey patching. |
|
||||
| [h5py][] | ![azurepipelines icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | HDF5 for Python -- The h5py package is a Pythonic interface to the HDF5 binary data format. |
|
||||
| [envd][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A machine learning development environment build tool |
|
||||
| [Psycopg 3][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A modern implementation of a PostgreSQL adapter for Python |
|
||||
| [OpenColorIO][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A color management framework for visual effects and animation. |
|
||||
@@ -71,8 +71,8 @@ title: Working examples
|
||||
| [mosec][] | ![github icon][] | ![linux icon][] ![apple icon][] | A machine learning model serving framework powered by Rust |
|
||||
| [Picologging][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A high-performance logging library for Python. |
|
||||
| [pybind11 cmake_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Example pybind11 module built with a CMake-based build system |
|
||||
| [markupsafe][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Safely add untrusted strings to HTML/XML markup. |
|
||||
| [Rtree][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Rtree: spatial index for Python GIS |
|
||||
| [markupsafe][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Safely add untrusted strings to HTML/XML markup. |
|
||||
| [KDEpy][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Kernel Density Estimation in Python |
|
||||
| [dd-trace-py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Uses custom alternate arch emulation on GitHub |
|
||||
| [tgcalls][] | ![github icon][] | ![apple icon][] ![windows icon][] | Python `pybind11` binding to Telegram's WebRTC library with third party dependencies like `OpenSSL`, `MozJPEG`, `FFmpeg`, etc. |
|
||||
@@ -111,8 +111,8 @@ title: Working examples
|
||||
| [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. |
|
||||
| [SiPM][] | ![github icon][] | ![apple icon][] ![linux icon][] | High performance library for SiPM detectors simulation using C++17, OpenMP and AVX2 intrinsics. |
|
||||
| [GSD][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Cython and NumPy project with 64-bit wheels. |
|
||||
| [aalink][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Async Python interface for Ableton Link. |
|
||||
| [GSD][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Cython and NumPy project with 64-bit wheels. |
|
||||
| [CorrectionLib][] | ![github icon][] | ![apple icon][] ![linux icon][] | Structured JSON powered correction library for HEP, designed for the CMS experiment at CERN. |
|
||||
| [xmlstarlet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python 3.6+ CFFI bindings with true MSVC build. |
|
||||
| [werpy][] | ![github icon][] | ![windows icon][] ![linux icon][] ![apple icon][] | An ultra-fast python package using optimized dynamic programming to compute the Word Error Rate (WER). |
|
||||
@@ -120,8 +120,8 @@ title: Working examples
|
||||
|
||||
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
|
||||
[pytorch-fairseq]: https://github.com/facebookresearch/fairseq
|
||||
[NumPy]: https://github.com/numpy/numpy
|
||||
[duckdb]: https://github.com/duckdb/duckdb
|
||||
[NumPy]: https://github.com/numpy/numpy
|
||||
[Tornado]: https://github.com/tornadoweb/tornado
|
||||
[NCNN]: https://github.com/Tencent/ncnn
|
||||
[Matplotlib]: https://github.com/matplotlib/matplotlib
|
||||
@@ -162,8 +162,8 @@ title: Working examples
|
||||
[PyYAML]: https://github.com/yaml/pyyaml
|
||||
[pikepdf]: https://github.com/pikepdf/pikepdf
|
||||
[numexpr]: https://github.com/pydata/numexpr
|
||||
[h5py]: https://github.com/h5py/h5py
|
||||
[Wrapt]: https://github.com/GrahamDumpleton/wrapt
|
||||
[h5py]: https://github.com/h5py/h5py
|
||||
[envd]: https://github.com/tensorchord/envd
|
||||
[Psycopg 3]: https://github.com/psycopg/psycopg
|
||||
[OpenColorIO]: https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
@@ -181,8 +181,8 @@ title: Working examples
|
||||
[mosec]: https://github.com/mosecorg/mosec
|
||||
[Picologging]: https://github.com/microsoft/picologging
|
||||
[pybind11 cmake_example]: https://github.com/pybind/cmake_example
|
||||
[markupsafe]: https://github.com/pallets/markupsafe
|
||||
[Rtree]: https://github.com/Toblerity/rtree
|
||||
[markupsafe]: https://github.com/pallets/markupsafe
|
||||
[KDEpy]: https://github.com/tommyod/KDEpy
|
||||
[dd-trace-py]: https://github.com/DataDog/dd-trace-py
|
||||
[tgcalls]: https://github.com/MarshalX/tgcalls
|
||||
@@ -221,8 +221,8 @@ title: Working examples
|
||||
[pyjet]: https://github.com/scikit-hep/pyjet
|
||||
[ril]: https://github.com/Cryptex-github/ril-py
|
||||
[SiPM]: https://github.com/EdoPro98/SimSiPM
|
||||
[GSD]: https://github.com/glotzerlab/gsd
|
||||
[aalink]: https://github.com/artfwo/aalink
|
||||
[GSD]: https://github.com/glotzerlab/gsd
|
||||
[CorrectionLib]: https://github.com/cms-nanoAOD/correctionlib
|
||||
[xmlstarlet]: https://github.com/dimitern/xmlstarlet
|
||||
[werpy]: https://github.com/analyticsinmotion/werpy
|
||||
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
- bash: |
|
||||
set -o errexit
|
||||
python3 -m pip install --upgrade pip
|
||||
pip3 install cibuildwheel==3.0.0b1
|
||||
pip3 install cibuildwheel==3.0.0b5
|
||||
displayName: Install dependencies
|
||||
- bash: cibuildwheel --output-dir wheelhouse .
|
||||
displayName: Build wheels
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- bash: |
|
||||
set -o errexit
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install cibuildwheel==3.0.0b1
|
||||
python3 -m pip install cibuildwheel==3.0.0b5
|
||||
displayName: Install dependencies
|
||||
- bash: cibuildwheel --output-dir wheelhouse .
|
||||
displayName: Build wheels
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
- bash: |
|
||||
set -o errexit
|
||||
python -m pip install --upgrade pip
|
||||
pip install cibuildwheel==3.0.0b1
|
||||
pip install cibuildwheel==3.0.0b5
|
||||
displayName: Install dependencies
|
||||
- bash: cibuildwheel --output-dir wheelhouse .
|
||||
displayName: Build wheels
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
- run:
|
||||
name: Build the Linux wheels.
|
||||
command: |
|
||||
python3 -m pip install --user cibuildwheel==3.0.0b1
|
||||
python3 -m pip install --user cibuildwheel==3.0.0b5
|
||||
cibuildwheel --output-dir wheelhouse
|
||||
- store_artifacts:
|
||||
path: wheelhouse/
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
- run:
|
||||
name: Build the Linux aarch64 wheels.
|
||||
command: |
|
||||
python3 -m pip install --user cibuildwheel==3.0.0b1
|
||||
python3 -m pip install --user cibuildwheel==3.0.0b5
|
||||
python3 -m cibuildwheel --output-dir wheelhouse
|
||||
- store_artifacts:
|
||||
path: wheelhouse/
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
name: Build the OS X wheels.
|
||||
command: |
|
||||
sudo softwareupdate --install-rosetta --agree-to-license # for python<=3.8 or x86_64/universal2 tests
|
||||
pip3 install cibuildwheel==3.0.0b1
|
||||
pip3 install cibuildwheel==3.0.0b5
|
||||
cibuildwheel --output-dir wheelhouse
|
||||
- store_artifacts:
|
||||
path: wheelhouse/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
|
||||
install_cibuildwheel_script:
|
||||
- python -m pip install cibuildwheel==3.0.0b1
|
||||
- python -m pip install cibuildwheel==3.0.0b5
|
||||
run_cibuildwheel_script:
|
||||
- cibuildwheel
|
||||
wheels_artifacts:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
|
||||
install_cibuildwheel_script:
|
||||
- python -m pip install cibuildwheel==3.0.0b1
|
||||
- python -m pip install cibuildwheel==3.0.0b5
|
||||
run_cibuildwheel_script:
|
||||
- cibuildwheel
|
||||
wheels_artifacts:
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v3.0.0b1
|
||||
uses: pypa/cibuildwheel@v3.0.0b5
|
||||
env:
|
||||
CIBW_PLATFORM: ${{ matrix.platform }}
|
||||
CIBW_ARCHS: ${{ matrix.archs }}
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v3.0.0b1
|
||||
uses: pypa/cibuildwheel@v3.0.0b5
|
||||
# env:
|
||||
# CIBW_SOME_OPTION: value
|
||||
# ...
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build wheels
|
||||
run: pipx run cibuildwheel==3.0.0b1
|
||||
run: pipx run cibuildwheel==3.0.0b5
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
platforms: all
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v3.0.0b1
|
||||
uses: pypa/cibuildwheel@v3.0.0b5
|
||||
env:
|
||||
# configure cibuildwheel on Linux to build native archs ('auto'),
|
||||
# and to split the remaining architectures between the x86_64 and
|
||||
|
||||
@@ -12,7 +12,7 @@ linux:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
script:
|
||||
- curl -sSL https://get.docker.com/ | sh
|
||||
- python -m pip install cibuildwheel==3.0.0b1
|
||||
- python -m pip install cibuildwheel==3.0.0b5
|
||||
- cibuildwheel --output-dir wheelhouse
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -21,9 +21,9 @@ linux:
|
||||
windows:
|
||||
image: mcr.microsoft.com/windows/servercore:1809
|
||||
before_script:
|
||||
- choco install python -y --version 3.12.4
|
||||
- choco install python -y --allow-downgrade --version 3.12.4
|
||||
- choco install git.install -y
|
||||
- py -m pip install cibuildwheel==3.0.0b1
|
||||
- py -m pip install cibuildwheel==3.0.0b5
|
||||
script:
|
||||
- py -m cibuildwheel --output-dir wheelhouse --platform windows
|
||||
artifacts:
|
||||
@@ -35,7 +35,7 @@ windows:
|
||||
macos:
|
||||
image: macos-14-xcode-15
|
||||
before_script:
|
||||
- python3 -m pip install cibuildwheel==3.0.0b1
|
||||
- python3 -m pip install cibuildwheel==3.0.0b5
|
||||
script:
|
||||
- python3 -m cibuildwheel --output-dir wheelhouse
|
||||
artifacts:
|
||||
|
||||
@@ -14,7 +14,7 @@ linux:
|
||||
- curl -sSL https://get.docker.com/ | sh
|
||||
# Warning: This is extremely slow, be careful with how many wheels you build
|
||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
- python -m pip install cibuildwheel==3.0.0b1
|
||||
- python -m pip install cibuildwheel==3.0.0b5
|
||||
# Assuming your CI runner's default architecture is x86_64...
|
||||
- cibuildwheel --output-dir wheelhouse --platform linux --archs aarch64
|
||||
artifacts:
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- ln -s /c/Python312/python.exe /c/Python312/python3.exe
|
||||
|
||||
install:
|
||||
- python3 -m pip install cibuildwheel==3.0.0b1
|
||||
- python3 -m pip install cibuildwheel==3.0.0b5
|
||||
|
||||
script:
|
||||
# build the wheels, put them into './dist'
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- ln -s /c/Python312/python.exe /c/Python312/python3.exe
|
||||
|
||||
install:
|
||||
- python3 -m pip install cibuildwheel==3.0.0b1
|
||||
- python3 -m pip install cibuildwheel==3.0.0b5
|
||||
|
||||
script:
|
||||
# build the wheels, put them into './wheelhouse'
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
- stage: deploy
|
||||
name: Build and deploy Linux wheels
|
||||
services: docker
|
||||
install: python3 -m pip install cibuildwheel==3.0.0b1 twine
|
||||
install: python3 -m pip install cibuildwheel==3.0.0b5 twine
|
||||
script: python3 -m cibuildwheel --output-dir wheelhouse
|
||||
after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl
|
||||
# Deploy on windows
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
name: Build and deploy Windows wheels
|
||||
os: windows
|
||||
language: shell
|
||||
install: python3 -m pip install cibuildwheel==3.0.0b1 twine
|
||||
install: python3 -m pip install cibuildwheel==3.0.0b5 twine
|
||||
script: python3 -m cibuildwheel --output-dir wheelhouse
|
||||
after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl
|
||||
|
||||
|
||||
+22
-10
@@ -68,17 +68,20 @@ def update_constraints(session: nox.Session) -> None:
|
||||
Update the dependencies inplace.
|
||||
"""
|
||||
|
||||
session.install("-e.", "click")
|
||||
|
||||
resources = Path("cibuildwheel/resources")
|
||||
|
||||
if session.venv_backend != "uv":
|
||||
session.install("uv>=0.1.23")
|
||||
|
||||
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
|
||||
# regenerate the constraints files
|
||||
env = os.environ.copy()
|
||||
env["UV_CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
|
||||
|
||||
for minor_version in range(8, 15):
|
||||
python_version = f"3.{minor_version}"
|
||||
env = os.environ.copy()
|
||||
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
|
||||
# regenerate the constraints files
|
||||
env["UV_CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
|
||||
output_file = resources / f"constraints-python{python_version.replace('.', '')}.txt"
|
||||
session.run(
|
||||
"uv",
|
||||
@@ -100,12 +103,19 @@ def update_constraints(session: nox.Session) -> None:
|
||||
pyodides = build_platforms["pyodide"]["python_configurations"]
|
||||
for pyodide in pyodides:
|
||||
python_version = ".".join(pyodide["version"].split(".")[:2])
|
||||
pyodide_build_version = pyodide["pyodide_build_version"]
|
||||
output_file = resources / f"constraints-pyodide{python_version.replace('.', '')}.txt"
|
||||
pyodide_version = pyodide["default_pyodide_version"]
|
||||
|
||||
tmp_file = Path(session.create_tmp()) / "constraints-pyodide.in"
|
||||
tmp_file.write_text(
|
||||
f"pip\nbuild[virtualenv]\npyodide-build=={pyodide_build_version}\nclick<8.2"
|
||||
|
||||
session.run(
|
||||
"python",
|
||||
"bin/generate_pyodide_constraints.py",
|
||||
"--output-file",
|
||||
tmp_file,
|
||||
pyodide_version,
|
||||
)
|
||||
|
||||
output_file = resources / f"constraints-pyodide{python_version.replace('.', '')}.txt"
|
||||
session.run(
|
||||
"uv",
|
||||
"pip",
|
||||
@@ -121,7 +131,8 @@ def update_constraints(session: nox.Session) -> None:
|
||||
@nox.session(default=False, tags=["update"])
|
||||
def update_pins(session: nox.Session) -> None:
|
||||
"""
|
||||
Update the python, docker and virtualenv pins version inplace.
|
||||
Update the python, docker, virtualenv, node, and python-build-standalone
|
||||
version pins inplace.
|
||||
"""
|
||||
pyproject = nox.project.load_toml()
|
||||
session.install("-e.", *nox.project.dependency_groups(pyproject, "bin"))
|
||||
@@ -129,6 +140,7 @@ def update_pins(session: nox.Session) -> None:
|
||||
session.run("python", "bin/update_docker.py")
|
||||
session.run("python", "bin/update_virtualenv.py", "--force")
|
||||
session.run("python", "bin/update_nodejs.py", "--force")
|
||||
session.run("python", "bin/update_python_build_standalone.py")
|
||||
|
||||
|
||||
@nox.session(default=False, reuse_venv=True, tags=["update"])
|
||||
@@ -161,7 +173,7 @@ def bump_version(session: nox.Session) -> None:
|
||||
session.install_and_run_script("bin/bump_version.py")
|
||||
|
||||
|
||||
@nox.session(default=False, python="3.12")
|
||||
@nox.session(default=False)
|
||||
def docs(session: nox.Session) -> None:
|
||||
"""
|
||||
Build the docs. Will serve unless --non-interactive
|
||||
|
||||
+15
-3
@@ -4,10 +4,11 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "cibuildwheel"
|
||||
version = "3.0.0b1"
|
||||
version = "3.0.0b5"
|
||||
description = "Build Python wheels on CI with minimal configuration."
|
||||
readme = "README.md"
|
||||
license = "BSD-2-Clause"
|
||||
license-files = ["LICENSE"]
|
||||
requires-python = ">=3.11"
|
||||
authors = [
|
||||
{ name = "Joe Rickerby", email = "joerick@mac.com" },
|
||||
@@ -25,7 +26,6 @@ keywords = [
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Natural Language :: English",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
@@ -76,6 +76,7 @@ docs = [
|
||||
"mkdocs-macros-plugin",
|
||||
"mkdocs==1.6.1",
|
||||
"pymdown-extensions",
|
||||
"rich",
|
||||
]
|
||||
test = [
|
||||
"build",
|
||||
@@ -101,7 +102,7 @@ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
|
||||
junit_family = "xunit2"
|
||||
xfail_strict = true
|
||||
filterwarnings = ["error"]
|
||||
log_cli_level = "info"
|
||||
log_cli_level = "INFO"
|
||||
markers = [
|
||||
"serial: tests that must *not* be run in parallel (deselect with '-m \"not serial\"')",
|
||||
]
|
||||
@@ -231,3 +232,14 @@ ignore = ["PC170", "PP303"]
|
||||
|
||||
[tool.check-wheel-contents]
|
||||
ignore = ["W002"] # constraints-*.txt are allowed to be duplicates of one another
|
||||
|
||||
[tool.codespell]
|
||||
ignore-words-list = [
|
||||
"sur",
|
||||
"assertin",
|
||||
]
|
||||
skip = [
|
||||
'^docs/working-examples\.md',
|
||||
'htmlcov',
|
||||
'all_known_setup.yaml',
|
||||
]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import textwrap
|
||||
|
||||
import packaging.utils
|
||||
import pytest
|
||||
|
||||
from cibuildwheel.logger import Logger
|
||||
@@ -37,7 +38,9 @@ def test(tmp_path, build_frontend_env, capfd):
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
actual_wheels_normalized = {packaging.utils.parse_wheel_filename(w) for w in actual_wheels}
|
||||
expected_wheels_normalized = {packaging.utils.parse_wheel_filename(w) for w in expected_wheels}
|
||||
assert actual_wheels_normalized == expected_wheels_normalized
|
||||
|
||||
enable_groups = utils.get_enable_groups()
|
||||
if EnableGroup.GraalPy not in enable_groups:
|
||||
|
||||
@@ -41,15 +41,20 @@ def test_abi3(tmp_path):
|
||||
add_env={
|
||||
# free_threaded, GraalPy, and PyPy do not have a Py_LIMITED_API equivalent, just build one of those
|
||||
# also limit the number of builds for test performance reasons
|
||||
"CIBW_BUILD": "cp39-* cp310-* pp310-* gp242-* cp312-* cp313t-*",
|
||||
"CIBW_BUILD": "cp39-* cp310-* pp310-* gp311_242-* cp312-* cp313t-*",
|
||||
"CIBW_ENABLE": "all",
|
||||
},
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
if utils.get_platform() == "pyodide":
|
||||
# there's only 1 possible configuration for pyodide, cp312
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0", python_abi_tags=["cp310-abi3"])
|
||||
# there's only 1 possible configuration for pyodide, cp312. It builds
|
||||
# a wheel that is tagged abi3, compatible back to 3.10
|
||||
expected_wheels = utils.expected_wheels(
|
||||
"spam",
|
||||
"0.1.0",
|
||||
python_abi_tags=["cp310-abi3"],
|
||||
)
|
||||
else:
|
||||
expected_wheels = utils.expected_wheels(
|
||||
"spam",
|
||||
@@ -182,22 +187,24 @@ def test_abi_none(tmp_path, capfd):
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} {{project}}/test",
|
||||
# limit the number of builds for test performance reasons
|
||||
"CIBW_BUILD": "cp38-* cp{}{}-* cp313t-* pp310-*".format(*utils.SINGLE_PYTHON_VERSION),
|
||||
"CIBW_ENABLE": "all",
|
||||
},
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = utils.expected_wheels("ctypesexample", "1.0.0", python_abi_tags=["py3-none"])
|
||||
# check that the expected wheels are produced
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
# check that each wheel was built once, and reused
|
||||
captured = capfd.readouterr()
|
||||
assert "Building wheel..." in captured.out
|
||||
|
||||
if utils.get_platform() == "pyodide":
|
||||
# there's only 1 possible configuration for pyodide, we won't see the message expected on following builds
|
||||
# pyodide builds a different platform tag for each python version, so
|
||||
# wheels are not reused
|
||||
assert "Found previously built wheel" not in captured.out
|
||||
else:
|
||||
# check that each wheel was built once, and reused
|
||||
assert "Building wheel..." in captured.out
|
||||
assert "Found previously built wheel" in captured.out
|
||||
|
||||
@@ -36,16 +36,19 @@ def test(tmp_path):
|
||||
with (project_dir / "text_info.txt").open(mode="w") as ff:
|
||||
print("dummy text", file=ff)
|
||||
|
||||
# build the wheels
|
||||
# write python version information to a temporary file, this is checked in
|
||||
# setup.py
|
||||
#
|
||||
# note, before_all runs in whatever the host environment is, `python`
|
||||
# might be any version of python (even Python 2 on Travis ci!), so this is
|
||||
# written to be broadly compatible
|
||||
before_all_command = (
|
||||
"""python -c "import os, pathlib, sys; pathlib.Path('{project}/text_info.txt').write_text('sample text '+os.environ.get('TEST_VAL', ''))" && """
|
||||
'''python -c "import pathlib, sys; pathlib.Path('{project}/python_prefix.txt').write_text(sys.prefix)"'''
|
||||
"""python -c "import os, sys; f = open('{project}/text_info.txt', 'w'); f.write('sample text '+os.environ.get('TEST_VAL', '')); f.close()" && """
|
||||
'''python -c "import sys; f = open('{project}/python_prefix.txt', 'w'); f.write(sys.prefix); f.close()"'''
|
||||
)
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
# write python version information to a temporary file, this is
|
||||
# checked in setup.py
|
||||
"CIBW_BEFORE_ALL": before_all_command,
|
||||
"CIBW_BEFORE_ALL_LINUX": f'{before_all_command} && python -c "import sys; assert sys.version_info >= (3, 8)"',
|
||||
"CIBW_ENVIRONMENT": "TEST_VAL='123'",
|
||||
|
||||
@@ -62,10 +62,10 @@ def test(tmp_path, build_frontend_env):
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
# the 'false ||' bit is to ensure this command runs in a shell on
|
||||
# mac/linux.
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} {{project}}/test",
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 is fixed
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "where graalpy || pytest ./test",
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "where graalpy || pytest {project}/test",
|
||||
**build_frontend_env,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -16,6 +16,11 @@ from pathlib import Path
|
||||
wheel = Path(sys.argv[1])
|
||||
dest_dir = Path(sys.argv[2])
|
||||
platform = wheel.stem.split("-")[-1]
|
||||
if platform.startswith("pyodide"):
|
||||
# for the sake of this test, munge the pyodide platforms into one, it's
|
||||
# not valid, but it does activate the uniqueness check
|
||||
platform = "pyodide"
|
||||
|
||||
name = f"spam-0.1.0-py2-none-{platform}.whl"
|
||||
dest = dest_dir / name
|
||||
dest_dir.mkdir(parents=True, exist_ok=True)
|
||||
@@ -48,11 +53,6 @@ def test(tmp_path, capfd):
|
||||
assert "Build failed because a wheel named" in captured.err
|
||||
assert exc_info.value.returncode == 6
|
||||
else:
|
||||
# We only produced one wheel (currently Pyodide)
|
||||
# We only produced one wheel (perhaps Pyodide)
|
||||
# check that it has the right name
|
||||
#
|
||||
# As far as I can tell, this is the only full test coverage for
|
||||
# CIBW_REPAIR_WHEEL_COMMAND so this is useful even in the case when no
|
||||
# error is raised
|
||||
assert "spam-0.1.0-py2-none-pyodide" in captured.out
|
||||
assert result[0].startswith("spam-0.1.0-py2-none-")
|
||||
|
||||
@@ -70,7 +70,10 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env_nouv):
|
||||
version_no_dot = python_version.replace(".", "")
|
||||
build_environment = {}
|
||||
build_pattern = f"[cp]p{version_no_dot}-*"
|
||||
constraint_filename = f"constraints-python{version_no_dot}.txt"
|
||||
if utils.get_platform() == "pyodide":
|
||||
constraint_filename = f"constraints-pyodide{version_no_dot}.txt"
|
||||
else:
|
||||
constraint_filename = f"constraints-python{version_no_dot}.txt"
|
||||
constraint_file = resources.PATH / constraint_filename
|
||||
constraint_versions = get_versions_from_constraint_file(constraint_file)
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import shutil
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from cibuildwheel.ci import CIProvider, detect_ci_provider
|
||||
from cibuildwheel.util.file import CIBW_CACHE_PATH
|
||||
|
||||
from . import test_projects, utils
|
||||
|
||||
basic_project = test_projects.new_c_project()
|
||||
basic_project.files["check_node.py"] = r"""
|
||||
import sys
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from pyodide.code import run_js
|
||||
|
||||
|
||||
def check_node():
|
||||
# cibuildwheel adds a pinned node version to the PATH
|
||||
# check it's in the PATH then, check it's the one that runs Pyodide
|
||||
cibw_cache_path = Path(sys.argv[1]).resolve(strict=True)
|
||||
# find the node executable in PATH
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "node is None"
|
||||
node_path = Path(node).resolve(strict=True)
|
||||
# it shall be in cibuildwheel cache
|
||||
assert cibw_cache_path in node_path.parents, f"{cibw_cache_path} not a parent of {node_path}"
|
||||
# find the path to the node executable that runs pyodide
|
||||
node_js = run_js("globalThis.process.execPath")
|
||||
assert node_js is not None, "node_js is None"
|
||||
node_js_path = Path(node_js).resolve(strict=True)
|
||||
# it shall be the one pinned by cibuildwheel
|
||||
assert node_js_path == node_path, f"{node_js_path} != {node_path}"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_node()
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("use_pyproject_toml", [True, False])
|
||||
def test_pyodide_build(tmp_path, use_pyproject_toml):
|
||||
if sys.platform == "win32":
|
||||
pytest.skip("emsdk doesn't work correctly on Windows")
|
||||
|
||||
if not shutil.which("python3.12"):
|
||||
pytest.skip("Python 3.12 not installed")
|
||||
|
||||
if detect_ci_provider() == CIProvider.travis_ci:
|
||||
pytest.skip("Python 3.12 is just a non-working pyenv shim")
|
||||
|
||||
if use_pyproject_toml:
|
||||
basic_project.files["pyproject.toml"] = textwrap.dedent(
|
||||
"""
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
"""
|
||||
)
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
# check for node in 1 case only to reduce CI load
|
||||
add_env = {}
|
||||
if use_pyproject_toml:
|
||||
add_env["CIBW_TEST_COMMAND"] = f"python {{project}}/check_node.py {CIBW_CACHE_PATH}"
|
||||
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_args=["--platform", "pyodide"],
|
||||
add_env=add_env,
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [
|
||||
"spam-0.1.0-cp312-cp312-pyodide_2024_0_wasm32.whl",
|
||||
]
|
||||
|
||||
print("actual_wheels", actual_wheels)
|
||||
print("expected_wheels", expected_wheels)
|
||||
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
@@ -32,7 +32,7 @@ def test(tmp_path, request):
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "pytest ./test",
|
||||
"CIBW_TEST_COMMAND": "pytest {project}/test",
|
||||
"CIBW_ARCHS": archs,
|
||||
# TODO remove me once proper support is added
|
||||
"CIBW_MANYLINUX_RISCV64_IMAGE": "ghcr.io/mayeut/manylinux_2_35:2025.05.11-1",
|
||||
|
||||
@@ -100,7 +100,12 @@ def test_overridden_path(tmp_path, capfd):
|
||||
"build_frontend",
|
||||
[
|
||||
pytest.param("pip", marks=utils.skip_if_pyodide("No pip for pyodide")),
|
||||
"build",
|
||||
pytest.param(
|
||||
"build",
|
||||
marks=utils.skip_if_pyodide(
|
||||
"pyodide doesn't support multiple values for PIP_CONSTRAINT"
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_overridden_pip_constraint(tmp_path, build_frontend):
|
||||
|
||||
+94
-32
@@ -8,6 +8,8 @@ import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from cibuildwheel.ci import CIProvider, detect_ci_provider
|
||||
|
||||
from . import test_projects, utils
|
||||
|
||||
basic_project_files = {
|
||||
@@ -23,6 +25,19 @@ class TestPlatform(TestCase):
|
||||
}
|
||||
|
||||
|
||||
def skip_if_ios_testing_not_supported() -> None:
|
||||
"""Skip the test if iOS testing is not supported on this machine."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
if detect_ci_provider() == CIProvider.cirrus_ci:
|
||||
pytest.skip(
|
||||
"iOS testing not currently supported on Cirrus CI due to a failure "
|
||||
"to start the simulator."
|
||||
)
|
||||
|
||||
|
||||
# iOS tests shouldn't be run in parallel, because they're dependent on calling
|
||||
# Xcode, and starting a simulator. These are both multi-threaded operations, and
|
||||
# it's easy to overload the CI machine if there are multiple test processes
|
||||
@@ -39,10 +54,7 @@ class TestPlatform(TestCase):
|
||||
],
|
||||
)
|
||||
def test_ios_platforms(tmp_path, build_config, monkeypatch, capfd):
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
# Create a temporary "bin" directory, symlink a tool that we know eixsts
|
||||
# (/usr/bin/true) into that location under a name that should be unique,
|
||||
@@ -74,7 +86,7 @@ def test_ios_platforms(tmp_path, build_config, monkeypatch, capfd):
|
||||
"CIBW_BUILD": "cp313-*",
|
||||
"CIBW_XBUILD_TOOLS": "does-exist",
|
||||
"CIBW_TEST_SOURCES": "tests",
|
||||
"CIBW_TEST_COMMAND": "python -m unittest discover tests test_platform.py",
|
||||
"CIBW_TEST_COMMAND": "python -m this && python -m unittest discover tests test_platform.py",
|
||||
"CIBW_BUILD_VERBOSITY": "1",
|
||||
**build_config,
|
||||
},
|
||||
@@ -90,13 +102,14 @@ def test_ios_platforms(tmp_path, build_config, monkeypatch, capfd):
|
||||
captured = capfd.readouterr()
|
||||
assert "'does-exist' will be included in the cross-build environment" in captured.out
|
||||
|
||||
# Make sure the first command ran
|
||||
assert "Zen of Python" in captured.out
|
||||
|
||||
|
||||
@pytest.mark.serial
|
||||
def test_no_test_sources(tmp_path, capfd):
|
||||
"""Build will fail if test-sources isn't defined."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
"""Build will provide a helpful error if pytest is run and test-sources is not defined."""
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
@@ -109,21 +122,82 @@ def test_no_test_sources(tmp_path, capfd):
|
||||
add_env={
|
||||
"CIBW_PLATFORM": "ios",
|
||||
"CIBW_BUILD": "cp313-*",
|
||||
"CIBW_TEST_COMMAND": "python -m tests",
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "python -m pytest",
|
||||
"CIBW_XBUILD_TOOLS": "",
|
||||
},
|
||||
)
|
||||
|
||||
# The error message indicates the configuration issue.
|
||||
captured = capfd.readouterr()
|
||||
assert "Testing on iOS requires a definition of test-sources." in captured.err
|
||||
assert (
|
||||
"you must copy your test files to the testbed app by setting the `test-sources` option"
|
||||
in captured.out + captured.err
|
||||
)
|
||||
|
||||
|
||||
def test_ios_testing_with_placeholder(tmp_path, capfd):
|
||||
"""
|
||||
Tests with the {project} placeholder are not supported on iOS, because the test command
|
||||
is run in the simulator.
|
||||
"""
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
basic_project.files.update(basic_project_files)
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
with pytest.raises(subprocess.CalledProcessError):
|
||||
utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_PLATFORM": "ios",
|
||||
"CIBW_BUILD": "cp313-*",
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "pytest {project}/tests",
|
||||
"CIBW_XBUILD_TOOLS": "",
|
||||
},
|
||||
)
|
||||
|
||||
# The error message indicates the configuration issue.
|
||||
captured = capfd.readouterr()
|
||||
assert "iOS tests cannot use placeholders" in captured.out + captured.err
|
||||
|
||||
|
||||
@pytest.mark.serial
|
||||
def test_ios_test_command_short_circuit(tmp_path, capfd):
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
basic_project.files.update(basic_project_files)
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
with pytest.raises(subprocess.CalledProcessError):
|
||||
# `python -m not_a_module` will fail, so `python -m this` should not be run.
|
||||
utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_PLATFORM": "ios",
|
||||
"CIBW_BUILD": "cp313-*",
|
||||
"CIBW_XBUILD_TOOLS": "",
|
||||
"CIBW_TEST_SOURCES": "tests",
|
||||
"CIBW_TEST_COMMAND": "python -m not_a_module && python -m this",
|
||||
"CIBW_BUILD_VERBOSITY": "1",
|
||||
},
|
||||
)
|
||||
|
||||
captured = capfd.readouterr()
|
||||
|
||||
assert "No module named not_a_module" in captured.out + captured.err
|
||||
# assert that `python -m this` was not run
|
||||
assert "Zen of Python" not in captured.out + captured.err
|
||||
|
||||
|
||||
def test_missing_xbuild_tool(tmp_path, capfd):
|
||||
"""Build will fail if xbuild-tools references a non-existent tool."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
@@ -148,10 +222,7 @@ def test_missing_xbuild_tool(tmp_path, capfd):
|
||||
|
||||
def test_no_xbuild_tool_definition(tmp_path, capfd):
|
||||
"""Build will succeed with a warning if there is no xbuild-tools definition."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
@@ -185,10 +256,7 @@ def test_no_xbuild_tool_definition(tmp_path, capfd):
|
||||
|
||||
def test_empty_xbuild_tool_definition(tmp_path, capfd):
|
||||
"""Build will succeed with no warning if there is an empty xbuild-tools definition."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
@@ -220,10 +288,7 @@ def test_empty_xbuild_tool_definition(tmp_path, capfd):
|
||||
@pytest.mark.serial
|
||||
def test_ios_test_command_without_python_dash_m(tmp_path, capfd):
|
||||
"""pytest should be able to run without python -m, but it should warn."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
|
||||
@@ -261,10 +326,7 @@ def test_ios_test_command_without_python_dash_m(tmp_path, capfd):
|
||||
|
||||
def test_ios_test_command_invalid(tmp_path, capfd):
|
||||
"""Test command should raise an error if it's clearly invalid."""
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test can only run on macOS")
|
||||
if utils.get_xcode_version() < (13, 0):
|
||||
pytest.skip("this test only works with Xcode 13.0 or greater")
|
||||
skip_if_ios_testing_not_supported()
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project = test_projects.new_c_project()
|
||||
|
||||
@@ -42,11 +42,9 @@ def test_cross_compiled_build(tmp_path):
|
||||
@pytest.mark.parametrize(
|
||||
"test_config",
|
||||
[
|
||||
# Run the test suite in the project folder
|
||||
{
|
||||
"CIBW_TEST_COMMAND": '''python -c "import platform; print('running tests on ' + platform.machine())"''',
|
||||
},
|
||||
# Nominate the set of test sources to copy
|
||||
{
|
||||
"CIBW_TEST_COMMAND": "python tests/test_suite.py",
|
||||
"CIBW_TEST_SOURCES": "tests",
|
||||
|
||||
@@ -95,7 +95,7 @@ def test(manylinux_image, tmp_path):
|
||||
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
|
||||
|
||||
platform_tag_map = {
|
||||
"manylinux2014": ["manylinux_2_17", "manylinux2014"],
|
||||
"manylinux2014": ["manylinux2014", "manylinux_2_17"],
|
||||
}
|
||||
expected_wheels = utils.expected_wheels(
|
||||
"spam",
|
||||
|
||||
+10
-3
@@ -60,12 +60,19 @@ def test_pep518(tmp_path, build_frontend_env):
|
||||
assert not (project_dir / "42").exists()
|
||||
assert not (project_dir / "4.1.2").exists()
|
||||
|
||||
# pypa/build creates a "build" folder & a "*.egg-info" folder for the wheel being built,
|
||||
# this should be harmless so remove them
|
||||
# pypa/build creates a "build" folder & a "*.egg-info" folder for the
|
||||
# wheel being built, this should be harmless so remove them. pyodide-build
|
||||
# creates a ".pyodide_build" folder, but this is gitignored with a
|
||||
# .gitignore file inside.
|
||||
contents = [
|
||||
item
|
||||
for item in project_dir.iterdir()
|
||||
if item.name != "build" and not item.name.endswith(".egg-info")
|
||||
if item.name != "build"
|
||||
and not item.name.endswith(".egg-info")
|
||||
and item.name != ".pyodide_build"
|
||||
]
|
||||
|
||||
print("Project contents after build:")
|
||||
print("\n".join(f" {f}" for f in contents))
|
||||
|
||||
assert len(contents) == len(basic_project.files)
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
import contextlib
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
|
||||
from cibuildwheel.util.file import CIBW_CACHE_PATH
|
||||
|
||||
from . import test_projects, utils
|
||||
|
||||
basic_project = test_projects.new_c_project()
|
||||
basic_project.files["check_node.py"] = r"""
|
||||
import sys
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from pyodide.code import run_js
|
||||
|
||||
|
||||
def check_node():
|
||||
# cibuildwheel adds a pinned node version to the PATH
|
||||
# check it's in the PATH then, check it's the one that runs Pyodide
|
||||
cibw_cache_path = Path(sys.argv[1]).resolve(strict=True)
|
||||
# find the node executable in PATH
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "node is None"
|
||||
node_path = Path(node).resolve(strict=True)
|
||||
# it shall be in cibuildwheel cache
|
||||
assert cibw_cache_path in node_path.parents, f"{cibw_cache_path} not a parent of {node_path}"
|
||||
# find the path to the node executable that runs pyodide
|
||||
node_js = run_js("globalThis.process.execPath")
|
||||
assert node_js is not None, "node_js is None"
|
||||
node_js_path = Path(node_js).resolve(strict=True)
|
||||
# it shall be the one pinned by cibuildwheel
|
||||
assert node_js_path == node_path, f"{node_js_path} != {node_path}"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_node()
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("use_pyproject_toml", [True, False])
|
||||
def test_pyodide_build(tmp_path, use_pyproject_toml):
|
||||
if sys.platform == "win32":
|
||||
pytest.skip("pyodide-build doesn't work correctly on Windows")
|
||||
|
||||
if use_pyproject_toml:
|
||||
basic_project.files["pyproject.toml"] = textwrap.dedent(
|
||||
"""
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
"""
|
||||
)
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
# check for node in 1 case only to reduce CI load
|
||||
add_env = {"CIBW_ENABLE": "pyodide-prerelease"}
|
||||
if use_pyproject_toml:
|
||||
add_env["CIBW_TEST_COMMAND"] = f"python {{project}}/check_node.py {CIBW_CACHE_PATH}"
|
||||
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_args=["--platform", "pyodide"],
|
||||
add_env=add_env,
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [
|
||||
"spam-0.1.0-cp312-cp312-pyodide_2024_0_wasm32.whl",
|
||||
"spam-0.1.0-cp313-cp313-pyodide_2025_0_wasm32.whl",
|
||||
]
|
||||
|
||||
print("actual_wheels", actual_wheels)
|
||||
print("expected_wheels", expected_wheels)
|
||||
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
def test_pyodide_version_incompatible(tmp_path, capfd):
|
||||
if sys.platform == "win32":
|
||||
pytest.skip("pyodide-build doesn't work correctly on Windows")
|
||||
|
||||
basic_project.generate(tmp_path)
|
||||
|
||||
with pytest.raises(subprocess.CalledProcessError):
|
||||
utils.cibuildwheel_run(
|
||||
tmp_path,
|
||||
add_args=["--platform", "pyodide"],
|
||||
add_env={
|
||||
"CIBW_DEPENDENCY_VERSIONS": "packages: pyodide-build==0.29.3",
|
||||
"CIBW_PYODIDE_VERSION": "0.26.0a6",
|
||||
},
|
||||
)
|
||||
|
||||
out, err = capfd.readouterr()
|
||||
|
||||
assert "is not compatible with the pyodide-build version" in err
|
||||
|
||||
|
||||
@pytest.mark.parametrize("expect_failure", [True, False])
|
||||
def test_pyodide_build_and_test(tmp_path, expect_failure):
|
||||
if sys.platform == "win32":
|
||||
pytest.skip("pyodide-build doesn't work correctly on Windows")
|
||||
|
||||
if expect_failure:
|
||||
basic_project.files["test/spam_test.py"] = textwrap.dedent(r"""
|
||||
def test_filter():
|
||||
assert 0 == 1
|
||||
""")
|
||||
else:
|
||||
basic_project.files["test/spam_test.py"] = textwrap.dedent(r"""
|
||||
import spam
|
||||
def test_filter():
|
||||
assert spam.filter("spam") == 0
|
||||
""")
|
||||
basic_project.generate(tmp_path)
|
||||
|
||||
context = (
|
||||
pytest.raises(subprocess.CalledProcessError) if expect_failure else contextlib.nullcontext()
|
||||
)
|
||||
with context:
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
tmp_path,
|
||||
add_args=["--platform", "pyodide"],
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "python -m pytest {project}",
|
||||
"CIBW_ENABLE": "pyodide-prerelease",
|
||||
},
|
||||
)
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [
|
||||
"spam-0.1.0-cp312-cp312-pyodide_2024_0_wasm32.whl",
|
||||
"spam-0.1.0-cp313-cp313-pyodide_2025_0_wasm32.whl",
|
||||
]
|
||||
print("actual_wheels", actual_wheels)
|
||||
print("expected_wheels", expected_wheels)
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
+2
-2
@@ -10,9 +10,9 @@ project_with_ssl_tests = test_projects.new_c_project(
|
||||
from urllib.request import urlopen
|
||||
|
||||
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
||||
# badssl.com is a HTTPS test server that can be used to test SSL connections
|
||||
data = urlopen("https://tls-v1-2.badssl.com", context=context)
|
||||
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/CI.md", context=context)
|
||||
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/CI.md")
|
||||
data = urlopen("https://tls-v1-2.badssl.com")
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
+54
-26
@@ -80,10 +80,10 @@ def test(tmp_path):
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
# the 'false ||' bit is to ensure this command runs in a shell on
|
||||
# mac/linux.
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} {{project}}/test",
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 is fixed
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest {project}/test",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -103,10 +103,10 @@ def test_extras_require(tmp_path):
|
||||
"CIBW_TEST_EXTRAS": "test",
|
||||
# the 'false ||' bit is to ensure this command runs in a shell on
|
||||
# mac/linux.
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} {{project}}/test",
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 is fixed
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest {project}/test",
|
||||
},
|
||||
single_python=True,
|
||||
)
|
||||
@@ -137,10 +137,10 @@ def test_dependency_groups(tmp_path):
|
||||
"CIBW_TEST_GROUPS": "dev",
|
||||
# the 'false ||' bit is to ensure this command runs in a shell on
|
||||
# mac/linux.
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} {{project}}/test",
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 is fixed
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest {project}/test",
|
||||
},
|
||||
single_python=True,
|
||||
)
|
||||
@@ -172,7 +172,7 @@ def test_failing_test(tmp_path):
|
||||
output_dir=output_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} ./test",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} {{project}}/test",
|
||||
# CPython 3.8 when running on macOS arm64 is unusual. The build
|
||||
# always runs in x86_64, so the arm64 tests are not run. See
|
||||
# #1169 for reasons why. That means the build succeeds, which
|
||||
@@ -185,29 +185,41 @@ def test_failing_test(tmp_path):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("test_runner", ["pytest", "unittest"])
|
||||
def test_bare_pytest_invocation(tmp_path: Path, test_runner: str) -> None:
|
||||
"""Check that if a user runs a bare test suite, it runs in the project folder"""
|
||||
def test_bare_pytest_invocation(
|
||||
tmp_path: Path, capfd: pytest.CaptureFixture[str], test_runner: str
|
||||
) -> None:
|
||||
"""
|
||||
Check that if a user runs pytest in the the test cwd without setting
|
||||
test-sources, it raises a helpful error
|
||||
"""
|
||||
project_dir = tmp_path / "project"
|
||||
project_with_a_test.generate(project_dir)
|
||||
output_dir = tmp_path / "output"
|
||||
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest" if test_runner == "pytest" else "",
|
||||
"CIBW_TEST_COMMAND": (
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 fixed
|
||||
"graalpy.exe -c 1 || python -m pytest"
|
||||
if test_runner == "pytest"
|
||||
else "python -m unittest discover test spam_test.py"
|
||||
),
|
||||
},
|
||||
with pytest.raises(subprocess.CalledProcessError):
|
||||
utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
output_dir=output_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest" if test_runner == "pytest" else "",
|
||||
"CIBW_TEST_COMMAND": (
|
||||
"python -m pytest" if test_runner == "pytest" else "python -m unittest"
|
||||
),
|
||||
# Skip CPython 3.8 on macOS arm64, see comment above in
|
||||
# 'test_failing_test'
|
||||
"CIBW_SKIP": "cp38-macosx_arm64",
|
||||
},
|
||||
)
|
||||
|
||||
assert len(list(output_dir.iterdir())) == 0
|
||||
|
||||
captured = capfd.readouterr()
|
||||
|
||||
assert (
|
||||
"Please specify a path to your tests when invoking pytest using the {project} placeholder"
|
||||
in captured.out + captured.err
|
||||
)
|
||||
|
||||
# check that we got the right wheels
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
def test_test_sources(tmp_path):
|
||||
project_dir = tmp_path / "project"
|
||||
@@ -218,10 +230,10 @@ def test_test_sources(tmp_path):
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "pytest",
|
||||
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
|
||||
# until https://github.com/oracle/graalpython/issues/490 is fixed
|
||||
"CIBW_TEST_COMMAND_WINDOWS": "where graalpy || pytest",
|
||||
"CIBW_TEST_COMMAND": utils.invoke_pytest(),
|
||||
"CIBW_TEST_SOURCES": "test",
|
||||
},
|
||||
)
|
||||
@@ -229,3 +241,19 @@ def test_test_sources(tmp_path):
|
||||
# also check that we got the right wheels
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
def test_test_environment(tmp_path):
|
||||
project_dir = tmp_path / "project"
|
||||
test_projects.new_c_project().generate(project_dir)
|
||||
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_ENVIRONMENT": "MYVAR=somevalue PYTHONSAFEPATH=1",
|
||||
"CIBW_TEST_COMMAND": "python -c \"import os; assert os.environ.get('MYVAR') == 'somevalue'; assert os.environ.get('PYTHONSAFEPATH') == '1'\"",
|
||||
},
|
||||
)
|
||||
# also check that we got the right wheels
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
+16
-6
@@ -250,17 +250,19 @@ def _expected_wheels(
|
||||
|
||||
if manylinux_versions is None:
|
||||
manylinux_versions = {
|
||||
"armv7l": ["manylinux_2_17", "manylinux2014", "manylinux_2_31"],
|
||||
"i686": ["manylinux_2_5", "manylinux1", "manylinux_2_17", "manylinux2014"],
|
||||
"x86_64": ["manylinux_2_5", "manylinux1", "manylinux_2_28"],
|
||||
"armv7l": ["manylinux2014", "manylinux_2_17", "manylinux_2_31"],
|
||||
"i686": ["manylinux1", "manylinux2014", "manylinux_2_17", "manylinux_2_5"],
|
||||
"x86_64": ["manylinux1", "manylinux_2_28", "manylinux_2_5"],
|
||||
"riscv64": ["manylinux_2_31", "manylinux_2_35"],
|
||||
}.get(machine_arch, ["manylinux_2_17", "manylinux2014", "manylinux_2_28"])
|
||||
}.get(machine_arch, ["manylinux2014", "manylinux_2_17", "manylinux_2_28"])
|
||||
|
||||
if musllinux_versions is None:
|
||||
musllinux_versions = ["musllinux_1_2"]
|
||||
|
||||
if platform == "pyodide" and python_abi_tags is None:
|
||||
python_abi_tags = ["cp312-cp312"]
|
||||
if EnableGroup.PyodidePrerelease in enable_groups:
|
||||
python_abi_tags.append("cp313-cp313")
|
||||
elif platform == "ios" and python_abi_tags is None:
|
||||
python_abi_tags = ["cp313-cp313"]
|
||||
elif python_abi_tags is None:
|
||||
@@ -382,7 +384,15 @@ def _expected_wheels(
|
||||
raise Exception(msg)
|
||||
|
||||
elif platform == "pyodide":
|
||||
platform_tags = ["pyodide_2024_0_wasm32"]
|
||||
platform_tags = {
|
||||
"cp312-cp312": ["pyodide_2024_0_wasm32"],
|
||||
"cp313-cp313": ["pyodide_2025_0_wasm32"],
|
||||
}.get(python_abi_tag, [])
|
||||
|
||||
if not platform_tags:
|
||||
# for example if the python tag is `none` or `abi3`, all
|
||||
# platform tags are built with that python tag
|
||||
platform_tags = ["pyodide_2024_0_wasm32"]
|
||||
|
||||
else:
|
||||
msg = f"Unsupported platform {platform!r}"
|
||||
@@ -425,7 +435,7 @@ def skip_if_pyodide(reason: str) -> Any:
|
||||
|
||||
def invoke_pytest() -> str:
|
||||
# see https://github.com/pyodide/pyodide/issues/4802
|
||||
if get_platform() == "pyodide" and sys.platform.startswith("darwin"):
|
||||
if get_platform() == "pyodide":
|
||||
return "python -m pytest"
|
||||
return "pytest"
|
||||
|
||||
|
||||
@@ -89,6 +89,26 @@ def test_build_filter_pypy_all():
|
||||
assert build_selector("pp39-manylinux_x86_64")
|
||||
|
||||
|
||||
def test_build_filter_pyodide_prerelease():
|
||||
build_selector = BuildSelector(
|
||||
build_config="*",
|
||||
skip_config="",
|
||||
enable=frozenset([EnableGroup.PyodidePrerelease]),
|
||||
)
|
||||
assert build_selector("cp312-pyodide_wasm32")
|
||||
assert build_selector("cp313-pyodide_wasm32")
|
||||
|
||||
|
||||
def test_build_filter_pyodide():
|
||||
build_selector = BuildSelector(
|
||||
build_config="*",
|
||||
skip_config="",
|
||||
enable=frozenset(),
|
||||
)
|
||||
assert build_selector("cp312-pyodide_wasm32")
|
||||
assert not build_selector("cp313-pyodide_wasm32")
|
||||
|
||||
|
||||
def test_skip():
|
||||
build_selector = BuildSelector(
|
||||
build_config="*",
|
||||
@@ -152,7 +172,7 @@ def test_build_limited_python():
|
||||
build_config="*",
|
||||
skip_config="",
|
||||
requires_python=SpecifierSet(">=3.7"),
|
||||
enable=frozenset([EnableGroup.PyPy, EnableGroup.PyPyEoL]),
|
||||
enable=frozenset([EnableGroup.PyPy, EnableGroup.PyPyEoL, EnableGroup.GraalPy]),
|
||||
)
|
||||
|
||||
assert not build_selector("cp36-manylinux_x86_64")
|
||||
@@ -165,6 +185,7 @@ def test_build_limited_python():
|
||||
assert build_selector("cp37-win32")
|
||||
assert build_selector("cp38-win32")
|
||||
assert build_selector("pp37-win_amd64")
|
||||
assert build_selector("gp311_242-win_amd64")
|
||||
|
||||
|
||||
def test_build_limited_python_partial():
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from cibuildwheel.util.file import download
|
||||
|
||||
DOWNLOAD_URL = "https://raw.githubusercontent.com/pypa/cibuildwheel/v1.6.3/requirements-dev.txt"
|
||||
DOWNLOAD_URL = "https://cdn.jsdelivr.net/gh/pypa/cibuildwheel@v1.6.3/requirements-dev.txt"
|
||||
|
||||
|
||||
def test_download(monkeypatch, tmp_path):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import contextlib
|
||||
import sys
|
||||
from collections.abc import Generator
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
import setuptools._distutils.util
|
||||
@@ -10,23 +12,27 @@ from cibuildwheel.errors import FatalError
|
||||
from cibuildwheel.platforms.windows import PythonConfiguration, setup_setuptools_cross_compile
|
||||
|
||||
# monkeypatching os.name is too flaky. E.g. It works on my machine, but fails in pipeline
|
||||
if not sys.platform.startswith("win"):
|
||||
if not sys.platform.startswith("win") and not TYPE_CHECKING:
|
||||
pytest.skip("Windows-only tests", allow_module_level=True)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def patched_environment(monkeypatch: pytest.MonkeyPatch, environment: dict[str, str]):
|
||||
def patched_environment(
|
||||
monkeypatch: pytest.MonkeyPatch, environment: dict[str, str]
|
||||
) -> Generator[None, None, None]:
|
||||
with monkeypatch.context() as mp:
|
||||
for envvar, val in environment.items():
|
||||
mp.setenv(name=envvar, value=val)
|
||||
yield
|
||||
|
||||
|
||||
def test_x86(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_x86(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
arch = "32"
|
||||
environment: dict[str, str] = {}
|
||||
|
||||
configuration = PythonConfiguration("irrelevant", arch, "irrelevant", None)
|
||||
configuration = PythonConfiguration(
|
||||
version="irrelevant", arch=arch, identifier="irrelevant", url=None
|
||||
)
|
||||
|
||||
setup_setuptools_cross_compile(tmp_path, configuration, tmp_path, environment)
|
||||
with patched_environment(monkeypatch, environment):
|
||||
@@ -36,11 +42,13 @@ def test_x86(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
assert target_platform == "win32"
|
||||
|
||||
|
||||
def test_x64(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_x64(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
arch = "64"
|
||||
environment: dict[str, str] = {}
|
||||
|
||||
configuration = PythonConfiguration("irrelevant", arch, "irrelevant", None)
|
||||
configuration = PythonConfiguration(
|
||||
version="irrelevant", arch=arch, identifier="irrelevant", url=None
|
||||
)
|
||||
|
||||
setup_setuptools_cross_compile(tmp_path, configuration, tmp_path, environment)
|
||||
with patched_environment(monkeypatch, environment):
|
||||
@@ -53,11 +61,13 @@ def test_x64(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
@pytest.mark.skipif(
|
||||
detect_ci_provider() == CIProvider.azure_pipelines, reason="arm64 not recognised on azure"
|
||||
)
|
||||
def test_arm(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_arm(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
arch = "ARM64"
|
||||
environment: dict[str, str] = {}
|
||||
|
||||
configuration = PythonConfiguration("irrelevant", arch, "irrelevant", None)
|
||||
configuration = PythonConfiguration(
|
||||
version="irrelevant", arch=arch, identifier="irrelevant", url=None
|
||||
)
|
||||
|
||||
setup_setuptools_cross_compile(tmp_path, configuration, tmp_path, environment)
|
||||
with patched_environment(monkeypatch, environment):
|
||||
@@ -67,21 +77,25 @@ def test_arm(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
assert target_platform == "win-arm64"
|
||||
|
||||
|
||||
def test_env_set(tmp_path: Path):
|
||||
def test_env_set(tmp_path: Path) -> None:
|
||||
arch = "32"
|
||||
environment = {"VSCMD_ARG_TGT_ARCH": "x64"}
|
||||
|
||||
configuration = PythonConfiguration("irrelevant", arch, "irrelevant", None)
|
||||
configuration = PythonConfiguration(
|
||||
version="irrelevant", arch=arch, identifier="irrelevant", url=None
|
||||
)
|
||||
|
||||
with pytest.raises(FatalError, match="VSCMD_ARG_TGT_ARCH"):
|
||||
setup_setuptools_cross_compile(tmp_path, configuration, tmp_path, environment)
|
||||
|
||||
|
||||
def test_env_blank(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_env_blank(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
arch = "32"
|
||||
environment = {"VSCMD_ARG_TGT_ARCH": ""}
|
||||
|
||||
configuration = PythonConfiguration("irrelevant", arch, "irrelevant", None)
|
||||
configuration = PythonConfiguration(
|
||||
version="irrelevant", arch=arch, identifier="irrelevant", url=None
|
||||
)
|
||||
|
||||
setup_setuptools_cross_compile(tmp_path, configuration, tmp_path, environment)
|
||||
with patched_environment(monkeypatch, environment):
|
||||
|
||||
@@ -239,16 +239,23 @@ def test_binary_output(container_engine):
|
||||
assert output == binary_data_string
|
||||
|
||||
|
||||
def test_file_operation(tmp_path: Path, container_engine: OCIContainerEngineConfig) -> None:
|
||||
@pytest.mark.parametrize(
|
||||
"file_path",
|
||||
["test.dat", "path/to/test.dat"],
|
||||
)
|
||||
def test_file_operation(
|
||||
tmp_path: Path, container_engine: OCIContainerEngineConfig, file_path: str
|
||||
) -> None:
|
||||
with OCIContainer(
|
||||
engine=container_engine, image=DEFAULT_IMAGE, oci_platform=DEFAULT_OCI_PLATFORM
|
||||
) as container:
|
||||
# test copying a file in
|
||||
test_binary_data = bytes(random.randrange(256) for _ in range(1000))
|
||||
original_test_file = tmp_path / "test.dat"
|
||||
original_test_file = tmp_path / file_path
|
||||
original_test_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
original_test_file.write_bytes(test_binary_data)
|
||||
|
||||
dst_file = PurePath("/tmp/test.dat")
|
||||
dst_file = PurePath("/tmp") / file_path
|
||||
|
||||
container.copy_into(original_test_file, dst_file)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ from cibuildwheel.oci_container import OCIPlatform
|
||||
from cibuildwheel.util import file
|
||||
|
||||
DEFAULT_IDS = {"cp38", "cp39", "cp310", "cp311", "cp312", "cp313"}
|
||||
ALL_IDS = DEFAULT_IDS | {"cp313t", "pp38", "pp39", "pp310", "pp311", "gp242"}
|
||||
ALL_IDS = DEFAULT_IDS | {"cp313t", "pp38", "pp39", "pp310", "pp311", "gp311_242"}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -157,7 +157,7 @@ before-all = "true"
|
||||
"pp39",
|
||||
"pp310",
|
||||
"pp311",
|
||||
"gp242",
|
||||
"gp311_242",
|
||||
}
|
||||
}
|
||||
assert kwargs["options"].build_options("cp39-manylinux_x86_64").before_all == ""
|
||||
@@ -179,7 +179,7 @@ before-all = "true"
|
||||
"pp39",
|
||||
"pp310",
|
||||
"pp311",
|
||||
"gp242",
|
||||
"gp311_242",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ manylinux-x86_64-image = "manylinux_2_28"
|
||||
|
||||
environment-pass = ["EXAMPLE_ENV"]
|
||||
|
||||
pyodide-version = "0.27.6"
|
||||
|
||||
[tool.cibuildwheel.macos]
|
||||
test-requires = "else"
|
||||
|
||||
@@ -88,6 +90,9 @@ def test_options_1(tmp_path, monkeypatch):
|
||||
assert local.test_sources == ["test", "other dir"]
|
||||
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux_2_34"]
|
||||
|
||||
local = options.build_options("cp312-pyodide_wasm32")
|
||||
assert local.pyodide_version == "0.27.6"
|
||||
|
||||
|
||||
def test_passthrough(tmp_path, monkeypatch):
|
||||
with tmp_path.joinpath("pyproject.toml").open("w") as f:
|
||||
|
||||
@@ -12,6 +12,8 @@ from cibuildwheel.util.helpers import (
|
||||
format_safe,
|
||||
parse_key_value_string,
|
||||
prepare_command,
|
||||
unwrap,
|
||||
unwrap_preserving_paragraphs,
|
||||
)
|
||||
from cibuildwheel.util.packaging import find_compatible_wheel
|
||||
|
||||
@@ -363,3 +365,33 @@ def test_copy_test_sources_alternate_copy_into(sample_project):
|
||||
],
|
||||
any_order=True,
|
||||
)
|
||||
|
||||
|
||||
def test_unwrap():
|
||||
assert (
|
||||
unwrap("""
|
||||
This is a
|
||||
multiline
|
||||
string
|
||||
""")
|
||||
== "This is a multiline string"
|
||||
)
|
||||
|
||||
|
||||
def test_unwrap_preserving_paragraphs():
|
||||
assert (
|
||||
unwrap("""
|
||||
This is a
|
||||
multiline
|
||||
string
|
||||
""")
|
||||
== "This is a multiline string"
|
||||
)
|
||||
assert (
|
||||
unwrap_preserving_paragraphs("""
|
||||
paragraph one
|
||||
|
||||
paragraph two
|
||||
""")
|
||||
== "paragraph one\n\nparagraph two"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user