diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 00000000..7385d88a
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,57 @@
+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:
+ 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: 90m
+ 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
diff --git a/CI.md b/CI.md
index 76167c35..dea5292a 100644
--- a/CI.md
+++ b/CI.md
@@ -1,10 +1,10 @@
This is a summary of the Python versions and platforms covered by the different CI platforms:
-| | 3.7 | 3.8 | 3.9 | 3.10 |
-|----------|-----------------------|---------------------------|----------|----------------|
-| Linux | AppVeyor¹ / Travis CI | Azure Pipelines / GitLab | CircleCI | GitHub Actions |
-| macOS | AppVeyor¹ / Travis CI | Azure Pipelines | CircleCI | GitHub Actions |
-| Windows | AppVeyor¹ / Travis CI | Azure Pipelines | | GitHub Actions |
+| | 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.
diff --git a/README.md b/README.md
index 162ae0c6..af5dbf5f 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ cibuildwheel
[](https://ci.appveyor.com/project/joerick/cibuildwheel/branch/main)
[](https://circleci.com/gh/pypa/cibuildwheel)
[](https://dev.azure.com/joerick0429/cibuildwheel/_build/latest?definitionId=4&branchName=main)
+[](https://cirrus-ci.com/github/pypa/cibuildwheel)
[Documentation](https://cibuildwheel.readthedocs.org)
@@ -39,7 +40,7 @@ What does it do?
³ 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.
- 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
@@ -50,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 | ✅ | ✅³ | ✅ | ✅ | ✅ |
¹ [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.
+² [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.
+³ [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.
@@ -179,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
diff --git a/bin/projects.py b/bin/projects.py
index 4b343391..dfd05d96 100644
--- a/bin/projects.py
+++ b/bin/projects.py
@@ -32,6 +32,7 @@ ICONS = (
"circleci",
"gitlab",
"travisci",
+ "cirrusci",
"windows",
"apple",
"linux",
diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py
index 8c424801..b96dfd2d 100755
--- a/bin/run_example_ci_configs.py
+++ b/bin/run_example_ci_configs.py
@@ -66,6 +66,11 @@ services = [
dst_config_path=".gitlab-ci.yml",
badge_md="[](https://gitlab.com/pypa/cibuildwheel/-/commits/{branch})",
),
+ CIService(
+ name="cirrus-ci",
+ dst_config_path=".cirrus.yml",
+ badge_md="[](https://cirrus-ci.com/github/pypa/cibuildwheel/{branch})",
+ ),
]
diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py
index 034673a2..3853ba28 100644
--- a/cibuildwheel/__main__.py
+++ b/cibuildwheel/__main__.py
@@ -160,9 +160,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,
diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py
index 2a0ec43f..d04ebf58 100644
--- a/cibuildwheel/linux.py
+++ b/cibuildwheel/linux.py
@@ -349,6 +349,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,
diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py
index 62422201..2cf16187 100644
--- a/cibuildwheel/util.py
+++ b/cibuildwheel/util.py
@@ -393,6 +393,7 @@ class CIProvider(Enum):
azure_pipelines = "azure_pipelines"
github_actions = "github_actions"
gitlab = "gitlab"
+ cirrus_ci = "cirrus_ci"
other = "other"
@@ -409,6 +410,8 @@ def detect_ci_provider() -> CIProvider | None:
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:
diff --git a/docs/changelog.md b/docs/changelog.md
index 1bce05a9..2b465a91 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -2,6 +2,8 @@
title: Changelog
---
+# Changelog
+
### v2.9.0
_11 August 2022_
diff --git a/docs/contributing.md b/docs/contributing.md
index 24566e4e..097fa6e2 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -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.
diff --git a/docs/cpp_standards.md b/docs/cpp_standards.md
index 468e4eb1..93a548a0 100644
--- a/docs/cpp_standards.md
+++ b/docs/cpp_standards.md
@@ -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.
diff --git a/docs/data/projects.yml b/docs/data/projects.yml
index ecdb4658..5129dbb6 100644
--- a/docs/data/projects.yml
+++ b/docs/data/projects.yml
@@ -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
diff --git a/docs/data/readme_icons/cirrusci.svg b/docs/data/readme_icons/cirrusci.svg
new file mode 100644
index 00000000..c92d3fe7
--- /dev/null
+++ b/docs/data/readme_icons/cirrusci.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/deliver-to-pypi.md b/docs/deliver-to-pypi.md
index a81abb4e..948662e3 100644
--- a/docs/deliver-to-pypi.md
+++ b/docs/deliver-to-pypi.md
@@ -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
diff --git a/docs/extra.css b/docs/extra.css
index a971d398..eac0a193 100644
--- a/docs/extra.css
+++ b/docs/extra.css
@@ -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 {
+
+}
diff --git a/docs/faq.md b/docs/faq.md
index 85314cd3..44647c23 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -2,6 +2,8 @@
title: Tips and tricks
---
+# Tips and tricks
+
## Tips
### Linux builds in containers
@@ -81,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
diff --git a/docs/index.md b/docs/index.md
index 897eaa10..b28a64bc 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -2,6 +2,8 @@
title: Home
---
+# cibuildwheel
+
{%
include-markdown "../README.md"
start=""
diff --git a/docs/options.md b/docs/options.md
index b6e0b0c5..c4f1f100 100644
--- a/docs/options.md
+++ b/docs/options.md
@@ -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`.
@@ -1352,6 +1364,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;
diff --git a/docs/setup.md b/docs/setup.md
index 2dce1f5b..a22e7825 100644
--- a/docs/setup.md
+++ b/docs/setup.md
@@ -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.
@@ -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).