Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🎡 Build Python wheels for all the platforms with minimal configuration.

License

NotificationsYou must be signed in to change notification settings

pypa/cibuildwheel

Repository files navigation

PyPIDocumentation StatusActions StatusTravis StatusCircleCI StatusAzure Status

Documentation

Python wheels are great. Building them acrossMac, Linux, Windows, onmultiple 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, CircleCI, and GitLab CI - and it builds and tests your wheels across all of your platforms.

What does it do?

While cibuildwheel itself requires a recent Python version to run (we support the last three releases), it can target the following versions to build wheels:

macOS IntelmacOS Apple SiliconWindows 64bitWindows 32bitWindows Arm64manylinux
musllinux x86_64
manylinux
musllinux i686
manylinux
musllinux aarch64
manylinux
musllinux ppc64le
manylinux
musllinux s390x
manylinux
musllinux armv7l
AndroidiOSPyodide
CPython 3.8N/A✅⁵N/AN/AN/A
CPython 3.9✅²✅⁵N/AN/AN/A
CPython 3.10✅²✅⁵N/AN/AN/A
CPython 3.11✅²✅⁵N/AN/AN/A
CPython 3.12✅²✅⁵N/AN/A✅⁴
CPython 3.13³✅²✅⁵✅⁴
CPython 3.14✅²✅⁵N/A
PyPy 3.8 v7.3N/AN/A✅¹✅¹✅¹N/AN/AN/AN/AN/AN/A
PyPy 3.9 v7.3N/AN/A✅¹✅¹✅¹N/AN/AN/AN/AN/AN/A
PyPy 3.10 v7.3N/AN/A✅¹✅¹✅¹N/AN/AN/AN/AN/AN/A
PyPy 3.11 v7.3N/AN/A✅¹✅¹✅¹N/AN/AN/AN/AN/AN/A
GraalPy 3.11 v24.2N/AN/A✅¹N/A✅¹N/AN/AN/AN/AN/AN/A
GraalPy 3.12 v25.0N/AN/A✅¹N/A✅¹N/AN/AN/AN/AN/AN/A

¹ PyPy & GraalPy are only supported for manylinux wheels.
² Windows arm64 support is experimental.
³ Free-threaded mode requires opt-in on 3.13 usingenable.
⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use--platform pyodide to build.
⁵ manylinux armv7l support is experimental. As there are no RHEL based image for this architecture, it's using an Ubuntu based image instead.

  • Builds manylinux, musllinux, macOS, and Windows wheels for CPython, PyPy, and GraalPy
  • Works on GitHub Actions, Azure Pipelines, Travis CI, CircleCI, GitLab CI, and Cirrus CI
  • Bundles shared library dependencies on Linux and macOS throughauditwheel anddelocate
  • Runs your library's tests against the wheel-installed version of your library

See thecibuildwheel 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:

LinuxmacOSWindowsLinux ARMmacOS ARMWindows ARMAndroidiOS
GitHub Actions✅²✅⁴✅³
Azure Pipelines✅²✅⁴✅³
Travis CI✅⁴
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 testarm64 on this CI platform.
³ Requires a macOS runner; runs tests on the simulator for the runner's architecture.
⁴ Building for Android requires the runner to be Linux x86_64, macOS ARM64 or macOS x86_64. Testing hasadditional requirements.

Example setup

To build manylinux, musllinux, macOS, and Windows wheels on GitHub Actions, you could use this.github/workflows/wheels.yml:

name:Buildon:[push, pull_request]jobs:build_wheels:name:Build wheels on ${{ matrix.os }}runs-on:${{ matrix.os }}strategy:matrix:os:[ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]steps:      -uses:actions/checkout@v5# Used to host cibuildwheel      -uses:actions/setup-python@v5      -name:Install cibuildwheelrun:python -m pip install cibuildwheel==3.3.0      -name:Build wheelsrun:python -m cibuildwheel --output-dir wheelhouse# to supply options, put them in 'env', like:# env:#   CIBW_SOME_OPTION: value#   ...      -uses:actions/upload-artifact@v4with:name:cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}path:./wheelhouse/*.whl

