Compare commits

..
92 Commits
Author SHA1 Message Date
Joe Rickerby 225387a9d5 Bump version: v2.10.1 2022-09-18 12:57:10 +01:00
Joe Rickerby ad172699f1 Merge pull request #1273 from pypa/toml-environment-quoting 2022-09-18 10:20:09 +03:00
Joe Rickerby 5dcb363679 Fix typing-extensions requirement 2022-09-17 11:29:39 +01:00
Joe Rickerby 13fc768552 Revert to the previous quoting behaviour for environment option 2022-09-17 11:15:00 +01:00
Joe Rickerby 7b43ed453f Add failing test 2022-09-17 09:58:19 +01:00
Henry Schreiner 00b2600cca chore: cleanup types (#1263)
chore: fix typing Final usage for PyLance

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-09-16 11:05:05 -04:00
Joe Rickerby 6181943e32 Increase Cirrus CI timeout (#1267)
Gives us a little more flex for the Cirrus build. I've set these to the maximum because we already use pytest-timeout to catch stalled tests, so there's little need to be conservative. MacOS ARM and aarch64 linux are currently running at 5 and 20 minutes respectively, so no need to increase their limits.

See https://github.com/pypa/cibuildwheel/runs/8321188914 for an example timeout on Linux x86
2022-09-13 22:58:09 +02:00
Joe Rickerby 67a7175578 Bump version: v2.10.0 2022-09-13 12:26:31 +03:00
cibuildwheel-bot[bot]andcibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com> 53aa7f7a4f [Bot] Update dependencies (#1265)
Update dependencies

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
2022-09-13 01:45:10 -04:00
Henry Schreiner 01504b889c docs: only macOS platforms support macOS ARM (#1264)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-09-09 12:02:22 -04:00
Henry SchreinerandJoe Rickerby eb39da0b10 feat: add --only (#1098)
* fix(style): use sub recommended replacement method

See https://docs.python.org/3/library/re.html#re.escape

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* feat: add --build

* refactor: switch to using --only

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: cover --only

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: undo change to --plat for auditwheel

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* (unrelated) speed up running the unit tests

based on a profile run, this speeds up the unit tests by 3x

* Remove `intercepted_build_args` reliance on `platform` fixture

* Add test that checks if 'only' overrides env var options

* Ensure that the --only command line option overrides env vars

* Fix UnboundLocalError

* Test cleanups

* style: typing.cast instead of plain cast

* feat: add only: to the GHA

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
2022-09-09 08:34:47 -04:00
cibuildwheel-bot[bot]andcibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com> 3a46bde3fb [Bot] Update dependencies (#1256)
Update dependencies

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
2022-09-06 20:52:55 -04:00
Henry Schreiner 3597095948 feat: support config-settings (#1244)
* feat: support config-settings

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

feat: support config-settings

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* refactor: use shlex.quote

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-09-06 00:56:20 -04:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 6a9b39af49 [pre-commit.ci] pre-commit autoupdate (#1257)
updates:
- [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-06 00:29:44 +02:00
Matthieu Darbois 3ebce17339 feat: manylinux_2_28_s390x support (#1255)
A `manylinux_2_28` image now exists for the `s390x` architecture.
2022-09-05 09:00:55 +02:00
Joe Rickerby 6f17a09d06 Merge pull request #1249 from pypa/update-dependencies-pr
[Bot] Update dependencies
2022-09-04 18:05:26 +01:00
Joe Rickerby 2dfeb94026 Merge pull request #1253 from maxbachmann/main
avoid RecursionError on Windows
2022-09-04 15:00:08 +01:00
Max Bachmann ed73b75efe avoid RecursionError on Windows 2022-09-04 10:27:05 +02:00
Joe Rickerby 0117165b02 Merge pull request #1191 from jack1142/add_cirrus_ci_support
Add support for Cirrus CI
2022-08-30 22:08:46 +01:00
Joe Rickerby 35ffadc277 Merge pull request #1235 from pypa/docs-update
Update docs toolchain
2022-08-30 21:57:04 +01:00
cibuildwheel-bot[bot] 65f7c68354 Update dependencies 2022-08-29 07:26:28 +00:00
Jakub Kuczys 93986db68c Merge branch 'main' into add_cirrus_ci_support 2022-08-23 21:26:03 +02:00
Jakub KuczysandJoe Rickerby d22703a7ce Apply suggestions from code review
Co-authored-by: Joe Rickerby <joerick@mac.com>
2022-08-23 19:39:20 +02:00
Jakub Kuczys f0e9518e79 Add Linux arm64 back 2022-08-23 17:55:14 +02:00
Joe Rickerby 8537b1670f Merge pull request #1242 from pypa/pre-commit-ci-update-config 2022-08-23 08:27:23 +01:00
Joe Rickerby eb463fd198 Merge pull request #1230 from pypa/update-dependencies-pr 2022-08-22 22:22:23 +01:00
pre-commit-ci[bot] 99dc2ed515 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1)
2022-08-22 19:19:55 +00:00
Henry Schreiner 0bc70cac93 fix(style): don't check generated file
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-08-22 14:26:13 -04:00
cibuildwheel-bot[bot] 3ea4526c63 Update dependencies 2022-08-22 06:18:46 +00:00
Jakub Kuczys 2723bbab17 Re-trigger Circle CI 2022-08-21 19:13:28 +02:00
Jakub Kuczys bd512e9065 Remove Linux arm64 build 2022-08-17 15:56:58 +02:00
Jakub Kuczys c50d72c03c Show how to build for Intel macOS on Cirrus CI 2022-08-17 15:56:57 +02:00
Jakub Kuczys ccd29d8402 Use CPython 3.10 instead of 3.8 that was used instead of 3.6 2022-08-17 15:48:03 +02:00
Jakub KuczysandJoe Rickerby 8d71ecace2 Elaborate on why arm64 platform is skipped for failing test test
Co-authored-by: Joe Rickerby <joerick@mac.com>
2022-08-17 15:48:03 +02:00
Jakub KuczysandJoe Rickerby dce8c221b7 Add more leeway to the 55 minutes task
Co-authored-by: Joe Rickerby <joerick@mac.com>
2022-08-17 15:48:02 +02:00
jack1142 ffeccfe807 Update CI.md 2022-08-17 15:48:02 +02:00
Jakub Kuczys ce8e3fe68d List Cirrus CI in README and update relevant scripts 2022-08-17 15:48:02 +02:00
jack1142 2812f8b588 Add a minimal example 2022-08-17 15:48:01 +02:00
jack1142 67071395fa Add Cirrus CI to CIProvider enum 2022-08-17 15:47:39 +02:00
jack1142 623b39eb5a Add .cirrus.yml running tests 2022-08-17 15:47:38 +02:00
jack1142 2b35f3c658 Skip cp38-macosx_arm64 in the test testing failing tests 2022-08-17 15:12:58 +02:00
jack1142 b39dc5bb5e Test doesn't depend on python version but macOS arm64 can't build 3.6 2022-08-17 15:12:58 +02:00
jack1142 2bf4c14249 Bump wheel version to fix deployment target for universal2
pypa/wheel - issue 387 and PR 390
2022-08-17 15:12:57 +02:00
jack1142 4bc6bd3c5f Skip Python 3.6 test on macOS arm64 2022-08-17 15:12:44 +02:00
Joe Rickerby 225ff6347f Minor styling improvements 2022-08-17 09:12:02 +01:00
Joe Rickerby 75c93112dc Update mkdocs and fix resulting issues 2022-08-16 22:53:11 +01:00
Joe Rickerby 4cfe1a3fff Merge pull request #1233 from Cryptex-github/main
Add ril to projects.yml
2022-08-16 22:27:11 +01:00
pre-commit-ci[bot] ed290fac3d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-16 19:50:10 +00:00
Cryptex c9216ba01c Add ril to projects.yml 2022-08-16 12:46:30 -07:00
Grzegorz Bokota f708df11c7 Add @czaki to the maintainers 2022-08-12 15:35:49 +02:00
Joe Rickerby 888771972a Add @czaki to the maintainers 2022-08-12 11:46:24 +01:00
Joe Rickerby 0abd6c205d Bump version: v2.9.0 2022-08-11 19:43:33 +01:00
Joe Rickerby 71cebdaca4 Merge pull request #1219 from pypa/disable-pytest-azurepipelines-plugin
Remove pytest-azurepipelines for now
2022-08-11 19:16:49 +01:00
Joe Rickerby 5b0d8e7d48 Merge pull request #1220 from pypa/henryiii/ci/noxaction
ci: use official nox action
2022-08-11 19:16:37 +01:00
Joe Rickerby bed97dbe5f Merge pull request #1224 from kemingy/add_example_proj
chore: add two ML example projects
2022-08-11 19:16:24 +01:00
Joe Rickerby 72e1fec0a4 Merge pull request #1226 from minrk/unprerelease-311
Build CPython 3.11 by default (no longer behind prerelease_pythons)
2022-08-11 19:16:03 +01:00
Joe Rickerby 046df7d44e Merge pull request #1223 from pypa/update-dependencies-pr
[Bot] Update dependencies
2022-08-11 13:02:33 +01:00
Min RK 2d155c01b5 Build cp311 without setting prerelease_pythons 2022-08-11 13:05:32 +02:00
Keming 30bfc7b2b2 chore: add two ML example projects
Signed-off-by: Keming <kemingy94@gmail.com>
2022-08-11 08:44:35 +08:00
cibuildwheel-bot[bot] e2c0d6831d Update dependencies 2022-08-10 17:25:27 +00:00
Joe Rickerby 6549a90991 Merge pull request #1217 from mayeut/no-universal2
fix: don't build `universal2` as a default on macOS arm64 runners
2022-08-09 08:46:31 +01:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Henry Schreiner
024ac0f0eb [pre-commit.ci] pre-commit autoupdate (#1211)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3)
- [github.com/hadialqattan/pycln: v2.0.4 → v2.1.1](https://github.com/hadialqattan/pycln/compare/v2.0.4...v2.1.1)
- [github.com/asottile/setup-cfg-fmt: v1.20.2 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.2...v2.0.0)
- [github.com/asottile/yesqa: v1.3.0 → v1.4.0](https://github.com/asottile/yesqa/compare/v1.3.0...v1.4.0)
- [github.com/PyCQA/flake8: 4.0.1 → 5.0.4](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.4)

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

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

* Update .pre-commit-config.yaml

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

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

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-08-09 01:15:30 -04:00
Henry Schreiner 9ab7670f54 ci: use official nox action 2022-08-09 00:09:48 -04:00
Matthieu Darbois 462ba084ce chore: run update workflow on pull request (#1210)
Allows to catch issues with the update workflow with related PRs.
2022-08-09 00:09:10 -04:00
Joe Rickerby caeb0c23cc Remove pytest-azurepipelines for now
Test errors in Azure are all printing KeyError: 'reason', it seems to be an incompatibility between pytest-azurepipelines and pytest-xdist. I've filed a bug here: https://github.com/Azure/pytest-azurepipelines/issues/71

in the meantime, I'll disable this plugin.
2022-08-08 22:21:22 +01:00
cibuildwheel-bot[bot]andcibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com> 66c8e84265 [Bot] Update dependencies (#1213)
Update dependencies

Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
2022-08-08 16:51:14 -04:00
Joe Rickerby ac42f66a72 Change expected_wheels to only expect universal2 when a flag is passed 2022-08-08 18:26:37 +01:00
Joe Rickerby 03c8f5b741 Docs/examples updates 2022-08-08 09:18:00 +01:00
mayeut 61480e2264 fix: don't build universal2 as a default on macOS arm64 runners 2022-08-06 11:15:11 +02:00
Matthieu Darbois 35c795e4c6 fix: update workflow (#1209)
move the `pip-compile` command directly in `noxfile.py`
2022-08-02 22:56:59 +02:00
Matthieu Darbois 8d5cb4bc1f doc: update github-with-qemu.yml example (#1206)
- remove actions/setup-python step
- bump docker/setup-qemu-action version
2022-08-02 14:46:57 -04:00
Henry SchreinerandMatthieu Darbois c234ff5f36 fix: add suggestions to the TOML error message (#1205)
* fix: add suggestions to the TOML error message

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update cibuildwheel/options.py

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

Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
2022-08-02 14:43:07 -04:00
Joe Rickerby 9d170ac0f4 Merge pull request #1208 from pypa/dependabot/github_actions/pypa/gh-action-pypi-publish-1.5.1
chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1
2022-08-02 19:07:20 +01:00
dependabot[bot] 3c219a621f chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 13:09:27 +00:00
Joe Rickerby c731529187 Merge pull request #1196 from jack1142/remove_dependency_on_unix_tools_in_windows
Remove dependency on Unix tools in Windows test suite
2022-07-30 15:10:07 +01:00
Joe Rickerby 7c95f77524 Ensure the tests that use subcommands have access to the system env 2022-07-29 18:48:43 +01:00
jack1142 3cbe175632 Fix Windows paths getting escaped 2022-07-29 18:57:47 +02:00
jack1142 e0f25c5fb5 Use sys.executable 2022-07-29 18:52:26 +02:00
jack1142 cccc2acae9 Use an equivalent of Unix echo written in Python 2022-07-29 18:04:49 +02:00
Joe Rickerby 7c7dda7208 Merge pull request #1197 from pypa/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-07-29 16:19:54 +01:00
Joe Rickerby 74e40d5078 Merge pull request #1194 from pypa/update-dependencies-pr
[Bot] Update dependencies
2022-07-29 16:19:24 +01:00
Joe Rickerby 4db339cbb7 Merge pull request #1175 from mayeut/python-3.7
chore: drop python 3.6 for cibuildwheel driver
2022-07-29 16:13:56 +01:00
Joe Rickerby f2c03faa7c Merge pull request #1195 from jack1142/fix_arch_x86_64_shell_true
Fix Rosetta2 usage for shell commands
2022-07-29 16:06:32 +01:00
pre-commit-ci[bot] 23cdab79e6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2)
- [github.com/asottile/setup-cfg-fmt: v1.20.1 → v1.20.2](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v1.20.2)
- [github.com/pre-commit/mirrors-mypy: v0.961 → v0.971](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.971)
2022-07-25 19:17:51 +00:00
jack1142 1a7abe562b Remove dependency on Unix tools in Windows 2022-07-25 19:10:09 +02:00
jack1142 aa4ca42683 Fix Rosetta2 usage for shell commands 2022-07-25 16:15:00 +02:00
cibuildwheel-bot[bot] fc15836c63 Update dependencies 2022-07-25 06:15:53 +00:00
Joe Rickerby fb63392538 Merge pull request #1186 from hadialqattan/patch-1
Upgrading Pycln from v2.0.3 to v2.0.4 (a pre-commit hook)
2022-07-19 12:01:17 +01:00
Hadi Alqattan 8575b35cc2 Upgrading Pycln from v2.0.3 to v2.0.4
Pycln v2.0.3 has some issues with Py3.9+.
2022-07-19 13:05:33 +03:00
mayeut 6d27f05c7c chore: use from __future__ import annotations 2022-07-19 07:47:45 +02:00
mayeut 054230e01b fix: test_build_default_launches to use an empty package dir
test_build_default_launches was using cibuildwheel setup.cfg which led to the test failing once python 3.6 was dropped.
Use an empty package, provided by fake_package_dir, to run the test.
2022-07-19 07:47:20 +02:00
mayeut bc17f103f1 chore: drop python 3.6 for cibuildwheel driver
This drops python 3.6 for cibuildwheel.
Building python 3.6 packages is still supported.
2022-07-19 07:47:20 +02:00
123 changed files with 1815 additions and 723 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
version: 2
jobs:
osx-python3.6:
osx-python3.9:
macos:
xcode: 12.5.1
environment:
@@ -17,9 +17,9 @@ jobs:
command: venv/bin/python ./bin/run_tests.py
no_output_timeout: 30m
linux-python3.6:
linux-python3.9:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.9
environment:
PYTHON: python3
# Temporarily restrict the tests that are run on CircleCI to prevent
@@ -41,5 +41,5 @@ workflows:
version: 2
all-tests:
jobs:
- osx-python3.6
- linux-python3.6
- osx-python3.9
- linux-python3.9
+58
View File
@@ -0,0 +1,58 @@
run_tests: &RUN_TESTS
install_cibuildwheel_script:
- python -m pip install -e ".[dev]" pytest-custom-exit-code
run_cibuildwheel_tests_script:
- python ./bin/run_tests.py
linux_x86_task:
timeout_in: 120m
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 8
memory: 8G
install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
<<: *RUN_TESTS
linux_aarch64_task:
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 4G
install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
<<: *RUN_TESTS
windows_x86_task:
# The task takes ~55 minutes while the timeout happens
# after 60 minutes by default, let's allow some wiggle room.
timeout_in: 120m
windows_container:
image: cirrusci/windowsservercore:visualstudio2022
cpu: 8
memory: 8G
install_pre_requirements_script:
- choco install -y --no-progress python3 --version 3.10.6
- refreshenv
- echo PATH=%PATH% >> "%CIRRUS_ENV%"
<<: *RUN_TESTS
macos_arm64_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode
env:
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH
install_pre_requirements_script:
- brew install python@3.10
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python
<<: *RUN_TESTS
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.0
- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.pypi_password }}
+12 -3
View File
@@ -1,6 +1,15 @@
name: Update dependencies
on:
pull_request:
paths:
- '.github/workflows/update-dependencies.yml'
- 'bin/update_pythons.py'
- 'bin/update_docker.py'
- 'bin/update_virtualenv.py'
- 'bin/projects.py'
- 'docs/data/projects.yml'
- 'noxfile.py'
workflow_dispatch:
schedule:
- cron: '0 6 * * 1' # "At 06:00 on Monday."
@@ -12,10 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: wntrblm/nox@2022.8.7
with:
python-version: "3.11-dev"
- uses: excitedleigh/setup-nox@v2.1.0
python-versions: "3.6, 3.7, 3.8, 3.9, 3.10, 3.11-dev"
- name: "Run update: dependencies"
run: nox --force-color -s update_constraints
+18 -23
View File
@@ -14,20 +14,15 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.1
rev: v2.37.3
hooks:
- id: pyupgrade
name: PyUpgrade 3.6+
args: ["--py36-plus"]
exclude: ^bin/
- id: pyupgrade
name: PyUpgrade 3.7+ on bin
exclude: ^(cibuildwheel|unit_test|test)/
args: ["--py37-plus"]
exclude: ^cibuildwheel/resources/.*py$
# Autoremoves unused imports
- repo: https://github.com/hadialqattan/pycln
rev: v2.0.3
rev: v2.1.1
hooks:
- id: pycln
args: [--all]
@@ -37,24 +32,27 @@ repos:
rev: 5.10.1
hooks:
- id: isort
args: ["-a", "from __future__ import annotations"]
exclude: ^cibuildwheel/resources/.*py$
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
rev: v2.0.0
hooks:
- id: setup-cfg-fmt
args: [--include-version-classifiers, --max-py-version=3.10]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.971
hooks:
- id: mypy
name: mypy 3.6 on cibuildwheel/
exclude: ^(bin|cibuildwheel/resources|docs)/.*py$
args: ["--python-version=3.6"]
name: mypy 3.7 on cibuildwheel/
exclude: ^cibuildwheel/resources/.*py$
args: ["--python-version=3.7"]
additional_dependencies: &mypy-dependencies
- nox
- packaging>=21.0
@@ -70,28 +68,23 @@ repos:
- types-requests
- bracex
- dataclasses
- id: mypy
name: mypy 3.7+ on bin/
files: ^((bin|docs)/.*py)$
args: ["--python-version=3.7"]
additional_dependencies: *mypy-dependencies
- id: mypy
name: mypy 3.10
args: ["--python-version=3.10"]
additional_dependencies: *mypy-dependencies
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa
additional_dependencies: &flake8-dependencies
- flake8-bugbear
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
exclude: cibuildwheel/resources/
exclude: ^cibuildwheel/resources/
additional_dependencies: *flake8-dependencies
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -116,6 +109,7 @@ repos:
entry: PyBind|Numpy|Cmake|Github|PyTest
types:
- markdown
exclude: ^docs/working-examples\.md$ # Autogenerated
- id: update-readme-changelog
name: Update README changelog
language: python
@@ -123,7 +117,8 @@ repos:
files: ^docs/changelog.md$
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
args: ["-L", "sur"]
exclude: ^docs/working-examples\.md$ # Autogenerated
+11 -11
View File
@@ -8,21 +8,21 @@ branches:
jobs:
include:
- name: Linux | x86_64 + i686 | Python 3.6
python: 3.6
- name: Linux | x86_64 + i686 | Python 3.7
python: 3.7
services: docker
env: PYTHON=python
- name: Linux | arm64 | Python 3.6
python: 3.6
- name: Linux | arm64 | Python 3.7
python: 3.7
services: docker
arch: arm64-graviton2
group: edge
virt: vm
env: PYTHON=python
- name: Linux | ppc64le | Python 3.6
python: 3.6
- name: Linux | ppc64le | Python 3.7
python: 3.7
services: docker
arch: ppc64le
allow_failure: True
@@ -32,18 +32,18 @@ jobs:
# c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634
- PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"'
- name: Windows | x86_64 | Python 3.6
- name: Windows | x86_64 | Python 3.7
os: windows
language: shell
before_install:
- choco upgrade python3 -y --version 3.6.8 --limit-output
- choco upgrade python3 -y --version 3.7.9 --limit-output
# Update root certificates to fix SSL error; see http://www.chawn.com/RootCerts.htm
- powershell "md C:\temp\certs; CertUtil -generateSSTFromWU C:\temp\certs\RootStore.sst; Get-ChildItem -Path C:\\temp\certs\Rootstore.sst | Import-Certificate -CertStoreLocation Cert:\\LocalMachine\\Root\\ | out-null"
env:
- PYTHON=C:\\Python36\\python
- PYTHON=C:\\Python37\\python
- name: Linux | s390x | Python 3.6
python: 3.6
- name: Linux | s390x | Python 3.7
python: 3.7
services: docker
arch: s390x
env: PYTHON=python
+6 -6
View File
@@ -1,11 +1,11 @@
This is a summary of the Python versions and platforms covered by the different CI platforms:
| | 3.6 | 3.7 | 3.8 |
|----------|------------------------------|-----------------------------|------------------|
| Linux | Travis CI / CircleCI | AppVeyor¹ / GitHub Actions | Azure Pipelines |
| macOS | CircleCI | AppVeyor¹ / GitHub Actions | Azure Pipelines |
| Windows | Travis CI / Azure Pipelines | AppVeyor¹ / GitHub Actions | Azure Pipelines |
| | 3.7 | 3.8 | 3.9 | 3.10 |
|----------|-----------------------|---------------------------|----------|---------------------------|
| Linux | AppVeyor¹ / Travis CI | Azure Pipelines / GitLab | CircleCI | GitHub Actions, Cirrus CI |
| macOS | AppVeyor¹ / Travis CI | Azure Pipelines | CircleCI | GitHub Actions, Cirrus CI |
| Windows | AppVeyor¹ / Travis CI | Azure Pipelines | | GitHub Actions, Cirrus CI |
> ¹ AppVeyor only runs the "basic" test to reduce load.
Non-x86 architectures are covered on Travis CI using Python 3.6.
Non-x86 architectures are covered on Travis CI using Python 3.7.
+44 -34
View File
@@ -8,6 +8,7 @@ cibuildwheel
[![Appveyor status](https://ci.appveyor.com/api/projects/status/gt3vwl88yt0y3hur/branch/main?svg=true)](https://ci.appveyor.com/project/joerick/cibuildwheel/branch/main)
[![CircleCI Status](https://img.shields.io/circleci/build/gh/pypa/cibuildwheel/main?logo=circleci)](https://circleci.com/gh/pypa/cibuildwheel)
[![Azure Status](https://dev.azure.com/joerick0429/cibuildwheel/_apis/build/status/pypa.cibuildwheel?branchName=main)](https://dev.azure.com/joerick0429/cibuildwheel/_build/latest?definitionId=4&branchName=main)
[![Cirrus CI Status](https://img.shields.io/cirrus/github/pypa/cibuildwheel/main?logo=cirrusci)](https://cirrus-ci.com/github/pypa/cibuildwheel)
[Documentation](https://cibuildwheel.readthedocs.org)
@@ -29,7 +30,7 @@ What does it do?
| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅³ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.11 | ✅ | ✅ | ✅ | ✅ | ✅² | ✅ | ✅ | ✅ | ✅ | ✅ |
| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A |
| PyPy 3.8 v7.3 | ✅ | 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 |
@@ -37,10 +38,9 @@ What does it do?
<sup>¹ PyPy is only supported for manylinux wheels.</sup><br>
<sup>² Windows arm64 support is experimental.</sup><br>
<sup>³ Alpine 3.14 and very briefly 3.15's default python3 [was not able to load](https://github.com/pypa/cibuildwheel/issues/934) musllinux wheels. This has been fixed; please upgrade the python package if using Alpine from before the fix.</sup><br>
<sup>⁴ CPython 3.11 is available using the [CIBW_PRERELEASE_PYTHONS](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons) option.</sup><br>
- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy
- Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI
- Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, GitLab CI, and Cirrus CI
- Bundles shared library dependencies on Linux and macOS through [auditwheel](https://github.com/pypa/auditwheel) and [delocate](https://github.com/matthew-brett/delocate)
- Runs your library's tests against the wheel-installed version of your library
@@ -51,16 +51,19 @@ Usage
`cibuildwheel` runs inside a CI service. Supported platforms depend on which service you're using:
| | Linux | macOS | Windows | Linux ARM |
|-----------------|-------|-------|---------|--------------|
| GitHub Actions | ✅ | ✅ | ✅ | ✅¹ |
| Azure Pipelines | ✅ | ✅ | ✅ | |
| Travis CI | ✅ | | ✅ | ✅ |
| AppVeyor | ✅ | ✅ | ✅ | |
| CircleCI | ✅ | ✅ | | |
| Gitlab CI | ✅ | | | |
| | Linux | macOS | Windows | Linux ARM | macOS ARM |
|-----------------|-------|-------|---------|-----------|-----------|
| GitHub Actions | ✅ | ✅ | ✅ | ✅¹ | ✅² |
| Azure Pipelines | ✅ | ✅ | ✅ | | ✅² |
| Travis CI | ✅ | | ✅ | ✅ | |
| AppVeyor | ✅ | ✅ | ✅ | | ✅² |
| CircleCI | ✅ | ✅ | | | ✅² |
| Gitlab CI | ✅ | | | | |
| Cirrus CI | ✅ | ✅³ | ✅ | ✅ | ✅ |
<sup>¹ [Requires emulation](https://cibuildwheel.readthedocs.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.readthedocs.io/en/stable/faq/#universal2). It is not possible to test `arm64` and the `arm64` part of a `universal2` wheel on this CI platform.</sup><br>
<sup>³ [Uses cross-compilation](https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2). Thanks to Rosetta 2 emulation, it is possible to test `x86_64` and both parts of a `universal2` wheel on this CI platform.</sup><br>
<!--intro-end-->
@@ -89,7 +92,7 @@ jobs:
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.8.1
run: python -m pip install cibuildwheel==2.10.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
@@ -180,6 +183,7 @@ Here are some repos that use cibuildwheel.
[circleci icon]: docs/data/readme_icons/circleci.svg
[gitlab icon]: docs/data/readme_icons/gitlab.svg
[travisci icon]: docs/data/readme_icons/travisci.svg
[cirrusci icon]: docs/data/readme_icons/cirrusci.svg
[windows icon]: docs/data/readme_icons/windows.svg
[apple icon]: docs/data/readme_icons/apple.svg
[linux icon]: docs/data/readme_icons/linux.svg
@@ -204,6 +208,33 @@ Changelog
<!-- this section was generated by bin/update_readme_changelog.py -- do not edit manually -->
### v2.10.1
_18 September 2022_
- 🐛 Fix a bug that stopped environment variables specified in TOML from being expanded. (#1273)
### v2.10.0
_13 September 2022_
- 🌟 Adds support for [building wheels on Cirrus CI](https://cibuildwheel.readthedocs.io/en/stable/setup/#cirrus-ci). This is exciting for us, as it's the first public CI platform that natively supports macOS Apple Silicon (aka. M1, `arm64`) runners. As such, it's the first platform that you can natively build _and test_ macOS `arm64` wheels. It also has native Linux ARM (aarch64) runners, for fast, native builds there. (#1191)
- 🌟 Adds support for running cibuildwheel on Apple Silicon machines. For a while, we've supported cross-compilation of Apple Silicon wheels on `x86_64`, but now that we have Cirrus CI we can run our test suite and officially support running cibuildwheel on `arm64`. (#1191)
- ✨ Adds the `--only` [command line option](https://cibuildwheel.readthedocs.io/en/stable/options/#command-line), to specify a single build to run. Previously, it could be cumbersome to set all the build selection options to target a specific build - for example, you might have to run something like `CIBW_BUILD=cp39-manylinux_x86_64 cibuildwheel --platform linux --archs x86_64`. The new `--only` option overrides all the build selection options to simplify running a single build, which now looks like `cibuildwheel --only cp39-manylinux_x86_64`. (#1098)
- ✨ Adds the [`CIBW_CONFIG_SETTINGS`](https://cibuildwheel.readthedocs.io/en/stable/options/#config-settings) option, so you can pass arguments to your package's build backend (#1244)
- 🛠 Updates the CPython 3.11 version to the latest release candidate - v3.11.0rc2. (#1265)
- 🐛 Fix a bug that can cause a RecursionError on Windows when building from an sdist. (#1253)
- 🛠 Add support for the s390x architecture on manylinux_2_28 (#1255)
### v2.9.0
_11 August 2022_
- 🌟 CPython 3.11 wheels are now built by default - without the CIBW_PRERELEASE_PYTHONS flag. It's time to build and upload these wheels to PyPI! This release includes CPython 3.11.0rc1, which is guaranteed to be ABI compatible with the final release. (#1226)
- ⚠️ Removed support for running cibuildwheel in Python 3.6. Python 3.6 is EOL. However, cibuildwheel continues to build CPython 3.6 wheels for the moment. (#1175)
- ✨ Improved error messages when misspelling TOML options, suggesting close matches (#1205)
- 🛠 When running on Apple Silicon (so far, an unsupported mode of operation), cibuildwheel no longer builds universal2 wheels by default - just arm64. See [#1204](https://github.com/pypa/cibuildwheel/issues/1204) for discussion. We hope to release official support for native builds on Apple Silicon soon! (#1217)
### v2.8.1
_18 July 2022_
@@ -226,28 +257,6 @@ _5 July 2022_
- 🛠 cibuildwheel will now error if multiple builds in a single run produce the same wheel filename, as this indicates a misconfiguration. (#1152)
- 📚 A few docs improvements and updates to keep things up-to-date.
### v2.7.0
_17 June 2022_
- 🌟 Added support for the new `manylinux_2_28` images. These new images are based on AlmaLinux, the community-driven successor to CentOS, unlike manylinux_2_24, which was based on Debian. To build on these images, set your [`CIBW_MANYLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image) option to `manylinux_2_28`. (#1026)
- 🐛 Fix a bug where tests were not being run on CPython 3.11 (when CIBW_PRERELEASE_PYTHONS was set) (#1138)
- ✨ You can now build Linux wheels on Windows, as long as you have Docker installed and set to 'Linux containers' (#1117)
- 🐛 Fix a bug on macOS that caused cibuildwheel to crash trying to overwrite a previously-built wheel of the same name. (#1129)
### v2.6.1
_7 June 2022_
- 🛠 Update the prerelease CPython 3.11 to 3.11.0b3
### v2.6.0
_25 May 2022_
- 🌟 Added the ability to test building wheels on CPython 3.11! Because CPython 3.11 is in beta, these wheels should not be distributed, because they might not be compatible with the final release, but it's available to build for testing purposes. Use the flag [`--prerelease-pythons` or `CIBW_PRERELEASE_PYTHONS`](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons) to test. This version of cibuildwheel includes CPython 3.11.0b1. (#1109)
- 📚 Added an interactive diagram showing how cibuildwheel works to the [docs](https://cibuildwheel.readthedocs.io/en/stable/#how-it-works) (#1100)
<!-- END bin/update_readme_changelog.py -->
---
@@ -272,6 +281,7 @@ Maintainers
- Yannick Jadoul [@YannickJadoul](https://github.com/YannickJadoul)
- Matthieu Darbois [@mayeut](https://github.com/mayeut)
- Henry Schreiner [@henryiii](https://github.com/henryiii)
- Grzegorz Bokota [@Czaki](https://github.com/Czaki)
Credits
-------
+5
View File
@@ -13,6 +13,10 @@ inputs:
description: 'File containing the config, defaults to {package}/pyproject.toml'
required: false
default: ''
only:
description: 'Build a specific wheel only. No need for arch/platform if this is set'
required: false
default: ''
branding:
icon: package
color: yellow
@@ -36,5 +40,6 @@ runs:
${{ inputs.package-dir }}
--output-dir ${{ inputs.output-dir }}
--config-file "${{ inputs.config-file }}"
--only "${{ inputs.only }}"
2>&1
shell: bash
+3 -14
View File
@@ -7,7 +7,7 @@ jobs:
inputs:
versionSpec: '3.8'
- bash: |
python -m pip install -e ".[dev]" pytest-azurepipelines
python -m pip install -e ".[dev]"
python ./bin/run_tests.py
- job: macos_38
@@ -17,18 +17,7 @@ jobs:
inputs:
versionSpec: '3.8'
- bash: |
python -m pip install -e ".[dev]" pytest-azurepipelines
python ./bin/run_tests.py
- job: windows_36
pool: {vmImage: 'windows-2019'}
timeoutInMinutes: 180
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
- bash: |
python -m pip install -e ".[dev]" pytest-azurepipelines
python -m pip install -e ".[dev]"
python ./bin/run_tests.py
- job: windows_38
@@ -39,5 +28,5 @@ jobs:
inputs:
versionSpec: '3.8'
- bash: |
python -m pip install -e ".[dev]" pytest-azurepipelines
python -m pip install -e ".[dev]"
python ./bin/run_tests.py
+1
View File
@@ -32,6 +32,7 @@ ICONS = (
"circleci",
"gitlab",
"travisci",
"cirrusci",
"windows",
"apple",
"linux",
+5
View File
@@ -66,6 +66,11 @@ services = [
dst_config_path=".gitlab-ci.yml",
badge_md="[![Gitlab](https://gitlab.com/pypa/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/pypa/cibuildwheel/-/commits/{branch})",
),
CIService(
name="cirrus-ci",
dst_config_path=".cirrus.yml",
badge_md="[![Cirrus CI](https://api.cirrus-ci.com/github/pypa/cibuildwheel.svg?branch={branch})](https://cirrus-ci.com/github/pypa/cibuildwheel/{branch})",
),
]
+2
View File
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import os
import subprocess
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/env python3
# This file supports 3.6+
import os
import shutil
import subprocess
import sys
from pathlib import Path
DIR = Path(__file__).parent.resolve()
RESOURCES = DIR.parent / "cibuildwheel/resources"
python_version = "".join(str(v) for v in sys.version_info[:2])
env = os.environ.copy()
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
# regenerate the constraints files
env["CUSTOM_COMPILE_COMMAND"] = "bin/update_dependencies.py"
os.chdir(DIR.parent)
subprocess.run(
[
"pip-compile",
"--allow-unsafe",
"--upgrade",
"cibuildwheel/resources/constraints.in",
f"--output-file=cibuildwheel/resources/constraints-python{python_version}.txt",
],
check=True,
env=env,
)
# default constraints.txt
if python_version == "39":
shutil.copyfile(
RESOURCES / f"constraints-python{python_version}.txt",
RESOURCES / "constraints.txt",
)
+1
View File
@@ -50,6 +50,7 @@ images = [
Image("manylinux_2_28", "x86_64", "quay.io/pypa/manylinux_2_28_x86_64", None),
Image("manylinux_2_28", "aarch64", "quay.io/pypa/manylinux_2_28_aarch64", None),
Image("manylinux_2_28", "ppc64le", "quay.io/pypa/manylinux_2_28_ppc64le", None),
Image("manylinux_2_28", "s390x", "quay.io/pypa/manylinux_2_28_s390x", None),
Image("manylinux_2_28", "pypy_x86_64", "quay.io/pypa/manylinux_2_28_x86_64", None),
Image("manylinux_2_28", "pypy_aarch64", "quay.io/pypa/manylinux_2_28_aarch64", None),
# musllinux_1_1 images
+2
View File
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from __future__ import annotations
import re
import sys
from pathlib import Path
+3 -1
View File
@@ -1 +1,3 @@
__version__ = "2.8.1"
from __future__ import annotations
__version__ = "2.10.1"
+68 -23
View File
@@ -1,13 +1,14 @@
from __future__ import annotations
import argparse
import os
import shutil
import sys
import tarfile
import tempfile
import textwrap
import typing
from pathlib import Path
from tempfile import mkdtemp
from typing import List, Set, Union
import cibuildwheel
import cibuildwheel.linux
@@ -40,7 +41,7 @@ def main() -> None:
parser.add_argument(
"--platform",
choices=["auto", "linux", "macos", "windows"],
default=os.environ.get("CIBW_PLATFORM", "auto"),
default=None,
help="""
Platform to build for. Use this option to override the
auto-detected platform or to run cibuildwheel on your development
@@ -64,6 +65,16 @@ def main() -> None:
""",
)
parser.add_argument(
"--only",
default=None,
help="""
Force a single wheel build when given an identifier. Overrides
CIBW_BUILD/CIBW_SKIP. --platform and --arch cannot be specified
if this is given.
""",
)
parser.add_argument(
"--output-dir",
type=Path,
@@ -129,8 +140,8 @@ def main() -> None:
return
# Tarfile builds require extraction and changing the directory
with tempfile.TemporaryDirectory(prefix="cibw-sdist-") as temp_dir_str:
temp_dir = Path(temp_dir_str)
temp_dir = Path(mkdtemp(prefix="cibw-sdist-")).resolve(strict=True)
try:
with tarfile.open(args.package_dir) as tar:
tar.extractall(path=temp_dir)
@@ -145,13 +156,49 @@ def main() -> None:
with chdir(temp_dir):
build_in_directory(args)
finally:
# avoid https://github.com/python/cpython/issues/86962 by performing
# cleanup manually
shutil.rmtree(temp_dir, ignore_errors=sys.platform.startswith("win"))
if temp_dir.exists():
log.warning(f"Can't delete temporary folder '{str(temp_dir)}'")
def build_in_directory(args: CommandLineArguments) -> None:
platform_option_value = args.platform or os.environ.get("CIBW_PLATFORM", "auto")
platform: PlatformName
if args.platform != "auto":
platform = args.platform
if args.only:
if "linux_" in args.only:
platform = "linux"
elif "macosx_" in args.only:
platform = "macos"
elif "win_" in args.only:
platform = "windows"
else:
print(
f"Invalid --only='{args.only}', must be a build selector with a known platform",
file=sys.stderr,
)
sys.exit(2)
if args.platform is not None:
print(
"--platform cannot be specified with --only, it is computed from --only",
file=sys.stderr,
)
sys.exit(2)
if args.archs is not None:
print(
"--arch cannot be specified with --only, it is computed from --only",
file=sys.stderr,
)
sys.exit(2)
elif platform_option_value != "auto":
if platform_option_value not in PLATFORMS:
print(f"cibuildwheel: Unsupported platform: {platform_option_value}", file=sys.stderr)
sys.exit(2)
platform = typing.cast(PlatformName, platform_option_value)
else:
ci_provider = detect_ci_provider()
if ci_provider is None:
@@ -159,9 +206,9 @@ def build_in_directory(args: CommandLineArguments) -> None:
textwrap.dedent(
"""
cibuildwheel: Unable to detect platform. cibuildwheel should run on your CI server;
Travis CI, AppVeyor, Azure Pipelines, GitHub Actions, CircleCI, and Gitlab are
supported. You can run on your development machine or other CI providers using the
--platform argument. Check --help output for more information.
Travis CI, AppVeyor, Azure Pipelines, GitHub Actions, CircleCI, Gitlab, and Cirrus CI
are supported. You can run on your development machine or other CI providers
using the --platform argument. Check --help output for more information.
"""
),
file=sys.stderr,
@@ -181,10 +228,6 @@ def build_in_directory(args: CommandLineArguments) -> None:
)
sys.exit(2)
if platform not in PLATFORMS:
print(f"cibuildwheel: Unsupported platform: {platform}", file=sys.stderr)
sys.exit(2)
options = compute_options(platform=platform, command_line_arguments=args)
package_dir = options.globals.package_dir
@@ -252,12 +295,14 @@ def build_in_directory(args: CommandLineArguments) -> None:
else:
assert_never(platform)
finally:
# avoid https://github.com/python/cpython/issues/86962 by performing
# cleanup manually
shutil.rmtree(tmp_path, ignore_errors=sys.platform.startswith("win"))
if tmp_path.exists():
log.warning(f"Can't delete temporary folder '{str(tmp_path)}'")
def print_preamble(platform: str, options: Options, identifiers: List[str]) -> None:
def print_preamble(platform: str, options: Options, identifiers: list[str]) -> None:
print(
textwrap.dedent(
"""
@@ -287,13 +332,13 @@ def print_preamble(platform: str, options: Options, identifiers: List[str]) -> N
def get_build_identifiers(
platform: PlatformName, build_selector: BuildSelector, architectures: Set[Architecture]
) -> List[str]:
python_configurations: Union[
List[cibuildwheel.linux.PythonConfiguration],
List[cibuildwheel.windows.PythonConfiguration],
List[cibuildwheel.macos.PythonConfiguration],
]
platform: PlatformName, build_selector: BuildSelector, architectures: set[Architecture]
) -> list[str]:
python_configurations: (
list[cibuildwheel.linux.PythonConfiguration]
| list[cibuildwheel.windows.PythonConfiguration]
| list[cibuildwheel.macos.PythonConfiguration]
)
if platform == "linux":
python_configurations = cibuildwheel.linux.get_python_configurations(
@@ -313,7 +358,7 @@ def get_build_identifiers(
return [config.identifier for config in python_configurations]
def detect_warnings(*, options: Options, identifiers: List[str]) -> List[str]:
def detect_warnings(*, options: Options, identifiers: list[str]) -> list[str]:
warnings = []
# warn about deprecated {python} and {pip}
+8 -11
View File
@@ -1,8 +1,9 @@
from __future__ import annotations
import functools
import platform as platform_module
import re
from enum import Enum
from typing import Set
from .typing import Final, Literal, PlatformName, assert_never
@@ -32,11 +33,11 @@ class Architecture(Enum):
ARM64 = "ARM64"
# Allow this to be sorted
def __lt__(self, other: "Architecture") -> bool:
def __lt__(self, other: Architecture) -> bool:
return self.value < other.value
@staticmethod
def parse_config(config: str, platform: PlatformName) -> "Set[Architecture]":
def parse_config(config: str, platform: PlatformName) -> set[Architecture]:
result = set()
for arch_str in re.split(r"[\s,]+", config):
if arch_str == "auto":
@@ -54,7 +55,7 @@ class Architecture(Enum):
return result
@staticmethod
def auto_archs(platform: PlatformName) -> "Set[Architecture]":
def auto_archs(platform: PlatformName) -> set[Architecture]:
native_architecture = Architecture(platform_module.machine())
result = {native_architecture}
@@ -65,14 +66,10 @@ class Architecture(Enum):
if platform == "windows" and native_architecture == Architecture.AMD64:
result.add(Architecture.x86)
if platform == "macos" and native_architecture == Architecture.arm64:
# arm64 can build and test both archs of a universal2 wheel.
result.add(Architecture.universal2)
return result
@staticmethod
def all_archs(platform: PlatformName) -> "Set[Architecture]":
def all_archs(platform: PlatformName) -> set[Architecture]:
all_archs_map = {
"linux": {
Architecture.x86_64,
@@ -87,7 +84,7 @@ class Architecture(Enum):
return all_archs_map[platform]
@staticmethod
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> "Set[Architecture]":
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> set[Architecture]:
archs_32 = {Architecture.i686, Architecture.x86}
auto_archs = Architecture.auto_archs(platform)
@@ -101,7 +98,7 @@ class Architecture(Enum):
def allowed_architectures_check(
platform: PlatformName,
architectures: Set[Architecture],
architectures: set[Architecture],
) -> None:
allowed_architectures = Architecture.all_archs(platform)
+8 -8
View File
@@ -1,6 +1,8 @@
from __future__ import annotations
import subprocess
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Sequence
from typing import Callable, Dict, List, Sequence
import bashlex
@@ -8,21 +10,19 @@ import bashlex
EnvironmentExecutor = Callable[[List[str], Dict[str, str]], str]
def local_environment_executor(command: List[str], env: Dict[str, str]) -> str:
return subprocess.run(
command, env=env, universal_newlines=True, stdout=subprocess.PIPE, check=True
).stdout
def local_environment_executor(command: list[str], env: dict[str, str]) -> str:
return subprocess.run(command, env=env, text=True, stdout=subprocess.PIPE, check=True).stdout
@dataclass(frozen=True)
class NodeExecutionContext:
environment: Dict[str, str]
environment: dict[str, str]
input: str
executor: EnvironmentExecutor
def evaluate(
value: str, environment: Dict[str, str], executor: Optional[EnvironmentExecutor] = None
value: str, environment: dict[str, str], executor: EnvironmentExecutor | None = None
) -> str:
if not value:
# empty string evaluates to empty string
@@ -103,7 +103,7 @@ def evaluate_nodes_as_compound_command(
def evaluate_nodes_as_simple_command(
nodes: List[bashlex.ast.node], context: NodeExecutionContext
nodes: list[bashlex.ast.node], context: NodeExecutionContext
) -> str:
command = [evaluate_node(part, context=context) for part in nodes]
return context.executor(command, context.environment)
+17 -10
View File
@@ -1,7 +1,10 @@
from __future__ import annotations
import dataclasses
from typing import Any, Dict, List, Mapping, Optional, Sequence
from typing import Any, Mapping, Sequence
import bashlex
import bashlex.errors
from cibuildwheel.typing import Protocol
@@ -12,7 +15,7 @@ class EnvironmentParseError(Exception):
pass
def split_env_items(env_string: str) -> List[str]:
def split_env_items(env_string: str) -> list[str]:
"""Splits space-separated variable assignments into a list of individual assignments.
>>> split_env_items('VAR=abc')
@@ -31,7 +34,11 @@ def split_env_items(env_string: str) -> List[str]:
if not env_string:
return []
command_node = bashlex.parsesingle(env_string)
try:
command_node = bashlex.parsesingle(env_string)
except bashlex.errors.ParsingError as e:
raise EnvironmentParseError(env_string) from e
result = []
for word_node in command_node.parts:
@@ -47,8 +54,8 @@ class EnvironmentAssignment(Protocol):
def evaluated_value(
self,
*,
environment: Dict[str, str],
executor: Optional[bashlex_eval.EnvironmentExecutor] = None,
environment: dict[str, str],
executor: bashlex_eval.EnvironmentExecutor | None = None,
) -> str:
"""Returns the value of this assignment, as evaluated in the environment"""
@@ -84,8 +91,8 @@ class EnvironmentAssignmentBash:
def evaluated_value(
self,
environment: Dict[str, str],
executor: Optional[bashlex_eval.EnvironmentExecutor] = None,
environment: dict[str, str],
executor: bashlex_eval.EnvironmentExecutor | None = None,
) -> str:
return bashlex_eval.evaluate(self.value, environment=environment, executor=executor)
@@ -100,7 +107,7 @@ class EnvironmentAssignmentBash:
@dataclasses.dataclass
class ParsedEnvironment:
assignments: List[EnvironmentAssignment]
assignments: list[EnvironmentAssignment]
def __init__(self, assignments: Sequence[EnvironmentAssignment]) -> None:
self.assignments = list(assignments)
@@ -108,8 +115,8 @@ class ParsedEnvironment:
def as_dictionary(
self,
prev_environment: Mapping[str, str],
executor: Optional[bashlex_eval.EnvironmentExecutor] = None,
) -> Dict[str, str]:
executor: bashlex_eval.EnvironmentExecutor | None = None,
) -> dict[str, str]:
environment = dict(**prev_environment)
for assignment in self.assignments:
+3 -2
View File
@@ -2,8 +2,9 @@
These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
"""
from __future__ import annotations
from io import StringIO
from typing import Dict, List
from .typing import Protocol
@@ -15,7 +16,7 @@ class Printable(Protocol):
...
def dump_python_configurations(inp: Dict[str, Dict[str, List[Dict[str, Printable]]]]) -> str:
def dump_python_configurations(inp: dict[str, dict[str, list[dict[str, Printable]]]]) -> str:
output = StringIO()
for header, values in inp.items():
output.write(f"[{header}]\n")
+8 -6
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
from threading import RLock
from typing import Any, Callable, Generic, Optional, Type, TypeVar, overload
from typing import Any, Callable, Generic, TypeVar, overload
__all__ = ["cached_property"]
@@ -11,11 +13,11 @@ _T = TypeVar("_T")
class cached_property(Generic[_T]):
def __init__(self, func: Callable[[Any], _T]):
self.func = func
self.attrname: Optional[str] = None
self.attrname: str | None = None
self.__doc__ = func.__doc__
self.lock = RLock()
def __set_name__(self, owner: Type[Any], name: str) -> None:
def __set_name__(self, owner: type[Any], name: str) -> None:
if self.attrname is None:
self.attrname = name
elif name != self.attrname:
@@ -25,14 +27,14 @@ class cached_property(Generic[_T]):
)
@overload
def __get__(self, instance: None, owner: Optional[Type[Any]] = ...) -> "cached_property[_T]":
def __get__(self, instance: None, owner: type[Any] | None = ...) -> cached_property[_T]:
...
@overload
def __get__(self, instance: object, owner: Optional[Type[Any]] = ...) -> _T:
def __get__(self, instance: object, owner: type[Any] | None = ...) -> _T:
...
def __get__(self, instance: Optional[object], owner: Optional[Type[Any]] = None) -> Any:
def __get__(self, instance: object | None, owner: type[Any] | None = None) -> Any:
if instance is None:
return self
if self.attrname is None:
+19 -12
View File
@@ -1,9 +1,11 @@
from __future__ import annotations
import subprocess
import sys
import textwrap
from dataclasses import dataclass
from pathlib import Path, PurePath, PurePosixPath
from typing import Iterator, List, Set, Tuple
from typing import Iterator, Tuple
from .architecture import Architecture
from .logger import log
@@ -18,6 +20,7 @@ from .util import (
get_build_verbosity_extra_flags,
prepare_command,
read_python_configs,
split_config_settings,
unwrap,
)
@@ -35,15 +38,15 @@ class PythonConfiguration:
@dataclass(frozen=True)
class BuildStep:
platform_configs: List[PythonConfiguration]
platform_configs: list[PythonConfiguration]
platform_tag: str
container_image: str
def get_python_configurations(
build_selector: BuildSelector,
architectures: Set[Architecture],
) -> List[PythonConfiguration]:
architectures: set[Architecture],
) -> list[PythonConfiguration]:
full_python_configs = read_python_configs("linux")
@@ -79,7 +82,7 @@ def container_image_for_python_configuration(config: PythonConfiguration, option
def get_build_steps(
options: Options, python_configurations: List[PythonConfiguration]
options: Options, python_configurations: list[PythonConfiguration]
) -> Iterator[BuildStep]:
"""
Groups PythonConfigurations into BuildSteps. Each BuildStep represents a
@@ -110,7 +113,7 @@ def get_build_steps(
def build_in_container(
*,
options: Options,
platform_configs: List[PythonConfiguration],
platform_configs: list[PythonConfiguration],
container: OCIContainer,
container_project_path: PurePath,
container_package_dir: PurePath,
@@ -140,13 +143,13 @@ def build_in_container(
)
container.call(["sh", "-c", before_all_prepared], env=env)
built_wheels: List[PurePosixPath] = []
built_wheels: list[PurePosixPath] = []
for config in platform_configs:
log.build_start(config.identifier)
build_options = options.build_options(config.identifier)
dependency_constraint_flags: List[PathOrStr] = []
dependency_constraint_flags: list[PathOrStr] = []
if build_options.dependency_constraints:
constraints_file = build_options.dependency_constraints.get_for_python_version(
@@ -210,8 +213,10 @@ def build_in_container(
container.call(["mkdir", "-p", built_wheel_dir])
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings)
if build_options.build_frontend == "pip":
extra_flags += verbosity_flags
container.call(
[
"python",
@@ -221,12 +226,13 @@ def build_in_container(
container_package_dir,
f"--wheel-dir={built_wheel_dir}",
"--no-deps",
*verbosity_flags,
*extra_flags,
],
env=env,
)
elif build_options.build_frontend == "build":
config_setting = " ".join(verbosity_flags)
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
container.call(
[
"python",
@@ -235,7 +241,7 @@ def build_in_container(
container_package_dir,
"--wheel",
f"--outdir={built_wheel_dir}",
f"--config-setting={config_setting}",
*extra_flags,
],
env=env,
)
@@ -347,6 +353,7 @@ def build(options: Options, tmp_path: Path) -> None: # pylint: disable=unused-a
If you're building on Travis CI, add `services: [docker]` to
your .travis.yml. If you're building on Circle CI in Linux,
add a `setup_remote_docker` step to your .circleci/config.yml.
If you're building on Cirrus CI, use `docker_builder` task.
"""
),
file=sys.stderr,
@@ -395,7 +402,7 @@ def build(options: Options, tmp_path: Path) -> None: # pylint: disable=unused-a
sys.exit(1)
def _matches_prepared_command(error_cmd: List[str], command_template: str) -> bool:
def _matches_prepared_command(error_cmd: list[str], command_template: str) -> bool:
if len(error_cmd) < 3 or error_cmd[0:2] != ["sh", "-c"]:
return False
command_prefix = command_template.split("{", maxsplit=1)[0].strip()
+11 -9
View File
@@ -1,9 +1,11 @@
from __future__ import annotations
import codecs
import os
import re
import sys
import time
from typing import IO, AnyStr, Optional, Union
from typing import IO, AnyStr
from cibuildwheel.typing import Final
from cibuildwheel.util import CIProvider, detect_ci_provider
@@ -39,10 +41,10 @@ class Logger:
fold_mode: str
colors_enabled: bool
unicode_enabled: bool
active_build_identifier: Optional[str] = None
build_start_time: Optional[float] = None
step_start_time: Optional[float] = None
active_fold_group_name: Optional[str] = None
active_build_identifier: str | None = None
build_start_time: float | None = None
step_start_time: float | None = None
active_fold_group_name: str | None = None
def __init__(self) -> None:
if sys.platform == "win32" and hasattr(sys.stdout, "reconfigure"):
@@ -120,7 +122,7 @@ class Logger:
self.step_start_time = None
def step_end_with_error(self, error: Union[BaseException, str]) -> None:
def step_end_with_error(self, error: BaseException | str) -> None:
self.step_end(success=False)
self.error(error)
@@ -131,7 +133,7 @@ class Logger:
c = self.colors
print(f"{c.yellow}Warning{c.end}: {message}\n", file=sys.stderr)
def error(self, error: Union[BaseException, str]) -> None:
def error(self, error: BaseException | str) -> None:
if self.fold_mode == "github":
print(f"::error::{error}\n", file=sys.stderr)
else:
@@ -174,11 +176,11 @@ class Logger:
return identifier.lower()[:20]
@property
def colors(self) -> "Colors":
def colors(self) -> Colors:
return Colors(enabled=self.colors_enabled)
@property
def symbols(self) -> "Symbols":
def symbols(self) -> Symbols:
return Symbols(unicode=self.unicode_enabled)
+18 -12
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import functools
import os
import platform
@@ -7,7 +9,7 @@ import subprocess
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Sequence, Set, Tuple, cast
from typing import Sequence, Tuple, cast
from filelock import FileLock
@@ -32,12 +34,13 @@ from .util import (
prepare_command,
read_python_configs,
shell,
split_config_settings,
unwrap,
virtualenv,
)
def get_macos_version() -> Tuple[int, int]:
def get_macos_version() -> tuple[int, int]:
"""
Returns the macOS major/minor version, as a tuple, e.g. (10, 15) or (11, 0)
@@ -51,7 +54,7 @@ def get_macos_version() -> Tuple[int, int]:
return cast(Tuple[int, int], version)
def get_macos_sdks() -> List[str]:
def get_macos_sdks() -> list[str]:
output = call("xcodebuild", "-showsdks", capture_stdout=True)
return [m.group(1) for m in re.finditer(r"-sdk (macosx\S+)", output)]
@@ -64,8 +67,8 @@ class PythonConfiguration:
def get_python_configurations(
build_selector: BuildSelector, architectures: Set[Architecture]
) -> List[PythonConfiguration]:
build_selector: BuildSelector, architectures: set[Architecture]
) -> list[PythonConfiguration]:
full_python_configs = read_python_configs("macos")
@@ -134,7 +137,7 @@ def setup_python(
dependency_constraint_flags: Sequence[PathOrStr],
environment: ParsedEnvironment,
build_frontend: BuildFrontend,
) -> Dict[str, str]:
) -> dict[str, str]:
tmp.mkdir()
implementation_id = python_configuration.identifier.split("-")[0]
log.step(f"Installing Python {implementation_id}...")
@@ -295,7 +298,7 @@ def build(options: Options, tmp_path: Path) -> None:
)
shell(before_all_prepared, env=env)
built_wheels: List[Path] = []
built_wheels: list[Path] = []
for config in python_configurations:
build_options = options.build_options(config.identifier)
@@ -343,8 +346,10 @@ def build(options: Options, tmp_path: Path) -> None:
built_wheel_dir.mkdir()
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings)
if build_options.build_frontend == "pip":
extra_flags += verbosity_flags
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
# see https://github.com/pypa/cibuildwheel/pull/369
call(
@@ -355,11 +360,12 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.package_dir.resolve(),
f"--wheel-dir={built_wheel_dir}",
"--no-deps",
*verbosity_flags,
*extra_flags,
env=env,
)
elif build_options.build_frontend == "build":
config_setting = " ".join(verbosity_flags)
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
build_env = env.copy()
if build_options.dependency_constraints:
constraint_path = (
@@ -376,7 +382,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.package_dir,
"--wheel",
f"--outdir={built_wheel_dir}",
f"--config-setting={config_setting}",
*extra_flags,
env=build_env,
)
else:
@@ -418,7 +424,7 @@ def build(options: Options, tmp_path: Path) -> None:
if build_options.test_command and build_options.test_selector(config.identifier):
machine_arch = platform.machine()
testing_archs: List[Literal["x86_64", "arm64"]]
testing_archs: list[Literal["x86_64", "arm64"]]
if config_is_arm64:
testing_archs = ["arm64"]
@@ -505,7 +511,7 @@ def build(options: Options, tmp_path: Path) -> None:
# define a custom 'call' function that adds the arch prefix each time
call_with_arch = functools.partial(call, *arch_prefix)
shell_with_arch = functools.partial(shell, *arch_prefix)
shell_with_arch = functools.partial(call, *arch_prefix, "/bin/sh", "-c")
# Use --no-download to ensure determinism by using seed libraries
# built into virtualenv
+14 -12
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import io
import json
import os
@@ -9,7 +11,7 @@ import sys
import uuid
from pathlib import Path, PurePath, PurePosixPath
from types import TracebackType
from typing import IO, Dict, List, Optional, Sequence, Type, cast
from typing import IO, Dict, Sequence, cast
from cibuildwheel.util import CIProvider, detect_ci_provider
@@ -52,7 +54,7 @@ class OCIContainer:
*,
image: str,
simulate_32_bit: bool = False,
cwd: Optional[PathOrStr] = None,
cwd: PathOrStr | None = None,
engine: ContainerEngine = "docker",
):
if not image:
@@ -61,10 +63,10 @@ class OCIContainer:
self.image = image
self.simulate_32_bit = simulate_32_bit
self.cwd = cwd
self.name: Optional[str] = None
self.name: str | None = None
self.engine = engine
def __enter__(self) -> "OCIContainer":
def __enter__(self) -> OCIContainer:
self.name = f"cibuildwheel-{uuid.uuid4()}"
@@ -122,9 +124,9 @@ class OCIContainer:
def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> None:
self.bash_stdin.write(b"exit 0\n")
@@ -217,7 +219,7 @@ class OCIContainer:
else:
raise KeyError(self.engine)
def glob(self, path: PurePosixPath, pattern: str) -> List[PurePosixPath]:
def glob(self, path: PurePosixPath, pattern: str) -> list[PurePosixPath]:
glob_pattern = path.joinpath(pattern)
path_strings = json.loads(
@@ -236,9 +238,9 @@ class OCIContainer:
def call(
self,
args: Sequence[PathOrStr],
env: Optional[Dict[str, str]] = None,
env: dict[str, str] | None = None,
capture_output: bool = False,
cwd: Optional[PathOrStr] = None,
cwd: PathOrStr | None = None,
) -> str:
if cwd is None:
@@ -314,7 +316,7 @@ class OCIContainer:
return output
def get_environment(self) -> Dict[str, str]:
def get_environment(self) -> dict[str, str]:
env = json.loads(
self.call(
[
@@ -327,7 +329,7 @@ class OCIContainer:
)
return cast(Dict[str, str], env)
def environment_executor(self, command: List[str], environment: Dict[str, str]) -> str:
def environment_executor(self, command: list[str], environment: dict[str, str]) -> str:
# used as an EnvironmentExecutor to evaluate commands and capture output
return self.call(command, env=environment, capture_output=True)
+107 -75
View File
@@ -1,23 +1,16 @@
from __future__ import annotations
import difflib
import functools
import os
import shlex
import sys
import traceback
from configparser import ConfigParser
from contextlib import contextmanager
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import (
Any,
Dict,
Generator,
List,
Mapping,
Optional,
Set,
Tuple,
Union,
cast,
)
from typing import Any, Callable, Dict, Generator, Iterator, List, Mapping, Union, cast
if sys.version_info >= (3, 11):
import tomllib
@@ -30,7 +23,7 @@ from .architecture import Architecture
from .environment import EnvironmentParseError, ParsedEnvironment, parse_environment
from .oci_container import ContainerEngine
from .projectfiles import get_requires_python_str
from .typing import PLATFORMS, Literal, PlatformName, TypedDict
from .typing import PLATFORMS, Literal, NotRequired, PlatformName, TypedDict
from .util import (
MANYLINUX_ARCHS,
MUSLLINUX_ARCHS,
@@ -49,9 +42,10 @@ from .util import (
@dataclass
class CommandLineArguments:
platform: Literal["auto", "linux", "macos", "windows"]
archs: Optional[str]
platform: Literal["auto", "linux", "macos", "windows"] | None
archs: str | None
output_dir: Path
only: str | None
config_file: str
package_dir: Path
print_build_identifiers: bool
@@ -65,7 +59,7 @@ class GlobalOptions:
output_dir: Path
build_selector: BuildSelector
test_selector: TestSelector
architectures: Set[Architecture]
architectures: set[Architecture]
container_engine: ContainerEngine
@@ -74,17 +68,18 @@ class BuildOptions:
globals: GlobalOptions
environment: ParsedEnvironment
before_all: str
before_build: Optional[str]
before_build: str | None
repair_command: str
manylinux_images: Optional[Dict[str, str]]
musllinux_images: Optional[Dict[str, str]]
dependency_constraints: Optional[DependencyConstraints]
test_command: Optional[str]
before_test: Optional[str]
test_requires: List[str]
manylinux_images: dict[str, str] | None
musllinux_images: dict[str, str] | None
dependency_constraints: DependencyConstraints | None
test_command: str | None
before_test: str | None
test_requires: list[str]
test_extras: str
build_verbosity: int
build_frontend: BuildFrontend
config_settings: str
@property
def package_dir(self) -> Path:
@@ -103,7 +98,7 @@ class BuildOptions:
return self.globals.test_selector
@property
def architectures(self) -> Set[Architecture]:
def architectures(self) -> set[Architecture]:
return self.globals.architectures
@@ -113,7 +108,7 @@ Setting = Union[Dict[str, str], List[str], str, int]
@dataclass(frozen=True)
class Override:
select_pattern: str
options: Dict[str, Setting]
options: dict[str, Setting]
MANYLINUX_OPTIONS = {f"manylinux-{build_platform}-image" for build_platform in MANYLINUX_ARCHS}
@@ -128,13 +123,14 @@ DISALLOWED_OPTIONS = {
class TableFmt(TypedDict):
item: str
sep: str
quote: NotRequired[Callable[[str], str]]
class ConfigOptionError(KeyError):
pass
def _dig_first(*pairs: Tuple[Mapping[str, Setting], str], ignore_empty: bool = False) -> Setting:
def _dig_first(*pairs: tuple[Mapping[str, Setting], str], ignore_empty: bool = False) -> Setting:
"""
Return the first dict item that matches from pairs of dicts and keys.
Will throw a KeyError if missing.
@@ -176,10 +172,10 @@ class OptionsReader:
def __init__(
self,
config_file_path: Optional[Path] = None,
config_file_path: Path | None = None,
*,
platform: PlatformName,
disallow: Optional[Dict[str, Set[str]]] = None,
disallow: dict[str, set[str]] | None = None,
) -> None:
self.platform = platform
self.disallow = disallow or {}
@@ -189,69 +185,76 @@ class OptionsReader:
self.default_options, self.default_platform_options = self._load_file(defaults_path)
# Load the project config file
config_options: Dict[str, Any] = {}
config_platform_options: Dict[str, Any] = {}
config_options: dict[str, Any] = {}
config_platform_options: dict[str, Any] = {}
if config_file_path is not None:
config_options, config_platform_options = self._load_file(config_file_path)
# Validate project config
for option_name in config_options:
if not self._is_valid_global_option(option_name):
raise ConfigOptionError(f'Option "{option_name}" not supported in a config file')
self._validate_global_option(option_name)
for option_name in config_platform_options:
if not self._is_valid_platform_option(option_name):
raise ConfigOptionError(
f'Option "{option_name}" not supported in the "{self.platform}" section'
)
self._validate_platform_option(option_name)
self.config_options = config_options
self.config_platform_options = config_platform_options
self.overrides: List[Override] = []
self.current_identifier: Optional[str] = None
self.overrides: list[Override] = []
self.current_identifier: str | None = None
config_overrides = self.config_options.get("overrides")
if config_overrides is not None:
if not isinstance(config_overrides, list):
raise ConfigOptionError('"tool.cibuildwheel.overrides" must be a list')
raise ConfigOptionError("'tool.cibuildwheel.overrides' must be a list")
for config_override in config_overrides:
select = config_override.pop("select", None)
if not select:
raise ConfigOptionError('"select" must be set in an override')
raise ConfigOptionError("'select' must be set in an override")
if isinstance(select, list):
select = " ".join(select)
self.overrides.append(Override(select, config_override))
def _is_valid_global_option(self, name: str) -> bool:
def _validate_global_option(self, name: str) -> None:
"""
Returns True if an option with this name is allowed in the
Raises an error if an option with this name is not allowed in the
[tool.cibuildwheel] section of a config file.
"""
allowed_option_names = self.default_options.keys() | PLATFORMS | {"overrides"}
return name in allowed_option_names
if name not in allowed_option_names:
msg = f"Option {name!r} not supported in a config file."
matches = difflib.get_close_matches(name, allowed_option_names, 1, 0.7)
if matches:
msg += f" Perhaps you meant {matches[0]!r}?"
raise ConfigOptionError(msg)
def _is_valid_platform_option(self, name: str) -> bool:
def _validate_platform_option(self, name: str) -> None:
"""
Returns True if an option with this name is allowed in the
Raises an error if an option with this name is not allowed in the
[tool.cibuildwheel.<current-platform>] section of a config file.
"""
disallowed_platform_options = self.disallow.get(self.platform, set())
if name in disallowed_platform_options:
return False
msg = f"{name!r} is not allowed in {disallowed_platform_options}"
raise ConfigOptionError(msg)
allowed_option_names = self.default_options.keys() | self.default_platform_options.keys()
return name in allowed_option_names
if name not in allowed_option_names:
msg = f"Option {name!r} not supported in the {self.platform!r} section"
matches = difflib.get_close_matches(name, allowed_option_names, 1, 0.7)
if matches:
msg += f" Perhaps you meant {matches[0]!r}?"
raise ConfigOptionError(msg)
def _load_file(self, filename: Path) -> Tuple[Dict[str, Any], Dict[str, Any]]:
def _load_file(self, filename: Path) -> tuple[dict[str, Any], dict[str, Any]]:
"""
Load a toml file, returns global and platform as separate dicts.
"""
@@ -264,7 +267,7 @@ class OptionsReader:
return global_options, platform_options
@property
def active_config_overrides(self) -> List[Override]:
def active_config_overrides(self) -> list[Override]:
if self.current_identifier is None:
return []
return [
@@ -272,7 +275,7 @@ class OptionsReader:
]
@contextmanager
def identifier(self, identifier: Optional[str]) -> Generator[None, None, None]:
def identifier(self, identifier: str | None) -> Generator[None, None, None]:
self.current_identifier = identifier
try:
yield
@@ -284,8 +287,8 @@ class OptionsReader:
name: str,
*,
env_plat: bool = True,
sep: Optional[str] = None,
table: Optional[TableFmt] = None,
sep: str | None = None,
table: TableFmt | None = None,
ignore_empty: bool = False,
) -> str:
"""
@@ -294,12 +297,14 @@ class OptionsReader:
accept platform versions of the environment variable. If this is an
array it will be merged with "sep" before returning. If it is a table,
it will be formatted with "table['item']" using {k} and {v} and merged
with "table['sep']". Empty variables will not override if ignore_empty
is True.
with "table['sep']". If sep is also given, it will be used for arrays
inside the table (must match table['sep']). Empty variables will not
override if ignore_empty is True.
"""
if name not in self.default_options and name not in self.default_platform_options:
raise ConfigOptionError(f"{name} must be in cibuildwheel/resources/defaults.toml file")
msg = f"{name!r} must be in cibuildwheel/resources/defaults.toml file to be accessed."
raise ConfigOptionError(msg)
# Environment variable form
envvar = f"CIBW_{name.upper().replace('-', '_')}"
@@ -323,12 +328,14 @@ class OptionsReader:
if isinstance(result, dict):
if table is None:
raise ConfigOptionError(f"{name} does not accept a table")
return table["sep"].join(table["item"].format(k=k, v=v) for k, v in result.items())
raise ConfigOptionError(f"{name!r} does not accept a table")
return table["sep"].join(
item for k, v in result.items() for item in _inner_fmt(k, v, table)
)
if isinstance(result, list):
if sep is None:
raise ConfigOptionError(f"{name} does not accept a list")
raise ConfigOptionError(f"{name!r} does not accept a list")
return sep.join(result)
if isinstance(result, int):
@@ -337,6 +344,18 @@ class OptionsReader:
return result
def _inner_fmt(k: str, v: Any, table: TableFmt) -> Iterator[str]:
quote_function = table.get("quote", lambda a: a)
if isinstance(v, list):
for inner_v in v:
qv = quote_function(inner_v)
yield table["item"].format(k=k, v=qv)
else:
qv = quote_function(v)
yield table["item"].format(k=k, v=qv)
class Options:
def __init__(self, platform: PlatformName, command_line_arguments: CommandLineArguments):
self.platform = platform
@@ -349,7 +368,7 @@ class Options:
)
@property
def config_file_path(self) -> Optional[Path]:
def config_file_path(self) -> Path | None:
args = self.command_line_arguments
if args.config_file:
@@ -363,7 +382,7 @@ class Options:
return None
@cached_property
def package_requires_python_str(self) -> Optional[str]:
def package_requires_python_str(self) -> str | None:
args = self.command_line_arguments
return get_requires_python_str(Path(args.package_dir))
@@ -383,11 +402,20 @@ class Options:
# This is not supported in tool.cibuildwheel, as it comes from a standard location.
# Passing this in as an environment variable will override pyproject.toml, setup.cfg, or setup.py
requires_python_str: Optional[str] = (
requires_python_str: str | None = (
os.environ.get("CIBW_PROJECT_REQUIRES_PYTHON") or self.package_requires_python_str
)
requires_python = None if requires_python_str is None else SpecifierSet(requires_python_str)
archs_config_str = args.archs or self.reader.get("archs", sep=" ")
architectures = Architecture.parse_config(archs_config_str, platform=self.platform)
# Process `--only`
if args.only:
build_config = args.only
skip_config = ""
architectures = Architecture.all_archs(self.platform)
build_selector = BuildSelector(
build_config=build_config,
skip_config=skip_config,
@@ -396,13 +424,10 @@ class Options:
)
test_selector = TestSelector(skip_config=test_skip)
archs_config_str = args.archs or self.reader.get("archs", sep=" ")
architectures = Architecture.parse_config(archs_config_str, platform=self.platform)
container_engine_str = self.reader.get("container-engine")
if container_engine_str not in ["docker", "podman"]:
msg = f"cibuildwheel: Unrecognised container_engine '{container_engine_str}', only 'docker' and 'podman' are supported"
msg = f"cibuildwheel: Unrecognised container_engine {container_engine_str!r}, only 'docker' and 'podman' are supported"
print(msg, file=sys.stderr)
sys.exit(2)
@@ -417,7 +442,7 @@ class Options:
container_engine=container_engine,
)
def build_options(self, identifier: Optional[str]) -> BuildOptions:
def build_options(self, identifier: str | None) -> BuildOptions:
"""
Compute BuildOptions for a single run configuration.
"""
@@ -432,6 +457,9 @@ class Options:
environment_pass = self.reader.get("environment-pass", sep=" ").split()
before_build = self.reader.get("before-build", sep=" && ")
repair_command = self.reader.get("repair-wheel-command", sep=" && ")
config_settings = self.reader.get(
"config-settings", table={"item": "{k}={v}", "sep": " ", "quote": shlex.quote}
)
dependency_versions = self.reader.get("dependency-versions")
test_command = self.reader.get("test-command", sep=" && ")
@@ -446,7 +474,7 @@ class Options:
elif build_frontend_str == "pip":
build_frontend = "pip"
else:
msg = f"cibuildwheel: Unrecognised build frontend '{build_frontend_str}', only 'pip' and 'build' are supported"
msg = f"cibuildwheel: Unrecognised build frontend {build_frontend_str!r}, only 'pip' and 'build' are supported"
print(msg, file=sys.stderr)
sys.exit(2)
@@ -454,7 +482,7 @@ class Options:
environment = parse_environment(environment_config)
except (EnvironmentParseError, ValueError):
print(
f'cibuildwheel: Malformed environment option "{environment_config}"',
f"cibuildwheel: Malformed environment option {environment_config!r}",
file=sys.stderr,
)
traceback.print_exc(None, sys.stderr)
@@ -469,9 +497,9 @@ class Options:
pass
if dependency_versions == "pinned":
dependency_constraints: Optional[
dependency_constraints: None | (
DependencyConstraints
] = DependencyConstraints.with_defaults()
) = DependencyConstraints.with_defaults()
elif dependency_versions == "latest":
dependency_constraints = None
else:
@@ -486,8 +514,8 @@ class Options:
except ValueError:
build_verbosity = 0
manylinux_images: Dict[str, str] = {}
musllinux_images: Dict[str, str] = {}
manylinux_images: dict[str, str] = {}
musllinux_images: dict[str, str] = {}
if self.platform == "linux":
all_pinned_container_images = _get_pinned_container_images()
@@ -537,9 +565,10 @@ class Options:
manylinux_images=manylinux_images or None,
musllinux_images=musllinux_images or None,
build_frontend=build_frontend,
config_settings=config_settings,
)
def check_for_invalid_configuration(self, identifiers: List[str]) -> None:
def check_for_invalid_configuration(self, identifiers: list[str]) -> None:
if self.platform in ["macos", "windows"]:
before_all_values = {self.build_options(i).before_all for i in identifiers}
@@ -562,13 +591,16 @@ class Options:
deprecated_selectors("CIBW_SKIP", build_selector.skip_config)
deprecated_selectors("CIBW_TEST_SKIP", test_selector.skip_config)
def summary(self, identifiers: List[str]) -> str:
def summary(self, identifiers: list[str]) -> str:
lines = [
f"{option_name}: {option_value!r}"
for option_name, option_value in sorted(asdict(self.globals).items())
]
build_option_defaults = self.build_options(identifier=None)
build_options_for_identifier = {
identifier: self.build_options(identifier) for identifier in identifiers
}
for option_name, default_value in sorted(asdict(build_option_defaults).items()):
if option_name == "globals":
@@ -578,7 +610,7 @@ class Options:
# if any identifiers have an overridden value, print that too
for identifier in identifiers:
option_value = getattr(self.build_options(identifier=identifier), option_name)
option_value = getattr(build_options_for_identifier[identifier], option_name)
if option_value != default_value:
lines.append(f" {identifier}: {option_value!r}")
+6 -4
View File
@@ -1,8 +1,10 @@
from __future__ import annotations
import ast
import sys
from configparser import ConfigParser
from pathlib import Path
from typing import Any, Optional
from typing import Any
if sys.version_info >= (3, 11):
import tomllib
@@ -24,7 +26,7 @@ else:
class Analyzer(ast.NodeVisitor):
def __init__(self) -> None:
self.requires_python: Optional[str] = None
self.requires_python: str | None = None
def visit(self, node: ast.AST) -> None:
for inner_node in ast.walk(node):
@@ -43,7 +45,7 @@ class Analyzer(ast.NodeVisitor):
self.requires_python = get_constant(node.value)
def setup_py_python_requires(content: str) -> Optional[str]:
def setup_py_python_requires(content: str) -> str | None:
try:
tree = ast.parse(content)
analyzer = Analyzer()
@@ -53,7 +55,7 @@ def setup_py_python_requires(content: str) -> Optional[str]:
return None
def get_requires_python_str(package_dir: Path) -> Optional[str]:
def get_requires_python_str(package_dir: Path) -> str | None:
"""Return the python requires string from the most canonical source available, or None"""
# Read in from pyproject.toml:project.requires-python
+12 -12
View File
@@ -81,12 +81,12 @@ python_configurations = [
{ identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
{ identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
{ identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
{ identifier = "cp310-macosx_x86_64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg" },
{ identifier = "cp310-macosx_arm64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg" },
{ identifier = "cp310-macosx_universal2", version = "3.10", url = "https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg" },
{ identifier = "cp311-macosx_x86_64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0b4-macos11.pkg" },
{ identifier = "cp311-macosx_arm64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0b4-macos11.pkg" },
{ identifier = "cp311-macosx_universal2", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0b4-macos11.pkg" },
{ identifier = "cp310-macosx_x86_64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.7/python-3.10.7-macos11.pkg" },
{ identifier = "cp310-macosx_arm64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.7/python-3.10.7-macos11.pkg" },
{ identifier = "cp310-macosx_universal2", version = "3.10", url = "https://www.python.org/ftp/python/3.10.7/python-3.10.7-macos11.pkg" },
{ identifier = "cp311-macosx_x86_64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2-macos11.pkg" },
{ identifier = "cp311-macosx_arm64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2-macos11.pkg" },
{ identifier = "cp311-macosx_universal2", version = "3.11", url = "https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2-macos11.pkg" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2" },
{ identifier = "pp38-macosx_x86_64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.9-osx64.tar.bz2" },
{ identifier = "pp39-macosx_x86_64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.9-osx64.tar.bz2" },
@@ -102,13 +102,13 @@ python_configurations = [
{ identifier = "cp38-win_amd64", version = "3.8.10", arch = "64" },
{ identifier = "cp39-win32", version = "3.9.13", arch = "32" },
{ identifier = "cp39-win_amd64", version = "3.9.13", arch = "64" },
{ identifier = "cp310-win32", version = "3.10.5", arch = "32" },
{ identifier = "cp310-win_amd64", version = "3.10.5", arch = "64" },
{ identifier = "cp311-win32", version = "3.11.0-b4", arch = "32" },
{ identifier = "cp311-win_amd64", version = "3.11.0-b4", arch = "64" },
{ identifier = "cp310-win32", version = "3.10.7", arch = "32" },
{ identifier = "cp310-win_amd64", version = "3.10.7", arch = "64" },
{ identifier = "cp311-win32", version = "3.11.0-rc2", arch = "32" },
{ identifier = "cp311-win_amd64", version = "3.11.0-rc2", arch = "64" },
{ identifier = "cp39-win_arm64", version = "3.9.10", arch = "ARM64" },
{ identifier = "cp310-win_arm64", version = "3.10.5", arch = "ARM64" },
{ identifier = "cp311-win_arm64", version = "3.11.0-b4", arch = "ARM64" },
{ identifier = "cp310-win_arm64", version = "3.10.7", arch = "ARM64" },
{ identifier = "cp311-win_arm64", version = "3.11.0-rc2", arch = "ARM64" },
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip" },
{ identifier = "pp38-win_amd64", version = "3.8", arch = "64", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.9-win64.zip" },
{ identifier = "pp39-win_amd64", version = "3.9", arch = "64", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.9-win64.zip" },
@@ -2,21 +2,19 @@
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.10
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via delocate
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -24,7 +22,7 @@ wheel==0.37.1
# delocate
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
@@ -2,21 +2,19 @@
# This file is autogenerated by pip-compile with python 3.11
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.11
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via delocate
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -24,7 +22,7 @@ wheel==0.37.1
# delocate
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
@@ -2,11 +2,11 @@
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.6
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.4.1
# via virtualenv
@@ -16,13 +16,11 @@ importlib-resources==5.4.0
# via virtualenv
platformdirs==2.4.0
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.1.1
# via
# delocate
# importlib-metadata
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -2,25 +2,23 @@
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.7
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
importlib-metadata==4.12.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via
# delocate
# importlib-metadata
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -30,7 +28,7 @@ zipp==3.8.1
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
@@ -2,21 +2,19 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.8
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via delocate
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -24,7 +22,7 @@ wheel==0.37.1
# delocate
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
@@ -2,21 +2,19 @@
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.9
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via delocate
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -24,7 +22,7 @@ wheel==0.37.1
# delocate
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
+7 -9
View File
@@ -1,22 +1,20 @@
#
# This file is autogenerated by pip-compile with python 3.9
# This file is autogenerated by pip-compile with python 3.11
# To update, run:
#
# bin/update_dependencies.py
# nox -s update_constraints-3.11
#
delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.5
distlib==0.3.6
# via virtualenv
filelock==3.7.1
filelock==3.8.0
# via virtualenv
platformdirs==2.5.2
# via virtualenv
six==1.16.0
# via virtualenv
typing-extensions==4.3.0
# via delocate
virtualenv==20.15.1
virtualenv==20.16.5
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.1
# via
@@ -24,7 +22,7 @@ wheel==0.37.1
# delocate
# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==22.2.2
# via -r cibuildwheel/resources/constraints.in
setuptools==63.2.0
setuptools==65.3.0
# via -r cibuildwheel/resources/constraints.in
+1
View File
@@ -5,6 +5,7 @@ test-skip = ""
archs = ["auto"]
build-frontend = "pip"
config-settings = {}
dependency-versions = "pinned"
environment = {}
environment-pass = []
+33 -32
View File
@@ -1,48 +1,49 @@
[x86_64]
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-07-17-f8ddacc
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-07-17-51324db
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-07-17-51324db
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-07-17-51324db
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-09-07-2e53e4b
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-08-05-4535177
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-09-12-1a61614
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-09-12-1a61614
[i686]
manylinux1 = quay.io/pypa/manylinux1_i686:2022-07-17-f8ddacc
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-07-17-51324db
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-07-17-51324db
manylinux1 = quay.io/pypa/manylinux1_i686:2022-09-07-2e53e4b
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-08-05-4535177
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-09-12-1a61614
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-09-12-1a61614
[pypy_x86_64]
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-07-17-51324db
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-07-17-51324db
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-08-05-4535177
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-09-12-1a61614
[pypy_i686]
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-07-17-51324db
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-08-05-4535177
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-09-12-1a61614
[aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-07-17-51324db
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-07-17-51324db
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-09-12-1a61614
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-09-12-1a61614
[ppc64le]
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-07-17-51324db
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-07-17-51324db
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-09-12-1a61614
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-09-12-1a61614
[s390x]
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-07-17-51324db
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_s390x:2022-09-12-1a61614
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-09-12-1a61614
[pypy_aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-07-17-51324db
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-07-17-51324db
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-07-17-51324db
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-09-12-1a61614
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-09-12-1a61614
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-09-12-1a61614
+2 -2
View File
@@ -1,2 +1,2 @@
version = "20.15.1"
url = "https://github.com/pypa/get-virtualenv/blob/20.15.1/public/virtualenv.pyz?raw=true"
version = "20.16.5"
url = "https://github.com/pypa/get-virtualenv/blob/20.16.5/public/virtualenv.pyz?raw=true"
+8 -1
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import os
import subprocess
import sys
@@ -8,6 +10,10 @@ if sys.version_info < (3, 8):
else:
from typing import Final, Literal, OrderedDict, Protocol, TypedDict
if sys.version_info < (3, 11):
from typing_extensions import NotRequired
else:
from typing import NotRequired
__all__ = (
"Final",
@@ -24,6 +30,7 @@ __all__ = (
"OrderedDict",
"Union",
"assert_never",
"NotRequired",
)
@@ -36,7 +43,7 @@ else:
PlatformName = Literal["linux", "macos", "windows"]
PLATFORMS: Final[Set[PlatformName]] = {"linux", "macos", "windows"}
PLATFORMS: Final[set[PlatformName]] = {"linux", "macos", "windows"}
def assert_never(value: NoReturn) -> NoReturn:
+43 -38
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import contextlib
import fnmatch
import itertools
@@ -18,15 +20,11 @@ from time import sleep
from typing import (
Any,
ClassVar,
Dict,
Generator,
Iterable,
List,
Optional,
Sequence,
TextIO,
TypeVar,
Union,
cast,
overload,
)
@@ -62,15 +60,16 @@ __all__ = [
"strtobool",
"cached_property",
"chdir",
"split_config_settings",
]
resources_dir: Final = Path(__file__).parent / "resources"
resources_dir: Final[Path] = Path(__file__).parent / "resources"
install_certifi_script: Final = resources_dir / "install_certifi.py"
install_certifi_script: Final[Path] = resources_dir / "install_certifi.py"
BuildFrontend = Literal["pip", "build"]
MANYLINUX_ARCHS: Final = (
MANYLINUX_ARCHS: Final[tuple[str, ...]] = (
"x86_64",
"i686",
"pypy_x86_64",
@@ -81,7 +80,7 @@ MANYLINUX_ARCHS: Final = (
"pypy_i686",
)
MUSLLINUX_ARCHS: Final = (
MUSLLINUX_ARCHS: Final[tuple[str, ...]] = (
"x86_64",
"i686",
"aarch64",
@@ -89,17 +88,19 @@ MUSLLINUX_ARCHS: Final = (
"s390x",
)
DEFAULT_CIBW_CACHE_PATH: Final = user_cache_path(appname="cibuildwheel", appauthor="pypa")
CIBW_CACHE_PATH: Final = Path(os.environ.get("CIBW_CACHE_PATH", DEFAULT_CIBW_CACHE_PATH)).resolve()
DEFAULT_CIBW_CACHE_PATH: Final[Path] = user_cache_path(appname="cibuildwheel", appauthor="pypa")
CIBW_CACHE_PATH: Final[Path] = Path(
os.environ.get("CIBW_CACHE_PATH", DEFAULT_CIBW_CACHE_PATH)
).resolve()
IS_WIN: Final = sys.platform.startswith("win")
IS_WIN: Final[bool] = sys.platform.startswith("win")
@overload
def call(
*args: PathOrStr,
env: Optional[Dict[str, str]] = None,
cwd: Optional[PathOrStr] = None,
env: dict[str, str] | None = None,
cwd: PathOrStr | None = None,
capture_stdout: Literal[False] = ...,
) -> None:
...
@@ -108,8 +109,8 @@ def call(
@overload
def call(
*args: PathOrStr,
env: Optional[Dict[str, str]] = None,
cwd: Optional[PathOrStr] = None,
env: dict[str, str] | None = None,
cwd: PathOrStr | None = None,
capture_stdout: Literal[True],
) -> str:
...
@@ -117,10 +118,10 @@ def call(
def call(
*args: PathOrStr,
env: Optional[Dict[str, str]] = None,
cwd: Optional[PathOrStr] = None,
env: dict[str, str] | None = None,
cwd: PathOrStr | None = None,
capture_stdout: bool = False,
) -> Optional[str]:
) -> str | None:
"""
Run subprocess.run, but print the commands first. Takes the commands as
*args. Uses shell=True on Windows due to a bug. Also converts to
@@ -130,7 +131,7 @@ def call(
args_ = [str(arg) for arg in args]
# print the command executing for the logs
print("+ " + " ".join(shlex.quote(a) for a in args_))
kwargs: Dict[str, Any] = {}
kwargs: dict[str, Any] = {}
if capture_stdout:
kwargs["universal_newlines"] = True
kwargs["stdout"] = subprocess.PIPE
@@ -140,15 +141,13 @@ def call(
return cast(str, result.stdout)
def shell(
*commands: str, env: Optional[Dict[str, str]] = None, cwd: Optional[PathOrStr] = None
) -> None:
def shell(*commands: str, env: dict[str, str] | None = None, cwd: PathOrStr | None = None) -> None:
command = " ".join(commands)
print(f"+ {command}")
subprocess.run(command, env=env, cwd=cwd, shell=True, check=True)
def format_safe(template: str, **kwargs: Any) -> str:
def format_safe(template: str, **kwargs: str | os.PathLike[str]) -> str:
"""
Works similarly to `template.format(**kwargs)`, except that unmatched
fields in `template` are passed through untouched.
@@ -176,11 +175,9 @@ def format_safe(template: str, **kwargs: Any) -> str:
re.VERBOSE,
)
# we use a function for repl to prevent re.sub interpreting backslashes
# in repl as escape sequences.
result = re.sub(
pattern=find_pattern,
repl=lambda _: str(value), # pylint: disable=cell-var-from-loop
repl=str(value).replace("\\", r"\\"),
string=result,
)
@@ -200,7 +197,7 @@ def prepare_command(command: str, **kwargs: PathOrStr) -> str:
return format_safe(command, python="python", pip="pip", **kwargs)
def get_build_verbosity_extra_flags(level: int) -> List[str]:
def get_build_verbosity_extra_flags(level: int) -> list[str]:
if level > 0:
return ["-" + level * "v"]
elif level < 0:
@@ -209,11 +206,16 @@ def get_build_verbosity_extra_flags(level: int) -> List[str]:
return []
def read_python_configs(config: PlatformName) -> List[Dict[str, str]]:
def split_config_settings(config_settings: str) -> list[str]:
config_settings_list = shlex.split(config_settings)
return [f"--config-setting={setting}" for setting in config_settings_list]
def read_python_configs(config: PlatformName) -> list[dict[str, str]]:
input_file = resources_dir / "build-platforms.toml"
with input_file.open("rb") as f:
loaded_file = tomllib.load(f)
results: List[Dict[str, str]] = list(loaded_file[config]["python_configurations"])
results: list[dict[str, str]] = list(loaded_file[config]["python_configurations"])
return results
@@ -243,10 +245,10 @@ class BuildSelector:
build_config: str
skip_config: str
requires_python: Optional[SpecifierSet] = None
requires_python: SpecifierSet | None = None
# a pattern that skips prerelease versions, when include_prereleases is False.
PRERELEASE_SKIP: ClassVar[str] = "cp311-*"
PRERELEASE_SKIP: ClassVar[str] = ""
prerelease_pythons: bool = False
def __call__(self, build_id: str) -> bool:
@@ -328,7 +330,7 @@ class DependencyConstraints:
self.base_file_path = base_file_path.resolve()
@staticmethod
def with_defaults() -> "DependencyConstraints":
def with_defaults() -> DependencyConstraints:
return DependencyConstraints(base_file_path=resources_dir / "constraints.txt")
def get_for_python_version(self, version: str) -> Path:
@@ -397,10 +399,11 @@ class CIProvider(Enum):
azure_pipelines = "azure_pipelines"
github_actions = "github_actions"
gitlab = "gitlab"
cirrus_ci = "cirrus_ci"
other = "other"
def detect_ci_provider() -> Optional[CIProvider]:
def detect_ci_provider() -> CIProvider | None:
if "TRAVIS" in os.environ:
return CIProvider.travis_ci
elif "APPVEYOR" in os.environ:
@@ -413,6 +416,8 @@ def detect_ci_provider() -> Optional[CIProvider]:
return CIProvider.github_actions
elif "GITLAB_CI" in os.environ:
return CIProvider.gitlab
elif "CIRRUS_CI" in os.environ:
return CIProvider.cirrus_ci
elif strtobool(os.environ.get("CI", "false")):
return CIProvider.other
else:
@@ -473,7 +478,7 @@ def print_new_wheels(msg: str, output_dir: Path) -> Generator[None, None, None]:
)
def get_pip_version(env: Dict[str, str]) -> str:
def get_pip_version(env: dict[str, str]) -> str:
versions_output_text = call(
"python", "-m", "pip", "freeze", "--all", capture_stdout=True, env=env
)
@@ -501,7 +506,7 @@ def _ensure_virtualenv() -> Path:
def _parse_constraints_for_virtualenv(
dependency_constraint_flags: Sequence[PathOrStr],
) -> Dict[str, str]:
) -> dict[str, str]:
"""
Parses the constraints file referenced by `dependency_constraint_flags` and returns a dict where
the key is the package name, and the value is the constraint version.
@@ -547,7 +552,7 @@ def _parse_constraints_for_virtualenv(
def virtualenv(
python: Path, venv_path: Path, dependency_constraint_flags: Sequence[PathOrStr]
) -> Dict[str, str]:
) -> dict[str, str]:
assert python.exists()
virtualenv_app = _ensure_virtualenv()
constraints = _parse_constraints_for_virtualenv(dependency_constraint_flags)
@@ -589,7 +594,7 @@ def virtualenv(
T = TypeVar("T", bound=PurePath)
def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> Optional[T]:
def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> T | None:
"""
Finds a wheel with an abi3 or a none ABI tag in `wheels` compatible with the Python interpreter
specified by `identifier` that is previously built.
@@ -641,7 +646,7 @@ else:
# Can be replaced by contextlib.chdir in Python 3.11
@contextlib.contextmanager
def chdir(new_path: Union[Path, str]) -> Generator[None, None, None]:
def chdir(new_path: Path | str) -> Generator[None, None, None]:
"""Non thread-safe context manager to change the current working directory."""
cwd = os.getcwd()
+16 -10
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import os
import shutil
import subprocess
@@ -5,7 +7,7 @@ import sys
from dataclasses import dataclass
from functools import lru_cache
from pathlib import Path
from typing import Dict, List, Optional, Sequence, Set
from typing import Sequence
from zipfile import ZipFile
from filelock import FileLock
@@ -30,11 +32,12 @@ from .util import (
prepare_command,
read_python_configs,
shell,
split_config_settings,
virtualenv,
)
def get_nuget_args(version: str, arch: str, output_directory: Path) -> List[str]:
def get_nuget_args(version: str, arch: str, output_directory: Path) -> list[str]:
platform_suffix = {"32": "x86", "64": "", "ARM64": "arm64"}
python_name = "python" + platform_suffix[arch]
return [
@@ -53,13 +56,13 @@ class PythonConfiguration:
version: str
arch: str
identifier: str
url: Optional[str] = None
url: str | None = None
def get_python_configurations(
build_selector: BuildSelector,
architectures: Set[Architecture],
) -> List[PythonConfiguration]:
architectures: set[Architecture],
) -> list[PythonConfiguration]:
full_python_configs = read_python_configs("windows")
@@ -124,7 +127,7 @@ def setup_python(
dependency_constraint_flags: Sequence[PathOrStr],
environment: ParsedEnvironment,
build_frontend: BuildFrontend,
) -> Dict[str, str]:
) -> dict[str, str]:
tmp.mkdir()
implementation_id = python_configuration.identifier.split("-")[0]
log.step(f"Installing Python {implementation_id}...")
@@ -253,7 +256,7 @@ def build(options: Options, tmp_path: Path) -> None:
)
shell(before_all_prepared, env=env)
built_wheels: List[Path] = []
built_wheels: list[Path] = []
for config in python_configurations:
build_options = options.build_options(config.identifier)
@@ -300,8 +303,10 @@ def build(options: Options, tmp_path: Path) -> None:
built_wheel_dir.mkdir()
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings)
if build_options.build_frontend == "pip":
extra_flags += verbosity_flags
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
# see https://github.com/pypa/cibuildwheel/pull/369
call(
@@ -312,11 +317,12 @@ def build(options: Options, tmp_path: Path) -> None:
options.globals.package_dir.resolve(),
f"--wheel-dir={built_wheel_dir}",
"--no-deps",
*get_build_verbosity_extra_flags(build_options.build_verbosity),
*extra_flags,
env=env,
)
elif build_options.build_frontend == "build":
config_setting = " ".join(verbosity_flags)
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
build_env = env.copy()
if build_options.dependency_constraints:
constraints_path = (
@@ -343,7 +349,7 @@ def build(options: Options, tmp_path: Path) -> None:
build_options.package_dir,
"--wheel",
f"--outdir={built_wheel_dir}",
f"--config-setting={config_setting}",
*extra_flags,
env=build_env,
)
else:
+29
View File
@@ -2,6 +2,35 @@
title: Changelog
---
# Changelog
### v2.10.1
_18 September 2022_
- 🐛 Fix a bug that stopped environment variables specified in TOML from being expanded. (#1273)
### v2.10.0
_13 September 2022_
- 🌟 Adds support for [building wheels on Cirrus CI](https://cibuildwheel.readthedocs.io/en/stable/setup/#cirrus-ci). This is exciting for us, as it's the first public CI platform that natively supports macOS Apple Silicon (aka. M1, `arm64`) runners. As such, it's the first platform that you can natively build _and test_ macOS `arm64` wheels. It also has native Linux ARM (aarch64) runners, for fast, native builds there. (#1191)
- 🌟 Adds support for running cibuildwheel on Apple Silicon machines. For a while, we've supported cross-compilation of Apple Silicon wheels on `x86_64`, but now that we have Cirrus CI we can run our test suite and officially support running cibuildwheel on `arm64`. (#1191)
- ✨ Adds the `--only` [command line option](https://cibuildwheel.readthedocs.io/en/stable/options/#command-line), to specify a single build to run. Previously, it could be cumbersome to set all the build selection options to target a specific build - for example, you might have to run something like `CIBW_BUILD=cp39-manylinux_x86_64 cibuildwheel --platform linux --archs x86_64`. The new `--only` option overrides all the build selection options to simplify running a single build, which now looks like `cibuildwheel --only cp39-manylinux_x86_64`. (#1098)
- ✨ Adds the [`CIBW_CONFIG_SETTINGS`](https://cibuildwheel.readthedocs.io/en/stable/options/#config-settings) option, so you can pass arguments to your package's build backend (#1244)
- 🛠 Updates the CPython 3.11 version to the latest release candidate - v3.11.0rc2. (#1265)
- 🐛 Fix a bug that can cause a RecursionError on Windows when building from an sdist. (#1253)
- 🛠 Add support for the s390x architecture on manylinux_2_28 (#1255)
### v2.9.0
_11 August 2022_
- 🌟 CPython 3.11 wheels are now built by default - without the CIBW_PRERELEASE_PYTHONS flag. It's time to build and upload these wheels to PyPI! This release includes CPython 3.11.0rc1, which is guaranteed to be ABI compatible with the final release. (#1226)
- ⚠️ Removed support for running cibuildwheel in Python 3.6. Python 3.6 is EOL. However, cibuildwheel continues to build CPython 3.6 wheels for the moment. (#1175)
- ✨ Improved error messages when misspelling TOML options, suggesting close matches (#1205)
- 🛠 When running on Apple Silicon (so far, an unsupported mode of operation), cibuildwheel no longer builds universal2 wheels by default - just arm64. See [#1204](https://github.com/pypa/cibuildwheel/issues/1204) for discussion. We hope to release official support for native builds on Apple Silicon soon! (#1217)
### v2.8.1
_18 July 2022_
+2 -2
View File
@@ -2,6 +2,8 @@
title: Contributing
---
# Contributing
Wheel-building can be pretty complex. We expect users to find edge-cases - please help the rest of the community out by documenting these, adding features to support them, and reporting bugs.
If you have an idea for a modification or feature, it's probably best to raise an issue first and discuss it with the maintainer team. Once we have rough consensus on a design, begin work in a PR.
@@ -94,7 +96,6 @@ This has been moved to using docker, so you only need the following instructions
The dependency update script in the next section requires multiple python versions installed. One way to do this is to use `pyenv`:
```bash
pyenv install 3.6.11
pyenv install 3.7.8
# Optionally add 3.8 and make it the local version;
# otherwise assuming 3.8+ already is your current python version
@@ -103,7 +104,6 @@ pyenv install 3.7.8
Then, you need to make the required virtual environments:
```bash
$(pyenv prefix 3.6.11)/bin/python -m venv env36
$(pyenv prefix 3.7.8)/bin/python -m venv env37
```
+2
View File
@@ -2,6 +2,8 @@
title: Modern C++ standards
---
# Modern C++ standards
Building Python wheels with modern C++ standards (C++11 and later) requires a few tricks.
+20 -1
View File
@@ -4,7 +4,7 @@
# stars: GitHub repo (optional, if different from package, such as for Twisted)
# pypi: The pypi name, if different from the GitHub package name
# os: Operating system list, [windows, apple, linux] (optional)
# ci: [appveyor, github, azurepipelines, circleci, gitlab, travisci] (optional)
# ci: [appveyor, github, azurepipelines, circleci, gitlab, travisci, cirrusci] (optional)
# notes: (text, optional)
- name: abess
@@ -594,3 +594,22 @@
gh: SciTools/cf-units
ci: [github]
os: [apple, linux]
- name: envd
gh: tensorchord/envd
ci: [github]
os: [apple, linux, windows]
note: A machine learning development environment build toool
- name: mosec
gh: mosecorg/mosec
ci: [github]
os: [linux, apple]
note: A machine learning model serving framework powered by Rust
- name: ril
gh: Cryptex-github/ril-py
ci: [github]
os: [windows, apple, linux]
pypi: pyril
notes: A python binding to Rust Imaging library using maturin and Pyo3, utilizes Github Action cache to improve speed. Builds abi3 wheels.
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24" width="16px" fill="#606060"><title>Cirrus CI icon</title><path d="M19.422.453a1.113 1.113 0 0 0-1.113 1.115 1.113 1.113 0 0 0 1.112 1.114c1.31 0 2.35 1.042 2.35 2.363 0 1.32-1.04 2.363-2.35 2.363H1.112A1.113 1.113 0 0 0 0 8.52a1.113 1.113 0 0 0 1.113 1.117h18.31c1.308 0 2.35 1.042 2.35 2.363 0 1.32-1.042 2.363-2.35 2.363H1.112A1.113 1.113 0 0 0 0 15.48a1.113 1.113 0 0 0 1.113 1.112h18.31c1.308 0 2.35 1.042 2.35 2.363 0 1.32-1.042 2.363-2.35 2.363H1.112A1.113 1.113 0 0 0 0 22.432a1.113 1.113 0 0 0 1.113 1.115h18.31a1.113 1.113 0 0 0 .206-.022c2.42-.112 4.37-2.12 4.37-4.57 0-1.393-.642-2.634-1.63-3.478C23.356 14.632 24 13.393 24 12c0-1.393-.643-2.632-1.63-3.477C23.357 7.68 24 6.438 24 5.045c0-2.52-2.06-4.592-4.578-4.592z"/></svg>

After

Width:  |  Height:  |  Size: 808 B

+2
View File
@@ -2,6 +2,8 @@
title: Delivering to PyPI
---
# Delivering to PyPI
After you've built your wheels, you'll probably want to deliver them to PyPI.
## Manual method
+91 -2
View File
@@ -4,6 +4,7 @@
body {
overflow-wrap: break-word;
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
}
p {
@@ -62,6 +63,13 @@ h1, h2, h3, h4, h5, h6 {
border: none;
}
@media screen and (max-width: 768px) {
.wy-nav-content-wrap .wy-nav-content {
padding: 1em;
}
}
/*
Code block filename style
@@ -105,10 +113,10 @@ h1, h2, h3, h4, h5, h6 {
.code-block-filename + pre code {
padding-top: 0.9em;
}
/*
.toctree-l3 {
border-left: 10px solid transparent;
}
} */
/* import font awesome 4 for icons */
@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css);
@@ -226,3 +234,84 @@ h1, h2, h3, h4, h5, h6 {
padding-right: 0;
margin-bottom: 0.5em;
}
/* mkdocs update theme fix-ups */
.rst-content code, .rst-content tt, code {
/* border: none; */
/* background-color: #f0f1f1; */
color: inherit;
}
.rst-content pre code {
border: none;
}
.rst-content h1 code,
.rst-content h2 code,
.rst-content h3 code,
.rst-content h4 code,
.rst-content h5 code,
.rst-content h6 code {
border: none;
color: inherit;
background-color: #f0f1f1;
font-size: 100%;
}
/* expand all the toctree entries */
.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,
.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,
.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,
.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,
.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,
.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,
.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,
.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,
.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,
.wy-menu-vertical .toctree-l10.current .toctree-l11>ul {
display: block;
}
/* hide all the buttons */
.wy-menu-vertical li.current>a button.toctree-expand,
.wy-menu-vertical li.on a button.toctree-expand,
.wy-menu-vertical li.toctree-l2 button.toctree-expand,
.wy-menu-vertical li a button.toctree-expand {
display: none;
}
/* toctree layout improvements */
.wy-menu-vertical a {
padding: 0.4em 1.2em;
}
.wy-menu-vertical li.current>a,
.wy-menu-vertical li.on a {
font-weight: normal;
padding: 0.4em 1.2em;
/* border-right: 1px solid #f0f0f0; */
}
.wy-menu-vertical li.current a {
padding: 0.4em 1.2em;
}
.wy-menu-vertical li.toctree-l3 a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a {
padding-left: 1.8em;
}
.wy-menu-vertical li.toctree-l2.current>a {
padding: 0.4em 1.2em;
}
.wy-menu-vertical li.toctree-l2.current>a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a {
background: transparent;
}
.wy-menu-vertical li.toctree-l2.current>a:hover,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a:hover {
background: #d6d6d6;
}
.wy-menu-vertical li.current>a.current {
background: #fafafa !important;
}
.wy-menu-vertical li.current a {
}
+17 -8
View File
@@ -2,6 +2,8 @@
title: Tips and tricks
---
# Tips and tricks
## Tips
### Linux builds in containers
@@ -53,11 +55,11 @@ to load on Apple Silicon.
available.
Generally speaking, because Pip 20.3 is required for the `universal2` wheel,
most packages should provide both `x86_64` and `universal2` wheels for now.
Once Pip 20.3+ is common on macOS, then it should be possible to ship only the
`universal2` wheel.
most packages should provide both `x86_64` and one of `universal2`/`arm64`
wheels for now. When Pip 20.3+ is common on macOS, then it might be possible
to ship only the `universal2` wheel.
**Apple Silicon wheels are not built by default**, but can be enabled by adding extra archs to the [`CIBW_ARCHS_MACOS` option](options.md#archs) - e.g. `x86_64 arm64 universal2`. Cross-compilation is provided by the Xcode toolchain.
**Apple Silicon wheels are not built by default on Intel runners**, but can be enabled by adding extra archs to the [`CIBW_ARCHS_MACOS` option](options.md#archs) - e.g. `x86_64 arm64`. Cross-compilation is provided by the Xcode toolchain.
!!! important
When cross-compiling on Intel, it is not possible to test `arm64` and the `arm64` part of a `universal2` wheel.
@@ -66,8 +68,7 @@ Once Pip 20.3+ is common on macOS, then it should be possible to ship only the
Hopefully, cross-compilation is a temporary situation. Once we have widely
available Apple Silicon CI runners, we can build and test `arm64` and
`universal2` wheels natively. That's why `universal2` wheels are not yet built
by default, and require opt-in by setting `CIBW_ARCHS_MACOS`.
`universal2` wheels natively. That's why `universal2`/`arm64` wheels require opt-in by setting `CIBW_ARCHS_MACOS`.
!!! note
Your runner needs Xcode Command Line Tools 12.2 or later to build `universal2` or `arm64`.
@@ -82,6 +83,14 @@ Here's an example GitHub Actions workflow with a job that builds for Apple Silic
{% include "../examples/github-apple-silicon.yml" %}
```
Here's an example Cirrus CI workflow with a job that builds for macOS Intel through Rosetta 2 emulation and for Apple Silicon natively:
> .cirrus.yml
```yml
{% include "../examples/cirrus-ci-intel-mac.yml" %}
```
### Building non-native architectures using emulation {: #emulation}
cibuildwheel supports building non-native architectures on Linux, via
@@ -133,7 +142,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@v2.8.1
uses: pypa/cibuildwheel@v2.10.1
```
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.
@@ -155,7 +164,7 @@ The second option, and the only one that supports other CI systems, is using a `
```bash
# requirements-cibw.txt
cibuildwheel==2.8.1
cibuildwheel==2.10.1
```
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:
+2
View File
@@ -2,6 +2,8 @@
title: Home
---
# cibuildwheel
{%
include-markdown "../README.md"
start="<!--intro-start-->"
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
from typing import Any
+55 -3
View File
@@ -1,3 +1,5 @@
# Options
## Setting options
cibuildwheel can either be configured using environment variables, or from
@@ -73,6 +75,16 @@ cibuildwheel to run tests, add the following YAML to your CI config file:
CIBW_TEST_COMMAND: "pytest {project}/tests"
```
!!! tab "Cirrus CI"
> .cirrus.yml ([docs](https://cirrus-ci.org/guide/writing-tasks/#environment-variables))
```yaml
env:
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
```
### Configuration file {: #configuration-file}
You can configure cibuildwheel with a config file, such as `pyproject.toml`.
@@ -101,7 +113,7 @@ The complete set of defaults for the current version of cibuildwheel are shown b
!!! tip
Static configuration works across all CI systems, and can be used locally if
you run `cibuildwheel --plat linux`. This is preferred, but environment
you run `cibuildwheel --platform linux`. This is preferred, but environment
variables are better if you need to change per-matrix element
(`CIBW_BUILD` is often in this category, for example), or if you cannot or do
not want to change a `pyproject.toml` file. You can specify a different file to
@@ -190,6 +202,10 @@ This option can also be set using the [command-line option](#command-line) `--pl
This is even more convenient if you store your cibuildwheel config in [`pyproject.toml`](#configuration-file).
You can also run a single identifier with `--only <identifier>`. This will
not require `--platform` or `--arch`, and will override any build/skip
configuration.
### `CIBW_BUILD`, `CIBW_SKIP` {: #build-skip}
> Choose the Python versions to build
@@ -351,7 +367,7 @@ Default: `auto`
| Linux / Intel | `x86_64` | `x86_64` `i686` | `x86_64` | `i686` |
| Windows / Intel | `AMD64` | `AMD64` `x86` | `AMD64` | `x86` |
| macOS / Intel | `x86_64` | `x86_64` | `x86_64` | |
| macOS / Apple Silicon | `arm64` | `arm64` `universal2` | `arm64` `universal2`| |
| macOS / Apple Silicon | `arm64` | `arm64` | `arm64` | |
If not listed above, `auto` is the same as `native`.
@@ -517,6 +533,36 @@ Choose which build backend to use. Can either be "pip", which will run
build-frontend = "pip"
```
### `CIBW_CONFIG_SETTINGS` {: #config-settings}
> Specify config-settings for the build backend.
Specify config settings for the build backend. Each space separated
item will be passed via `--config-setting`. In TOML, you can specify
a table of items, including arrays.
!!! tip
Currently, "build" supports arrays for options, but "pip" only supports
single values.
Platform-specific environment variables also available:<br/>
`CIBW_BEFORE_ALL_MACOS` | `CIBW_BEFORE_ALL_WINDOWS` | `CIBW_BEFORE_ALL_LINUX`
#### Examples
!!! tab examples "Environment variables"
```yaml
CIBW_CONFIG_SETTINGS: "--build-option=--use-mypyc"
```
!!! tab examples "pyproject.toml"
```toml
[tool.cibuildwheel.config-settings]
--build-option = "--use-mypyc"
```
### `CIBW_ENVIRONMENT` {: #environment}
> Set environment variables needed during the build
@@ -899,7 +945,7 @@ The available options are (default value):
Set an alternative Docker image to be used for building [manylinux / musllinux](https://github.com/pypa/manylinux) wheels.
For `CIBW_MANYLINUX_*_IMAGE`, the value of this option can either be set to `manylinux1`, `manylinux2010`, `manylinux2014`, `manylinux_2_24` or `manylinux_2_28` to use a pinned version of the [official manylinux images](https://github.com/pypa/manylinux). Alternatively, set these options to any other valid Docker image name. For PyPy, the `manylinux1` image is not available. For architectures other
than x86 (x86\_64 and i686) `manylinux2014`, `manylinux_2_24` or `manylinux_2_28` must be used, because the first version of the manylinux specification that supports additional architectures is `manylinux2014`. `manylinux_2_28` is not supported for `i686` & `s390x` architectures.
than x86 (x86\_64 and i686) `manylinux2014`, `manylinux_2_24` or `manylinux_2_28` must be used, because the first version of the manylinux specification that supports additional architectures is `manylinux2014`. `manylinux_2_28` is not supported for `i686` architecture.
For `CIBW_MUSLLINUX_*_IMAGE`, the value of this option can either be set to `musllinux_1_1` to use a pinned version of the [official musllinux images](https://github.com/pypa/musllinux). Alternatively, set these options to any other valid Docker image name.
@@ -1352,6 +1398,12 @@ Some options support placeholders, like `{project}`, `{package}` or `{wheel}`, t
margin-top: 28px;
overflow-x: auto;
}
@media screen and (max-width: 768px) {
.options-toc {
grid-gap: 1em 0.5em;
gap: 1em 0.5em;
}
}
.options-toc .header {
grid-column: 1 / 3;
font-weight: bold;
+30 -14
View File
@@ -2,7 +2,9 @@
title: 'Setup'
---
# Run cibuildwheel locally (optional) {: #local}
# Setup
## Run cibuildwheel locally (optional) {: #local}
Before getting to CI setup, it can be convenient to test cibuildwheel
locally to quickly iterate and track down issues without even touching CI.
@@ -89,7 +91,7 @@ You should see the builds taking place. You can experiment with options using en
cibuildwheel --platform linux
```
## Linux builds
### Linux builds
If you've got [Docker](https://www.docker.com/products/docker-desktop) installed on
your development machine, you can run a Linux build.
@@ -105,7 +107,7 @@ they're perfectly reproducible.
The only side effect to your system will be docker images being pulled.
## macOS / Windows builds
### macOS / Windows builds
Pre-requisite: you need to have native build tools installed.
@@ -137,9 +139,9 @@ You can override the cache folder using the ``CIBW_CACHE_PATH`` environment vari
```
# Configure a CI service
## Configure a CI service
## GitHub Actions [linux/mac/windows] {: #github-actions}
### GitHub Actions [linux/mac/windows] {: #github-actions}
To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/workflows/build_wheels.yml` file in your repo.
@@ -182,7 +184,7 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/
- uses: actions/checkout@v3
- name: Build wheels
run: pipx run cibuildwheel==2.8.1
run: pipx run cibuildwheel==2.10.1
- uses: actions/upload-artifact@v3
with:
@@ -217,7 +219,7 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.8.1
run: python -m pip install cibuildwheel==2.10.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
@@ -235,7 +237,7 @@ For more info on this file, check out the [docs](https://help.github.com/en/acti
[`examples/github-deploy.yml`](https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml) extends this minimal example with a demonstration of how to automatically upload the built wheels to PyPI.
## Azure Pipelines [linux/mac/windows] {: #azure-pipelines}
### Azure Pipelines [linux/mac/windows] {: #azure-pipelines}
To build Linux, Mac, and Windows wheels on Azure Pipelines, create a `azure-pipelines.yml` file in your repo.
@@ -249,7 +251,7 @@ Commit this file, enable building of your repo on Azure Pipelines, and push.
Wheels will be stored for you and available through the Pipelines interface. For more info on this file, check out the [docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema).
## Travis CI [linux/windows] {: #travis-ci}
### Travis CI [linux/windows] {: #travis-ci}
To build Linux and Windows wheels on Travis CI, create a `.travis.yml` file in your repo.
@@ -265,7 +267,7 @@ Then setup a deployment method by following the [Travis CI deployment docs](http
[`examples/travis-ci-deploy.yml`](https://github.com/pypa/cibuildwheel/blob/main/examples/travis-ci-deploy.yml) extends this minimal example with a demonstration of how to automatically upload the built wheels to PyPI.
## AppVeyor [linux/mac/windows] {: #appveyor}
### AppVeyor [linux/mac/windows] {: #appveyor}
To build Linux, Mac, and Windows wheels on AppVeyor, create an `appveyor.yml` file in your repo.
@@ -281,7 +283,7 @@ AppVeyor will store the built wheels for you - you can access them from the proj
For more info on this config file, check out the [docs](https://www.appveyor.com/docs/).
## CircleCI [linux/mac] {: #circleci}
### CircleCI [linux/mac] {: #circleci}
To build Linux and Mac wheels on CircleCI, create a `.circleci/config.yml` file in your repo,
@@ -298,7 +300,7 @@ Commit this file, enable building of your repo on CircleCI, and push.
CircleCI will store the built wheels for you - you can access them from the project console. Check out the CircleCI [docs](https://circleci.com/docs/2.0/configuration-reference/#section=configuration) for more info on this config file.
## Gitlab CI [linux] {: #gitlab-ci}
### Gitlab CI [linux] {: #gitlab-ci}
To build Linux wheels on Gitlab CI, create a `.gitlab-ci.yml` file in your repo,
@@ -312,15 +314,29 @@ Commit this file, and push to Gitlab. The pipeline should start automatically.
Gitlab will store the built wheels for you - you can access them from the Pipelines view. Check out the Gitlab [docs](https://docs.gitlab.com/ee/ci/yaml/) for more info on this config file.
### Cirrus CI [linux/mac/windows] {: #cirrus-ci}
To build Linux, Mac, and Windows wheels on Cirrus CI, create a `.cirrus.yml` file in your repo,
> .cirrus.yml
```yaml
{% include "../examples/cirrus-ci-minimal.yml" %}
```
Commit this file, enable building of your repo on Cirrus CI, and push.
Cirrus CI will store the built wheels for you - you can access them from the individual task view. Check out the Cirrus CI [docs](https://cirrus-ci.org/guide/writing-tasks/) for more info on this config file.
> ⚠️ Got an error? Check the [FAQ](faq.md).
# Next steps
## Next steps
Once you've got the wheel building successfully, you might want to set up [testing](options.md#test-command) or [automatic releases to PyPI](deliver-to-pypi.md#automatic-method).
<script>
document.addEventListener('DOMContentLoaded', function() {
$('a.toctree-l3, .rst-content h2').each(function(i, el) {
$('.toctree-l3>a, .rst-content h3').each(function(i, el) {
var text = $(el).text()
var match = text.match(/(.*) \[([a-z/]+)\]/);
+271
View File
@@ -0,0 +1,271 @@
// imported from
// https://github.com/readthedocs/sphinx_rtd_theme/blob/bc73ad84068b4ee7d8ddae7e51f5b767e8fd377b/src/theme.js
// modified to suit our documentation structure, to not scroll the nav sidebar
// when clicked - this is disorienting
var jQuery = window.jQuery;
// Sphinx theme nav state
function ThemeNav () {
var nav = {
navBar: null,
win: null,
winScroll: false,
winResize: false,
linkScroll: false,
winPosition: 0,
winHeight: null,
docHeight: null,
isRunning: false
};
nav.enable = function (withStickyNav) {
var self = this;
// TODO this can likely be removed once the theme javascript is broken
// out from the RTD assets. This just ensures old projects that are
// calling `enable()` get the sticky menu on by default. All other cals
// to `enable` should include an argument for enabling the sticky menu.
if (typeof(withStickyNav) == 'undefined') {
withStickyNav = true;
}
if (self.isRunning) {
// Only allow enabling nav logic once
return;
}
self.isRunning = true;
jQuery(function ($) {
self.init($);
self.reset();
self.win.on('hashchange', self.reset);
if (withStickyNav) {
// Set scroll monitor
self.win.on('scroll', function () {
if (!self.linkScroll) {
if (!self.winScroll) {
self.winScroll = true;
requestAnimationFrame(function() { self.onScroll(); });
}
}
});
}
// Set resize monitor
self.win.on('resize', function () {
if (!self.winResize) {
self.winResize = true;
requestAnimationFrame(function() { self.onResize(); });
}
});
self.onResize();
});
};
// TODO remove this with a split in theme and Read the Docs JS logic as
// well, it's only here to support 0.3.0 installs of our theme.
nav.enableSticky = function() {
this.enable(true);
};
nav.init = function ($) {
var doc = $(document),
self = this;
this.navBar = $('div.wy-side-scroll:first');
this.win = $(window);
// Set up javascript UX bits
$(document)
// Shift nav in mobile when clicking the menu.
.on('click', "[data-toggle='wy-nav-top']", function() {
$("[data-toggle='wy-nav-shift']").toggleClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
})
// Nav menu link click operations
.on('click', ".wy-menu-vertical .current ul li a", function() {
var target = $(this);
// Close menu when you click a link.
$("[data-toggle='wy-nav-shift']").removeClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
// Handle dynamic display of l3 and l4 nav lists
self.toggleCurrent(target);
self.hashChange();
})
.on('click', "[data-toggle='rst-current-version']", function() {
$("[data-toggle='rst-versions']").toggleClass("shift-up");
})
// Make tables responsive
$("table.docutils:not(.field-list,.footnote,.citation)")
.wrap("<div class='wy-table-responsive'></div>");
// Add extra class to responsive tables that contain
// footnotes or citations so that we can target them for styling
$("table.docutils.footnote")
.wrap("<div class='wy-table-responsive footnote'></div>");
$("table.docutils.citation")
.wrap("<div class='wy-table-responsive citation'></div>");
// Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
expand =
$('<button class="toctree-expand" title="Open/close menu"></button>');
expand.on('click', function (ev) {
self.toggleCurrent(link);
ev.stopPropagation();
return false;
});
link.prepend(expand);
});
};
nav.reset = function () {
// Get anchor from URL and open up nested nav
var anchor = encodeURI(window.location.hash) || '#';
try {
var vmenu = $('.wy-menu-vertical');
var link = vmenu.find('[href="' + anchor + '"]');
if (link.length === 0) {
// this link was not found in the sidebar.
// Find associated id element, then its closest section
// in the document and try with that one.
var id_elt = $('.document [id="' + anchor.substring(1) + '"]');
var closest_section = id_elt.closest('div.section');
link = vmenu.find('[href="#' + closest_section.attr("id") + '"]');
if (link.length === 0) {
// still not found in the sidebar. fall back to main section
link = vmenu.find('[href="#"]');
}
}
// If we found a matching link then reset current and re-apply
// otherwise retain the existing match
if (link.length > 0) {
$('.wy-menu-vertical .current')
.removeClass('current')
.attr('aria-expanded','false');
link.addClass('current')
.attr('aria-expanded','true');
link.closest('li.toctree-l1')
.parent()
.addClass('current')
.attr('aria-expanded','true');
for (let i = 1; i <= 10; i++) {
link.closest('li.toctree-l' + i)
.addClass('current')
.attr('aria-expanded','true');
}
// EDIT by joerick
console.log('no scroll')
// link[0].scrollIntoView();
}
}
catch (err) {
console.log("Error expanding nav for anchor", err);
}
};
nav.onScroll = function () {
this.winScroll = false;
var newWinPosition = this.win.scrollTop(),
winBottom = newWinPosition + this.winHeight,
navPosition = this.navBar.scrollTop(),
newNavPosition = navPosition + (newWinPosition - this.winPosition);
if (newWinPosition < 0 || winBottom > this.docHeight) {
return;
}
this.navBar.scrollTop(newNavPosition);
this.winPosition = newWinPosition;
};
nav.onResize = function () {
this.winResize = false;
this.winHeight = this.win.height();
this.docHeight = $(document).height();
};
nav.hashChange = function () {
this.linkScroll = true;
this.win.one('hashchange', function () {
this.linkScroll = false;
});
};
nav.toggleCurrent = function (elem) {
var parent_li = elem.closest('li');
parent_li
.siblings('li.current')
.removeClass('current')
.attr('aria-expanded','false');
parent_li
.siblings()
.find('li.current')
.removeClass('current')
.attr('aria-expanded','false');
var children = parent_li.find('> ul li');
// Don't toggle terminal elements.
if (children.length) {
children
.removeClass('current')
.attr('aria-expanded','false');
parent_li
.toggleClass('current')
.attr('aria-expanded', function(i, old) {
return old == 'true' ? 'false' : 'true';
});
}
}
return nav;
};
const ThemeNavInstance = ThemeNav();
window.SphinxRtdTheme = {
Navigation: ThemeNavInstance,
// TODO remove this once static assets are split up between the theme
// and Read the Docs. For now, this patches 0.3.0 to be backwards
// compatible with a pre-0.3.0 layout.html
StickyNav: ThemeNavInstance,
};
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// https://gist.github.com/paulirish/1579671
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
+136 -126
View File
@@ -23,25 +23,25 @@ title: Working examples
| [psutil][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Cross-platform lib for process and system monitoring in Python |
| [vaex][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Out-of-Core hybrid Apache Arrow/NumPy DataFrame for Python, ML, visualization and exploration of big tabular data at a billion rows per second 🚀 |
| [Google Benchmark][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A microbenchmark support library |
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an in-process SQL OLAP Database Management System |
| [Apache Beam][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Apache Beam is a unified programming model for Batch and Streaming data processing. |
| [asyncpg][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A fast PostgreSQL Database Client Library for Python/asyncio. |
| [duckdb][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | DuckDB is an in-process SQL OLAP Database Management System |
| [scikit-image][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Image processing library. Uses cibuildwheel to build and test a project that uses Cython with platform-native code. |
| [PyGame][] | ![github icon][] | ![apple icon][] ![linux icon][] | pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL. |
| [PyGame][] | ![github icon][] | ![apple icon][] ![linux icon][] | 🐍🎮 pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL. |
| [cmake][] | ![github icon][] ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Multitagged binary builds for all supported platforms, using cibw 2 config configuration. |
| [scikit-image][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Image processing library. Uses cibuildwheel to build and test a project that uses Cython with platform-native code. |
| [twisted-iocpsupport][] | ![github icon][] | ![windows icon][] | A submodule of Twisted that hooks into native C APIs using Cython. |
| [PyOxidizer][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A modern Python application packaging and distribution tool |
| [websockets][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | Library for building WebSocket servers and clients. Mostly written in Python, with a small C 'speedups' extension module. |
| [cvxpy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A Python-embedded modeling language for convex optimization problems. |
| [PyOxidizer][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A modern Python application packaging and distribution tool |
| [Triton][] | ![github icon][] | ![linux icon][] | Self hosted runners |
| [UltraJSON][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Ultra fast JSON decoder and encoder written in C with Python bindings |
| [River][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | 🌊 Online machine learning in Python |
| [OpenSpiel][] | ![github icon][] | ![apple icon][] ![linux icon][] | OpenSpiel is a collection of environments and algorithms for research in general reinforcement learning and search/planning in games. |
| [pyzmq][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python bindings for zeromq, the networking library. Uses Cython and CFFI. |
| [aiortc][] | ![github icon][] | ![apple icon][] ![linux icon][] | WebRTC and ORTC implementation for Python using asyncio. |
| [Implicit][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes GPU support for linux wheels |
| [vispy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Main repository for Vispy |
| [Confluent client for Kafka][] | ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | setup in `tools/wheels/build-wheels.bat` |
| [Implicit][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes GPU support for linux wheels |
| [tinyobjloader][] | ![azurepipelines icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Tiny but powerful single file wavefront obj loader |
| [Dependency Injector][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Dependency injection framework for Python, uses Windows TravisCI |
| [coverage.py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The coverage tool for Python |
@@ -57,11 +57,12 @@ title: Working examples
| [Line Profiler][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Line-by-line profiling for Python |
| [PyTables][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python package to manage extremely large amounts of data |
| [OpenTimelineIO][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Open Source API and interchange format for editorial timeline information. |
| [ruptures][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Extensive Cython + NumPy [pyproject.toml](https://github.com/deepcharles/ruptures/blob/master/pyproject.toml) example. |
| [aioquic][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | QUIC and HTTP/3 implementation in Python |
| [ruptures][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Extensive Cython + NumPy [pyproject.toml](https://github.com/deepcharles/ruptures/blob/master/pyproject.toml) example. |
| [envd][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | 🏕️ Development environment for AI/ML |
| [Psycopg 3][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A modern implementation of a PostgreSQL adapter for Python |
| [DeepForest][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | An Efficient, Scalable and Optimized Python Framework for Deep Forest (2021.2.1) |
| [google neuroglancer][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | WebGL-based viewer for volumetric data |
| [Psycopg 3][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A modern implementation of a PostgreSQL adapter for Python |
| [Parselmouth][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python interface to the Praat software package, using pybind11, C++17 and CMake, with the core Praat static library built only once and shared between wheels. |
| [AutoPy][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [H3-py][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Python bindings for H3, a hierarchical hexagonal geospatial indexing system |
@@ -72,11 +73,11 @@ title: Working examples
| [pybind11 cmake_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Example pybind11 module built with a CMake-based build system |
| [KDEpy][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Kernel Density Estimation in Python |
| [tgcalls][] | ![github icon][] | ![apple icon][] ![windows icon][] | Python `pybind11` binding to Telegram's WebRTC library with third party dependencies like `OpenSSL`, `MozJPEG`, `FFmpeg`, etc. |
| [dd-trace-py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Uses custom alternate arch emulation on GitHub |
| [pybind11 python_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Example pybind11 module built with a Python-based build system |
| [sourmash][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Quickly search, compare, and analyze genomic and metagenomic data sets. |
| [time-machine][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Time mocking library using only the CPython C API. |
| [dd-trace-py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Uses custom alternate arch emulation on GitHub |
| [CTranslate2][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes libraries from the [Intel oneAPI toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html) and CUDA kernels compiled for multiple GPU architectures. |
| [time-machine][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Time mocking library using only the CPython C API. |
| [sourmash][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Quickly search, compare, and analyze genomic and metagenomic data sets. |
| [cyvcf2][] | ![github icon][] | ![apple icon][] ![linux icon][] | cython + htslib == fast VCF and BCF processing |
| [matrixprofile][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone. |
| [abess][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A fast best-subset selection library. It uses cibuildwheel to build a large project with C++ extensions. |
@@ -84,10 +85,11 @@ title: Working examples
| [iminuit][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Jupyter-friendly Python interface for C++ MINUIT2 |
| [Tokenizer][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Fast and customizable text tokenization library with BPE and SentencePiece support |
| [PyGLM][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Fast OpenGL Mathematics (GLM) for Python |
| [boost-histogram][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Supports full range of wheels, including PyPy and alternate archs. |
| [bx-python][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | A library that includes Cython extensions. |
| [boost-histogram][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Supports full range of wheels, including PyPy and alternate archs. |
| [TgCrypto][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes a Windows Travis build. |
| [iDynTree][] | ![github icon][] | ![linux icon][] | Uses manylinux_2_24 |
| [mosec][] | ![github icon][] | ![linux icon][] ![apple icon][] | A high-performance serving framework for ML models, offers dynamic batching and multi-stage pipeline to fully exploit your compute machine |
| [Python-WebRTC][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | a Python extension that provides bindings to WebRTC M92 |
| [pybase64][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Fast Base64 encoding/decoding in Python |
| [Arbor][] | ![github icon][] | ![apple icon][] ![linux icon][] | Arbor is a multi-compartment neuron simulation library; compatible with next-generation accelerators; best-practices applied to research software; focused on community-driven development. Includes a [small script](https://github.com/arbor-sim/arbor/blob/master/scripts/patchwheel.py) patching `rpath` in bundled libraries. |
@@ -96,18 +98,19 @@ title: Working examples
| [polaroid][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Full range of wheels for setuptools rust, with auto release and PyPI deploy. |
| [cf-units][] | ![github icon][] | ![apple icon][] ![linux icon][] | Units of measure as required by the Climate and Forecast (CF) Metadata Conventions |
| [Imagecodecs (fork)][] | ![azurepipelines icon][] | ![apple icon][] ![linux icon][] | Over 20 external dependencies in compiled libraries, custom docker image, `libomp`, `openblas` and `install_name_tool` for macOS. |
| [clang-format][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Scikit-build wrapper around LLVM's CMake, all platforms, generic wheels. |
| [pillow-heif][] | ![github icon][] | ![apple icon][] ![linux icon][] | Python CFFI binding to libheif library with third party dependencies like `libde265`, `x265`, `libaom` with test & publishing on PyPi. |
| [power-grid-model][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python/C++ library for distribution power system analysis |
| [clang-format][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Scikit-build wrapper around LLVM's CMake, all platforms, generic wheels. |
| [numpythia][] | ![github icon][] | ![apple icon][] ![linux icon][] | The interface between PYTHIA and NumPy |
| [pyjet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The interface between FastJet and NumPy |
| [pybind11 scikit_build_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | An example combining scikit-build and pybind11 |
| [pyjet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The interface between FastJet and NumPy |
| [ninja][] | ![github icon][] ![travisci icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Multitagged binary builds for all supported platforms, using cibw 2 config configuration. |
| [GSD][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Cython and NumPy project with 64-bit wheels. |
| [pyinstrument_cext][] | ![travisci icon][] ![appveyor icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A simple C extension, without external dependencies |
| [xmlstarlet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Python 3.6+ CFFI bindings with true MSVC build. |
| [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. |
| [SiPM][] | ![github icon][] | ![apple icon][] ![linux icon][] | High performance library for SiPM detectors simulation using C++17, OpenMP and AVX2 intrinsics. |
| [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. |
[scikit-learn]: https://github.com/scikit-learn/scikit-learn
[NumPy]: https://github.com/numpy/numpy
@@ -124,25 +127,25 @@ title: Working examples
[psutil]: https://github.com/giampaolo/psutil
[vaex]: https://github.com/vaexio/vaex
[Google Benchmark]: https://github.com/google/benchmark
[duckdb]: https://github.com/duckdb/duckdb
[Apache Beam]: https://github.com/apache/beam
[asyncpg]: https://github.com/MagicStack/asyncpg
[duckdb]: https://github.com/duckdb/duckdb
[scikit-image]: https://github.com/scikit-image/scikit-image
[PyGame]: https://github.com/pygame/pygame
[cmake]: https://github.com/scikit-build/cmake-python-distributions
[scikit-image]: https://github.com/scikit-image/scikit-image
[twisted-iocpsupport]: https://github.com/twisted/twisted-iocpsupport
[PyOxidizer]: https://github.com/indygreg/PyOxidizer
[websockets]: https://github.com/aaugustin/websockets
[cvxpy]: https://github.com/cvxpy/cvxpy
[PyOxidizer]: https://github.com/indygreg/PyOxidizer
[Triton]: https://github.com/openai/triton
[UltraJSON]: https://github.com/ultrajson/ultrajson
[River]: https://github.com/online-ml/river
[OpenSpiel]: https://github.com/deepmind/open_spiel
[pyzmq]: https://github.com/zeromq/pyzmq
[aiortc]: https://github.com/aiortc/aiortc
[Implicit]: https://github.com/benfred/implicit
[vispy]: https://github.com/vispy/vispy
[Confluent client for Kafka]: https://github.com/confluentinc/confluent-kafka-python
[Implicit]: https://github.com/benfred/implicit
[tinyobjloader]: https://github.com/tinyobjloader/tinyobjloader
[Dependency Injector]: https://github.com/ets-labs/python-dependency-injector
[coverage.py]: https://github.com/nedbat/coveragepy
@@ -158,11 +161,12 @@ title: Working examples
[Line Profiler]: https://github.com/pyutils/line_profiler
[PyTables]: https://github.com/PyTables/PyTables
[OpenTimelineIO]: https://github.com/PixarAnimationStudios/OpenTimelineIO
[ruptures]: https://github.com/deepcharles/ruptures
[aioquic]: https://github.com/aiortc/aioquic
[ruptures]: https://github.com/deepcharles/ruptures
[envd]: https://github.com/tensorchord/envd
[Psycopg 3]: https://github.com/psycopg/psycopg
[DeepForest]: https://github.com/LAMDA-NJU/Deep-Forest
[google neuroglancer]: https://github.com/google/neuroglancer
[Psycopg 3]: https://github.com/psycopg/psycopg
[Parselmouth]: https://github.com/YannickJadoul/Parselmouth
[AutoPy]: https://github.com/autopilot-rs/autopy
[H3-py]: https://github.com/uber/h3-py
@@ -173,11 +177,11 @@ title: Working examples
[pybind11 cmake_example]: https://github.com/pybind/cmake_example
[KDEpy]: https://github.com/tommyod/KDEpy
[tgcalls]: https://github.com/MarshalX/tgcalls
[dd-trace-py]: https://github.com/DataDog/dd-trace-py
[pybind11 python_example]: https://github.com/pybind/python_example
[sourmash]: https://github.com/dib-lab/sourmash
[time-machine]: https://github.com/adamchainz/time-machine
[dd-trace-py]: https://github.com/DataDog/dd-trace-py
[CTranslate2]: https://github.com/OpenNMT/CTranslate2
[time-machine]: https://github.com/adamchainz/time-machine
[sourmash]: https://github.com/dib-lab/sourmash
[cyvcf2]: https://github.com/brentp/cyvcf2
[matrixprofile]: https://github.com/matrix-profile-foundation/matrixprofile
[abess]: https://github.com/abess-team/abess
@@ -185,10 +189,11 @@ title: Working examples
[iminuit]: https://github.com/scikit-hep/iminuit
[Tokenizer]: https://github.com/OpenNMT/Tokenizer
[PyGLM]: https://github.com/Zuzu-Typ/PyGLM
[boost-histogram]: https://github.com/scikit-hep/boost-histogram
[bx-python]: https://github.com/bxlab/bx-python
[boost-histogram]: https://github.com/scikit-hep/boost-histogram
[TgCrypto]: https://github.com/pyrogram/tgcrypto
[iDynTree]: https://github.com/robotology/idyntree
[mosec]: https://github.com/mosecorg/mosec
[Python-WebRTC]: https://github.com/MarshalX/python-webrtc
[pybase64]: https://github.com/mayeut/pybase64
[Arbor]: https://github.com/arbor-sim/arbor
@@ -197,18 +202,19 @@ title: Working examples
[polaroid]: https://github.com/daggy1234/polaroid
[cf-units]: https://github.com/SciTools/cf-units
[Imagecodecs (fork)]: https://github.com/czaki/imagecodecs_build
[clang-format]: https://github.com/ssciwr/clang-format-wheel
[pillow-heif]: https://github.com/bigcat88/pillow_heif
[power-grid-model]: https://github.com/alliander-opensource/power-grid-model
[clang-format]: https://github.com/ssciwr/clang-format-wheel
[numpythia]: https://github.com/scikit-hep/numpythia
[pyjet]: https://github.com/scikit-hep/pyjet
[pybind11 scikit_build_example]: https://github.com/pybind/scikit_build_example
[pyjet]: https://github.com/scikit-hep/pyjet
[ninja]: https://github.com/scikit-build/ninja-python-distributions
[GSD]: https://github.com/glotzerlab/gsd
[pyinstrument_cext]: https://github.com/joerick/pyinstrument_cext
[xmlstarlet]: https://github.com/dimitern/xmlstarlet
[CorrectionLib]: https://github.com/cms-nanoAOD/correctionlib
[xmlstarlet]: https://github.com/dimitern/xmlstarlet
[SiPM]: https://github.com/EdoPro98/SimSiPM
[ril]: https://github.com/Cryptex-github/ril-py
[appveyor icon]: data/readme_icons/appveyor.svg
[github icon]: data/readme_icons/github.svg
@@ -216,110 +222,114 @@ title: Working examples
[circleci icon]: data/readme_icons/circleci.svg
[gitlab icon]: data/readme_icons/gitlab.svg
[travisci icon]: data/readme_icons/travisci.svg
[cirrusci icon]: data/readme_icons/cirrusci.svg
[windows icon]: data/readme_icons/windows.svg
[apple icon]: data/readme_icons/apple.svg
[linux icon]: data/readme_icons/linux.svg
<!-- scikit-learn: 50754, last pushed 0 days ago -->
<!-- NumPy: 20975, last pushed 0 days ago -->
<!-- Tornado: 20638, last pushed 0 days ago -->
<!-- pytorch-fairseq: 18489, last pushed 2 days ago -->
<!-- Matplotlib: 15822, last pushed 0 days ago -->
<!-- NCNN: 14975, last pushed 0 days ago -->
<!-- Kivy: 14789, last pushed 0 days ago -->
<!-- Prophet: 14684, last pushed 10 days ago -->
<!-- MyPy: 13444, last pushed 0 days ago -->
<!-- pydantic: 10450, last pushed 0 days ago -->
<!-- MemRay: 8836, last pushed 2 days ago -->
<!-- uvloop: 8725, last pushed 0 days ago -->
<!-- psutil: 8531, last pushed 3 days ago -->
<!-- vaex: 7175, last pushed 0 days ago -->
<!-- Google Benchmark: 6659, last pushed 0 days ago -->
<!-- Apache Beam: 5702, last pushed 0 days ago -->
<!-- asyncpg: 5558, last pushed 10 days ago -->
<!-- duckdb: 5546, last pushed 0 days ago -->
<!-- scikit-image: 4978, last pushed 0 days ago -->
<!-- PyGame: 4976, last pushed 0 days ago -->
<!-- cmake: 4910, last pushed 0 days ago -->
<!-- twisted-iocpsupport: 4666, last pushed 3 days ago -->
<!-- websockets: 4022, last pushed 1 days ago -->
<!-- cvxpy: 4009, last pushed 0 days ago -->
<!-- PyOxidizer: 3919, last pushed 1 days ago -->
<!-- Triton: 3786, last pushed 0 days ago -->
<!-- UltraJSON: 3755, last pushed 7 days ago -->
<!-- River: 3488, last pushed 2 days ago -->
<!-- OpenSpiel: 3248, last pushed 0 days ago -->
<!-- pyzmq: 3130, last pushed 4 days ago -->
<!-- aiortc: 2993, last pushed 23 days ago -->
<!-- vispy: 2904, last pushed 5 days ago -->
<!-- Confluent client for Kafka: 2848, last pushed 2 days ago -->
<!-- Implicit: 2847, last pushed 1 days ago -->
<!-- tinyobjloader: 2594, last pushed 13 days ago -->
<!-- Dependency Injector: 2244, last pushed 7 days ago -->
<!-- coverage.py: 2106, last pushed 1 days ago -->
<!-- PyCryptodome: 2054, last pushed 7 days ago -->
<!-- PyYAML: 1883, last pushed 1 days ago -->
<!-- numexpr: 1775, last pushed 0 days ago -->
<!-- h5py: 1757, last pushed 12 days ago -->
<!-- Wrapt: 1705, last pushed 77 days ago -->
<!-- PyAV: 1605, last pushed 0 days ago -->
<!-- SimpleJSON: 1500, last pushed 17 days ago -->
<!-- pikepdf: 1385, last pushed 1 days ago -->
<!-- OpenColorIO: 1335, last pushed 6 days ago -->
<!-- Line Profiler: 1284, last pushed 5 days ago -->
<!-- PyTables: 1137, last pushed 90 days ago -->
<!-- OpenTimelineIO: 1071, last pushed 0 days ago -->
<!-- ruptures: 988, last pushed 11 days ago -->
<!-- aioquic: 986, last pushed 0 days ago -->
<!-- DeepForest: 769, last pushed 65 days ago -->
<!-- google neuroglancer: 740, last pushed 4 days ago -->
<!-- Psycopg 3: 733, last pushed 0 days ago -->
<!-- Parselmouth: 671, last pushed 7 days ago -->
<!-- AutoPy: 662, last pushed 205 days ago -->
<!-- H3-py: 548, last pushed 15 days ago -->
<!-- Rtree: 489, last pushed 90 days ago -->
<!-- markupsafe: 480, last pushed 13 days ago -->
<!-- python-rapidjson: 456, last pushed 11 days ago -->
<!-- python-snappy: 440, last pushed 123 days ago -->
<!-- pybind11 cmake_example: 420, last pushed 12 days ago -->
<!-- KDEpy: 387, last pushed 158 days ago -->
<!-- tgcalls: 376, last pushed 16 days ago -->
<!-- dd-trace-py: 342, last pushed 0 days ago -->
<!-- pybind11 python_example: 337, last pushed 12 days ago -->
<!-- sourmash: 313, last pushed 0 days ago -->
<!-- time-machine: 312, last pushed 6 days ago -->
<!-- CTranslate2: 308, last pushed 0 days ago -->
<!-- cyvcf2: 302, last pushed 58 days ago -->
<!-- matrixprofile: 272, last pushed 14 days ago -->
<!-- abess: 271, last pushed 3 days ago -->
<!-- jq.py: 220, last pushed 162 days ago -->
<!-- iminuit: 206, last pushed 1 days ago -->
<!-- Tokenizer: 187, last pushed 133 days ago -->
<!-- PyGLM: 147, last pushed 111 days ago -->
<!-- boost-histogram: 116, last pushed 1 days ago -->
<!-- bx-python: 114, last pushed 194 days ago -->
<!-- TgCrypto: 108, last pushed 136 days ago -->
<!-- iDynTree: 106, last pushed 5 days ago -->
<!-- Python-WebRTC: 92, last pushed 129 days ago -->
<!-- pybase64: 85, last pushed 4 days ago -->
<!-- Arbor: 76, last pushed 0 days ago -->
<!-- fathon: 63, last pushed 45 days ago -->
<!-- etebase-py: 58, last pushed 11 days ago -->
<!-- polaroid: 49, last pushed 67 days ago -->
<!-- scikit-learn: 51343, last pushed 0 days ago -->
<!-- NumPy: 21419, last pushed 0 days ago -->
<!-- Tornado: 20737, last pushed 5 days ago -->
<!-- pytorch-fairseq: 19138, last pushed 2 days ago -->
<!-- Matplotlib: 16103, last pushed 0 days ago -->
<!-- NCNN: 15461, last pushed 1 days ago -->
<!-- Kivy: 15002, last pushed 0 days ago -->
<!-- Prophet: 14896, last pushed 3 days ago -->
<!-- MyPy: 13758, last pushed 0 days ago -->
<!-- pydantic: 11038, last pushed 3 days ago -->
<!-- MemRay: 9212, last pushed 2 days ago -->
<!-- uvloop: 8849, last pushed 0 days ago -->
<!-- psutil: 8679, last pushed 3 days ago -->
<!-- vaex: 7291, last pushed 4 days ago -->
<!-- Google Benchmark: 6820, last pushed 0 days ago -->
<!-- duckdb: 6335, last pushed 0 days ago -->
<!-- Apache Beam: 5843, last pushed 0 days ago -->
<!-- asyncpg: 5624, last pushed 3 days ago -->
<!-- PyGame: 5195, last pushed 0 days ago -->
<!-- cmake: 5050, last pushed 0 days ago -->
<!-- scikit-image: 5038, last pushed 0 days ago -->
<!-- twisted-iocpsupport: 4742, last pushed 0 days ago -->
<!-- PyOxidizer: 4275, last pushed 5 days ago -->
<!-- websockets: 4156, last pushed 0 days ago -->
<!-- cvxpy: 4073, last pushed 0 days ago -->
<!-- Triton: 3980, last pushed 0 days ago -->
<!-- UltraJSON: 3830, last pushed 34 days ago -->
<!-- River: 3610, last pushed 0 days ago -->
<!-- OpenSpiel: 3315, last pushed 1 days ago -->
<!-- pyzmq: 3155, last pushed 0 days ago -->
<!-- aiortc: 3059, last pushed 5 days ago -->
<!-- Implicit: 2939, last pushed 11 days ago -->
<!-- vispy: 2927, last pushed 1 days ago -->
<!-- Confluent client for Kafka: 2922, last pushed 0 days ago -->
<!-- tinyobjloader: 2637, last pushed 69 days ago -->
<!-- Dependency Injector: 2346, last pushed 3 days ago -->
<!-- coverage.py: 2182, last pushed 4 days ago -->
<!-- PyCryptodome: 2119, last pushed 10 days ago -->
<!-- PyYAML: 1930, last pushed 15 days ago -->
<!-- numexpr: 1810, last pushed 6 days ago -->
<!-- h5py: 1777, last pushed 5 days ago -->
<!-- Wrapt: 1741, last pushed 18 days ago -->
<!-- PyAV: 1651, last pushed 13 days ago -->
<!-- SimpleJSON: 1517, last pushed 73 days ago -->
<!-- pikepdf: 1488, last pushed 0 days ago -->
<!-- OpenColorIO: 1363, last pushed 1 days ago -->
<!-- Line Profiler: 1362, last pushed 0 days ago -->
<!-- PyTables: 1146, last pushed 5 days ago -->
<!-- OpenTimelineIO: 1092, last pushed 0 days ago -->
<!-- aioquic: 1051, last pushed 3 days ago -->
<!-- ruptures: 1040, last pushed 18 days ago -->
<!-- envd: 877, last pushed 0 days ago -->
<!-- Psycopg 3: 781, last pushed 3 days ago -->
<!-- DeepForest: 775, last pushed 121 days ago -->
<!-- google neuroglancer: 752, last pushed 3 days ago -->
<!-- Parselmouth: 687, last pushed 64 days ago -->
<!-- AutoPy: 674, last pushed 261 days ago -->
<!-- H3-py: 560, last pushed 14 days ago -->
<!-- Rtree: 502, last pushed 146 days ago -->
<!-- markupsafe: 494, last pushed 6 days ago -->
<!-- python-rapidjson: 457, last pushed 54 days ago -->
<!-- python-snappy: 443, last pushed 180 days ago -->
<!-- pybind11 cmake_example: 438, last pushed 31 days ago -->
<!-- KDEpy: 402, last pushed 214 days ago -->
<!-- tgcalls: 388, last pushed 72 days ago -->
<!-- pybind11 python_example: 360, last pushed 31 days ago -->
<!-- dd-trace-py: 355, last pushed 0 days ago -->
<!-- CTranslate2: 333, last pushed 0 days ago -->
<!-- time-machine: 325, last pushed 0 days ago -->
<!-- sourmash: 320, last pushed 4 days ago -->
<!-- cyvcf2: 304, last pushed 28 days ago -->
<!-- matrixprofile: 283, last pushed 70 days ago -->
<!-- abess: 280, last pushed 1 days ago -->
<!-- jq.py: 228, last pushed 0 days ago -->
<!-- iminuit: 211, last pushed 17 days ago -->
<!-- Tokenizer: 187, last pushed 0 days ago -->
<!-- PyGLM: 150, last pushed 167 days ago -->
<!-- bx-python: 116, last pushed 15 days ago -->
<!-- boost-histogram: 116, last pushed 6 days ago -->
<!-- TgCrypto: 110, last pushed 192 days ago -->
<!-- iDynTree: 108, last pushed 0 days ago -->
<!-- mosec: 105, last pushed 2 days ago -->
<!-- Python-WebRTC: 93, last pushed 185 days ago -->
<!-- pybase64: 88, last pushed 6 days ago -->
<!-- Arbor: 78, last pushed 0 days ago -->
<!-- fathon: 68, last pushed 102 days ago -->
<!-- etebase-py: 58, last pushed 67 days ago -->
<!-- polaroid: 53, last pushed 124 days ago -->
<!-- cf-units: 49, last pushed 0 days ago -->
<!-- Imagecodecs (fork): 46, last pushed 33 days ago -->
<!-- clang-format: 41, last pushed 13 days ago -->
<!-- pillow-heif: 37, last pushed 1 days ago -->
<!-- power-grid-model: 37, last pushed 0 days ago -->
<!-- numpythia: 34, last pushed 12 days ago -->
<!-- pyjet: 33, last pushed 17 days ago -->
<!-- pybind11 scikit_build_example: 29, last pushed 12 days ago -->
<!-- ninja: 24, last pushed 1 days ago -->
<!-- GSD: 19, last pushed 13 days ago -->
<!-- pyinstrument_cext: 10, last pushed 283 days ago -->
<!-- xmlstarlet: 9, last pushed 7 days ago -->
<!-- CorrectionLib: 9, last pushed 12 days ago -->
<!-- SiPM: 6, last pushed 47 days ago -->
<!-- Imagecodecs (fork): 48, last pushed 34 days ago -->
<!-- pillow-heif: 47, last pushed 0 days ago -->
<!-- power-grid-model: 46, last pushed 0 days ago -->
<!-- clang-format: 43, last pushed 6 days ago -->
<!-- numpythia: 34, last pushed 11 days ago -->
<!-- pybind11 scikit_build_example: 33, last pushed 31 days ago -->
<!-- pyjet: 32, last pushed 11 days ago -->
<!-- ninja: 25, last pushed 6 days ago -->
<!-- GSD: 19, last pushed 0 days ago -->
<!-- pyinstrument_cext: 10, last pushed 339 days ago -->
<!-- CorrectionLib: 10, last pushed 0 days ago -->
<!-- xmlstarlet: 9, last pushed 28 days ago -->
<!-- SiPM: 7, last pushed 103 days ago -->
<!-- ril: 5, last pushed 0 days ago -->
<!-- END bin/projects.py -->
+1 -1
View File
@@ -12,7 +12,7 @@ stack: python 3.7
init:
- cmd: set PATH=C:\Python37;C:\Python37\Scripts;%PATH%
install: python -m pip install cibuildwheel==2.8.1
install: python -m pip install cibuildwheel==2.10.1
build_script: python -m cibuildwheel --output-dir wheelhouse
+3 -3
View File
@@ -6,7 +6,7 @@ jobs:
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
pip3 install cibuildwheel==2.8.1
pip3 install cibuildwheel==2.10.1
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==2.8.1
python3 -m pip install cibuildwheel==2.10.1
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==2.8.1
pip install cibuildwheel==2.10.1
displayName: Install dependencies
- bash: cibuildwheel --output-dir wheelhouse .
displayName: Build wheels
+3 -3
View File
@@ -4,14 +4,14 @@ jobs:
linux-wheels:
working_directory: ~/linux-wheels
docker:
- image: circleci/python:3.6
- image: circleci/python:3.9
steps:
- checkout
- setup_remote_docker
- run:
name: Build the Linux wheels.
command: |
pip3 install --user cibuildwheel==2.8.1
pip3 install --user cibuildwheel==2.10.1
cibuildwheel --output-dir wheelhouse
- store_artifacts:
path: wheelhouse/
@@ -25,7 +25,7 @@ jobs:
- run:
name: Build the OS X wheels.
command: |
pip3 install cibuildwheel==2.8.1
pip3 install cibuildwheel==2.10.1
cibuildwheel --output-dir wheelhouse
- store_artifacts:
path: wheelhouse/
+21
View File
@@ -0,0 +1,21 @@
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel==2.10.1
run_cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"
macos_task:
name: Build macOS x86_64 and arm64 wheels.
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode
env:
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH
CIBW_ARCHS_MACOS: x86_64 arm64
install_pre_requirements_script:
- brew install python@3.10
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python
<<: *BUILD_AND_STORE_WHEELS
+60
View File
@@ -0,0 +1,60 @@
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel==2.10.1
run_cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"
linux_x86_task:
name: Build Linux x86 wheels.
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 4
memory: 4G
install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
<<: *BUILD_AND_STORE_WHEELS
linux_aarch64_task:
name: Build Linux aarch64 wheels.
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 4G
install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
<<: *BUILD_AND_STORE_WHEELS
windows_x86_task:
name: Build Windows x86 wheels.
windows_container:
image: cirrusci/windowsservercore:visualstudio2022
cpu: 4
memory: 4G
install_pre_requirements_script:
- choco install -y --no-progress python3 --version 3.10.6
- refreshenv
- echo PATH=%PATH% >> "%CIRRUS_ENV%"
<<: *BUILD_AND_STORE_WHEELS
macos_arm64_task:
name: Build macOS arm64 wheels.
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode
env:
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH
install_pre_requirements_script:
- brew install python@3.10
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python
<<: *BUILD_AND_STORE_WHEELS
+2 -2
View File
@@ -10,9 +10,9 @@ jobs:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.8.1
uses: pypa/cibuildwheel@v2.10.1
env:
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_ARCHS_MACOS: x86_64 arm64
- uses: actions/upload-artifact@v3
with:
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.8.1
uses: pypa/cibuildwheel@v2.10.1
- uses: actions/upload-artifact@v3
with:
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.8.1
uses: pypa/cibuildwheel@v2.10.1
# env:
# CIBW_SOME_OPTION: value
# ...
+2 -7
View File
@@ -13,19 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
name: Install Python
with:
python-version: '3.7'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.8.1
uses: pypa/cibuildwheel@v2.10.1
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
+1 -1
View File
@@ -12,7 +12,7 @@ linux:
DOCKER_TLS_CERTDIR: ""
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==2.8.1
- python -m pip install cibuildwheel==2.10.1
- cibuildwheel --output-dir wheelhouse
artifacts:
paths:
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
install:
- python3 -m pip install cibuildwheel==2.8.1
- python3 -m pip install cibuildwheel==2.10.1
script:
# build the wheels, put them into './dist'
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
install:
- python3 -m pip install cibuildwheel==2.8.1
- python3 -m pip install cibuildwheel==2.10.1
script:
# build the wheels, put them into './wheelhouse'
+2 -3
View File
@@ -9,7 +9,6 @@ os: linux
dist: focal
language: python
python:
- 3.6
- 3.7
- 3.8
@@ -55,7 +54,7 @@ jobs:
- stage: deploy
name: Build and deploy Linux wheels
services: docker
install: python3 -m pip install cibuildwheel==2.8.1 twine
install: python3 -m pip install cibuildwheel==2.10.1 twine
script: python3 -m cibuildwheel --output-dir wheelhouse
after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl
# Deploy on windows
@@ -63,7 +62,7 @@ jobs:
name: Build and deploy Windows wheels
os: windows
language: shell
install: python3 -m pip install cibuildwheel==2.8.1 twine
install: python3 -m pip install cibuildwheel==2.10.1 twine
script: python3 -m cibuildwheel --output-dir wheelhouse
after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl
+4
View File
@@ -5,6 +5,9 @@ theme:
highlightjs: true
hljs_languages:
- yaml
collapse_navigation: false
navigation_depth: 3
custom_dir: docs/theme_overrides
repo_url: https://github.com/pypa/cibuildwheel
edit_uri: edit/main/docs/
@@ -14,6 +17,7 @@ extra_css:
extra_javascript:
- extra.js
nav:
- Home: index.md
- setup.md
+23 -2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import os
import shutil
import sys
@@ -63,8 +65,27 @@ def update_constraints(session: nox.Session) -> None:
"""
Update the dependencies inplace.
"""
session.install("requests", "pip-tools")
session.run("python", "bin/update_dependencies.py")
session.install("pip-tools")
assert isinstance(session.python, str)
python_version = session.python.replace(".", "")
env = os.environ.copy()
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
# regenerate the constraints files
env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
session.run(
"pip-compile",
"--allow-unsafe",
"--upgrade",
"cibuildwheel/resources/constraints.in",
f"--output-file=cibuildwheel/resources/constraints-python{python_version}.txt",
env=env,
)
if session.python == PYTHON_ALL_VERSIONS[-1]:
RESOURCES = DIR / "cibuildwheel" / "resources"
shutil.copyfile(
RESOURCES / f"constraints-python{python_version}.txt",
RESOURCES / "constraints.txt",
)
@nox.session
+3 -2
View File
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
target-version = ['py37', 'py38', 'py39', 'py310']
[tool.isort]
@@ -66,6 +66,7 @@ module = [
"setuptools",
"pytest", # ignored in pre-commit to speed up check
"bashlex",
"bashlex.*",
"importlib_resources",
"ghapi.*",
]
@@ -88,7 +89,7 @@ ignore = [
]
[tool.pylint]
master.py-version = "3.6"
master.py-version = "3.7"
master.jobs = "0"
master.fail-on = ["E", "F"]
master.fail-under = "9.8"
+3 -5
View File
@@ -1,6 +1,6 @@
[metadata]
name = cibuildwheel
version = 2.8.1
version = 2.10.1
description = Build Python wheels on CI with minimal configuration.
long_description = file: README.md
long_description_content_type = text/markdown
@@ -16,7 +16,6 @@ classifiers =
Natural Language :: English
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
@@ -37,10 +36,9 @@ install_requires =
filelock
packaging>=20.9
platformdirs
dataclasses;python_version < '3.7'
tomli;python_version < '3.11'
typing-extensions>=3.10.0.0;python_version < '3.8'
python_requires = >=3.6
typing-extensions>=4.1.0;python_version < '3.11'
python_requires = >=3.7
include_package_data = True
zip_safe = False
+4 -3
View File
@@ -1,13 +1,14 @@
from __future__ import annotations
from setuptools import setup
extras = {
"docs": [
"mkdocs-include-markdown-plugin==2.8.0",
"mkdocs==1.0.4", # Doesn't support Python 3.10+
"jinja2==3.0.3",
"mkdocs==1.3.1",
"jinja2>=3.1.2",
"pymdown-extensions",
"mkdocs-macros-plugin",
"markdown<3.4", # Breaks mkdocs 1.0.4
],
"test": [
"jinja2",
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Dict
from __future__ import annotations
import pytest
@@ -13,5 +13,5 @@ def pytest_addoption(parser) -> None:
@pytest.fixture(
params=[{"CIBW_BUILD_FRONTEND": "pip"}, {"CIBW_BUILD_FRONTEND": "build"}], ids=["pip", "build"]
)
def build_frontend_env(request) -> Dict[str, str]:
def build_frontend_env(request) -> dict[str, str]:
return request.param # type: ignore[no-any-return]
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import textwrap
import pytest
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import textwrap
from . import test_projects, utils
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
import textwrap
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
import textwrap
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
from . import test_projects, utils
before_test_project = test_projects.new_c_project()
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import textwrap
from . import test_projects, utils
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import platform
import textwrap
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import os
import jinja2
+6 -1
View File
@@ -1,3 +1,6 @@
from __future__ import annotations
import platform
import re
import textwrap
@@ -58,6 +61,8 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env):
build_environment = {}
if python_version == "3.6":
if utils.platform == "macos" and platform.machine() == "arm64":
pytest.skip("macOS arm64 does not support Python 3.6")
constraint_filename = "constraints-python36.txt"
build_pattern = "[cp]p36-*"
elif python_version == "3.7":
@@ -118,7 +123,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env):
tool_versions = {
"pip": "20.0.2",
"setuptools": "53.0.0",
"wheel": "0.34.2",
"wheel": "0.36.2",
"virtualenv": "20.11.2",
}
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
import pytest
+5 -1
View File
@@ -1,5 +1,8 @@
from __future__ import annotations
import os
import subprocess
import sys
import textwrap
import pytest
@@ -33,6 +36,7 @@ project_with_environment_asserts = test_projects.new_c_project(
def test(tmp_path):
python_echo = f"'{sys.executable}' -c \"import sys; print(*sys.argv[1:])\""
project_dir = tmp_path / "project"
project_with_environment_asserts.generate(project_dir)
@@ -43,7 +47,7 @@ def test(tmp_path):
project_dir,
add_env={
"CIBW_ENVIRONMENT": """CIBW_TEST_VAR="a b c" CIBW_TEST_VAR_2=1 CIBW_TEST_VAR_3="$(echo 'test string 3')" PATH=$PATH:/opt/cibw_test_path""",
"CIBW_ENVIRONMENT_WINDOWS": '''CIBW_TEST_VAR="a b c" CIBW_TEST_VAR_2=1 CIBW_TEST_VAR_3="$(echo 'test string 3')" PATH="$PATH;/opt/cibw_test_path"''',
"CIBW_ENVIRONMENT_WINDOWS": f'''CIBW_TEST_VAR="a b c" CIBW_TEST_VAR_2=1 CIBW_TEST_VAR_3="$({python_echo} 'test string 3')" PATH="$PATH;/opt/cibw_test_path"''',
},
)
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import os
import subprocess
import sys
+5 -4
View File
@@ -1,6 +1,7 @@
from __future__ import annotations
import platform
import subprocess
from typing import Tuple
import pytest
@@ -10,14 +11,14 @@ basic_project = test_projects.new_c_project()
ALL_MACOS_WHEELS = {
*utils.expected_wheels("spam", "0.1.0", machine_arch="x86_64"),
*utils.expected_wheels("spam", "0.1.0", machine_arch="arm64"),
*utils.expected_wheels("spam", "0.1.0", machine_arch="arm64", include_universal2=True),
}
def get_xcode_version() -> Tuple[int, int]:
def get_xcode_version() -> tuple[int, int]:
output = subprocess.run(
["xcodebuild", "-version"],
universal_newlines=True,
text=True,
check=True,
stdout=subprocess.PIPE,
).stdout
+2 -2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import platform
import textwrap
@@ -57,8 +59,6 @@ def test(manylinux_image, tmp_path):
elif platform.machine() not in ["x86_64", "i686"]:
if manylinux_image in ["manylinux1", "manylinux2010"]:
pytest.skip("manylinux1 and 2010 doesn't exist for non-x86 architectures")
elif manylinux_image == "manylinux_2_28" and platform.machine() == "s390x":
pytest.skip("manylinux_2_28 doesn't exist for s390x architecture")
elif manylinux_image == "manylinux_2_28" and platform.machine() == "i686":
pytest.skip("manylinux_2_28 doesn't exist for i686 architecture")
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import textwrap
from . import test_projects, utils
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import pytest
from . import test_projects, utils
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
from .base import TestProject
from .c import new_c_project
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import importlib
import subprocess
import sys
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
from pathlib import Path
from typing import Any, Dict, Union
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import jinja2
from .base import TestProject
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
from test import test_projects
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import subprocess
from test import test_projects
+2
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
import textwrap
from . import test_projects, utils
+5 -3
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
from pathlib import Path
import jinja2
@@ -49,13 +51,13 @@ def test(capfd, tmp_path):
add_env={
"CIBW_BEFORE_BUILD": "python {project}/bin/before_build.py",
"CIBW_TEST_COMMAND": "python {package}/test/run_tests.py",
# this shouldn't depend on the version of python, so build only CPython 3.6
"CIBW_BUILD": "cp36-*",
# this shouldn't depend on the version of python, so build only CPython 3.10
"CIBW_BUILD": "cp310-*",
},
)
# check that the expected wheels are produced
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp36" in w]
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp310" in w]
assert set(actual_wheels) == set(expected_wheels)
captured = capfd.readouterr()

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