cibuildwheel

Python wheels are great. Building them across Mac, Linux, Windows, on multiple versions of Python, is not.

cibuildwheel is here to help. cibuildwheel runs on your CI server - currently it supports GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI - and it builds and tests your wheels across all of your platforms.

What does it do?

macOS Intel macOS Apple Silicon Windows 64bit Windows 32bit Windows Arm64 manylinux
musllinux x86_64
manylinux
musllinux i686
manylinux
musllinux aarch64
manylinux
musllinux ppc64le
manylinux
musllinux s390x
CPython 3.6 N/A N/A
CPython 3.7 N/A N/A
CPython 3.8 N/A
CPython 3.9 ✅² ✅³
CPython 3.10 ✅²
CPython 3.11 ✅²
CPython 3.12⁵ ✅²
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
PyPy 3.9 v7.3 ✅⁴ N/A N/A ✅¹ ✅¹ ✅¹ N/A N/A
PyPy 3.10 v7.3 ✅⁴ N/A N/A ✅¹ ✅¹ ✅¹ N/A N/A

¹ PyPy is only supported for manylinux wheels.
² Windows arm64 support is experimental.
³ Alpine 3.14 and very briefly 3.15's default python3 was not able to load musllinux wheels. This has been fixed; please upgrade the python package if using Alpine from before the fix.
⁴ Cross-compilation not supported with PyPy - to build these wheels you need to run cibuildwheel on an Apple Silicon machine.
⁵ CPython 3.12 is available using the CIBW_PRERELEASE_PYTHONS option.

  • Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy
  • 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 and delocate
  • Runs your library's tests against the wheel-installed version of your library

See the cibuildwheel 1 documentation if you need to build unsupported versions of Python, such as Python 2.

Usage

cibuildwheel runs inside a CI service. Supported platforms depend on which service you're using:

Linux macOS Windows Linux ARM macOS ARM Windows ARM
GitHub Actions ✅¹ ✅² ✅⁴
Azure Pipelines ✅² ✅⁴
Travis CI
AppVeyor ✅² ✅⁴
CircleCI ✅²
Gitlab CI ✅¹
Cirrus CI ✅³

¹ Requires 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. It is not possible to test arm64 and the arm64 part of a universal2 wheel on this CI platform.
³ Uses cross-compilation. Thanks to Rosetta 2 emulation, it is possible to test x86_64 and both parts of a universal2 wheel on this CI platform.
Uses cross-compilation. It is not possible to test arm64 on this CI platform.

To get started, head over to the setup guide.

How it works

This diagram summarises the steps that cibuildwheel takes on each platform to build your package's wheels.

Manylinux container
Test virtualenv
Linux
macOS
Windows
For each version of Python
If tests are configured
{{action.label}}

This isn't exhaustive, for a full list of the things cibuildwheel can do, check the options page.