For more information, including PyPI deployment, and the use of other CI services or the dedicated GitHub Action, check out thedocumentation and theexamples.

How it works

The following diagram summarises the steps that cibuildwheel takes on each platform.

Explore an interactive version of this diagramin the docs.

OptionDescription
Build selectionplatformOverride the auto-detected target platform
build
skip
Choose the Python versions to build
archsChange the architectures built on your machine by default.
project-requires-pythonManually set the Python compatibility of your project
enableEnable building with extra categories of selectors present.
allow-emptySuppress the error code if no wheels match the specified build identifiers
Build customizationbuild-frontendSet the tool to use to build, either "build" (default), "build[uv]", or "pip"
config-settingsSpecify config-settings for the build backend.
environmentSet environment variables
environment-passSet environment variables on the host to pass-through to the container.
before-allExecute a shell command on the build system before any wheels are built.
before-buildExecute a shell command preparing each wheel's build
xbuild-toolsBinaries on the path that should be included in an isolated cross-build environment.
repair-wheel-commandExecute a shell command to repair each built wheel
manylinux-*-image
musllinux-*-image
Specify manylinux / musllinux container images
container-engineSpecify the container engine to use when building Linux wheels
dependency-versionsControl the versions of the tools cibuildwheel uses
pyodide-versionSpecify the Pyodide version to use forpyodide platform builds
Testingtest-commandThe command to test each built wheel
before-testExecute a shell command before testing each wheel
test-sourcesPaths that are copied into the working directory of the tests
test-requiresInstall Python dependencies before running the tests
test-extrasInstall your wheel for testing usingextras_require
test-groupsSpecify test dependencies from your project'sdependency-groups
test-skipSkip running tests on some builds
test-environmentSet environment variables for the test environment
test-runtimeControls how the tests will be executed.
Debuggingdebug-keep-containerKeep the container after running for debugging.
debug-tracebackPrint full traceback when errors occur.
build-verbosityIncrease/decrease the output of the build

These options can be specified in a pyproject.toml file, or as environment variables, seeconfiguration docs.

Working examples

Here are some repos that use cibuildwheel.

NameCIOSNotes
scikit-learngithub iconwindows iconapple iconlinux iconThe machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions.
duckdbgithub iconapple iconlinux iconwindows iconDuckDB is an analytical in-process SQL database management system
pytorch-fairseqgithub iconapple iconlinux iconFacebook AI Research Sequence-to-Sequence Toolkit written in Python.
NumPygithub icontravisci iconwindows iconapple iconlinux iconThe fundamental package for scientific computing with Python.
Tornadogithub iconlinux iconapple iconwindows iconTornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension.
NCNNgithub iconwindows iconapple iconlinux iconncnn is a high-performance neural network inference framework optimized for the mobile platform
Matplotlibgithub iconwindows iconapple iconlinux iconThe venerable Matplotlib, a Python library with C++ portions
MyPygithub iconapple iconlinux iconwindows iconThe compiled version of MyPy using MyPyC.
Prophetgithub iconwindows iconapple iconlinux iconTool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
Kivygithub iconwindows iconapple iconlinux iconOpen source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS

ℹ️ That's just a handful, there are many more! Check out theWorking Examples page in the docs.

Legal note

Sincecibuildwheel repairs the wheel withdelocate orauditwheel, it might automatically bundle dynamically linked libraries from the build machine.

It helps ensure that the library can run without any dependencies outside of the pip toolchain.

This is similar to static linking, so it might have some license implications. Check the license for any code you're pulling in to make sure that's allowed.

Changelog

v3.3.0

12 November 2025

  • 🐛 Fix an incompatibility with Docker v29 (#2660)
  • ✨ Addstest-runtime option, to customise how tests on simulated/emulated environments are run (#2636)
  • ✨ Adds support for newmanylinux_2_35 images on 32-bit ARMarmv7l, offering better C++20 compatibility (#2656)
  • build[uv] is now supported on Android (#2587)
  • ✨ You can now install extras (such asuv) with a simple option on the GitHub Action (#2630)
  • {project} and{package} placeholders are now supported inrepair-wheel-command (#2589)
  • 🛠 The versions set withdependency-versions no longer constrain packages specified by yourbuild-system.requires. Previously, on platforms other than Linux, the constraints in this option would remain in the environment during the build. This has been tidied up make behaviour more consistent between platforms, and to prevent version conflicts. (#2583)
  • 🛠 Improve the handling oftest-command on Android, enabling more options to be passed (#2590)
  • 📚 Docs improvements (#2618)

v3.2.1

12 October 2025

  • 🛠 Update to CPython 3.14.0 final (#2614)
  • 🐛 Fix the default MACOSX_DEPLOYMENT_TARGET on Python 3.14 (#2613)
  • 📚 Docs improvements (#2617)

v3.2.0

22 September 2025

  • ✨ Adds GraalPy v25 (Python 3.12) support (#2597)
  • 🛠 Update to CPython 3.14.0rc3 (#2602)
  • 🛠 Adds CPython 3.14.0 prerelease support for Android, and a number of improvements to Android builds (#2568, #2591)
  • 🛠 Improvements to testing on Android, passing environment markers when installing the venv, and providing more debug output when build-verbosity is set (#2575)
  • ⚠️ PyPy 3.10 was moved topypy-eol in theenable option, as it is now end-of-life. (#2521)
  • 📚 Docs improvements (#2574, #2601, #2598)

v3.1.4

19 August 2025

  • ✨ Add a--clean-cache command to clean up our cache (#2489)
  • 🛠 Update Python to 3.14rc2 and other patch version bumps (#2542, #2556)
  • 🛠 Update Pyodide to 0.28.2 (#2562, #2558)
  • 🐛 Fix resolution withpyodide-build whendependency-versions is set (#2548)
  • 🐛 SetCMAKE_FIND_ROOT_PATH_MODE_PACKAGE toBOTH on Android (#2547)
  • 🐛 Addpatchelf dependency for platforms that can build Android wheels (#2552)
  • 🐛 Ignore empty values forCIBW_ARCHS like most other environment variables (#2541)
  • 💼 Thecolor andsuggest_on_error argparse options are now default in 3.14rc1+ (#2554)
  • 💼 Use the virtualenv release URL instead of blob URL (should be more robust) (#2555)
  • 🧪 For iOS, lowering to macos-14 is needed for now due to issues with GitHub's runner images (#2557)
  • 🧪 Split out platforms iOS and Android in our tests (#2519)
  • 🧪 Fix and enable doctests (#2546)
  • 📚 Improve our docs on free-threading (#2549)

v3.1.3

1 August 2025

  • 🐛 Fix bug where "latest" dependencies couldn't update to pip 25.2 on Windows (#2537)
  • 🧪 Use pytest-rerunfailures to improve some of our iOS/Android tests (#2527, #2539)
  • 🧪 Remove some GraalPy Windows workarounds in our tests (#2501)

That's the last few versions.

ℹ️Want more changelog? Head over tothe changelog page in the docs.


Contributing

For more info on how to contribute to cibuildwheel, see thedocs.

Everyone interacting with the cibuildwheel project via codebase, issue tracker, chat rooms, or otherwise is expected to follow thePSF Code of Conduct.

Maintainers

Core:

Platform maintainers:

Credits

cibuildwheel stands on the shoulders of giants.

Massive props also to-

  • @zfrenchee forhelp debugging many issues
  • @lelit for some great bug reports andcontributions
  • @mayeut for aphenomenal PR patching Python itself for better compatibility!
  • @czaki for being a super-contributor over many PRs and helping out with countless issues!
  • @mattip for his help with adding PyPy support to cibuildwheel

See also

Another very similar tool to consider ismatthew-brett/multibuild.multibuild is a shell script toolbox for building a wheel on various platforms. It is used as a basis to build some of the big data science tools, like SciPy.

If you are building Rust wheels, you can get by without some of the tricks required to make GLIBC work via manylinux; this is especially relevant for cross-compiling, which is easy with Rust. Seematurin-action for a tool that is optimized for building Rust wheels and cross-compiling.


[8]ページ先頭

©2009-2025 Movatter.jp