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 Travis CI and Appveyor - and it builds and tests your wheels across all of your platforms. **`cibuildwheel` is in beta**. It's brand new - I'd love for you to try it and help make it better! What does it do? ---------------- | | macOS 10.6+ | manylinux i686 | manylinux x86_64 | Windows 32bit | Windows 64bit | |---|---|---|---|---|---| | Python 2.7 | ✅ | ✅ | ✅ | ✅ | ✅ | | Python 3.3 | | ✅ | ✅ | ✅ | ✅ | | Python 3.4 | ✅ | ✅ | ✅ | ✅ | ✅ | | Python 3.5 | ✅ | ✅ | ✅ | ✅ | ✅ | | Python 3.6 | ✅ | ✅ | ✅ | ✅ | ✅ | - Builds manylinux, macOS and Windows (32 and 64bit) wheels using Travis CI and Appveyor - Bundles shared library dependencies on Linux and macOS through [auditwheel](https://github.com/pypa/auditwheel) and [delocate](https://github.com/matthew-brett/delocate) - Runs the library test suite against the wheel-installed version of your library Usage ----- `cibuildwheel` currently works on **Travis CI** to build Linux and Mac wheels, and **Appveyor** to build Windows wheels. `cibuildwheel` is not intended to run on your development machine. It will try to install packages globally; this is no good. Travis CI and Appveyor run their builds in isolated environments, so are ideal for this kind of script. ### Minimal setup - Create a `.travis.yml` file in your repo. ``` matrix: include: - sudo: required services: - docker - os: osx script: - pip install cibuildwheel - cibuildwheel --output-dir wheelhouse ``` Then setup a deployment method by following the [Travis CI deployment docs](https://docs.travis-ci.com/user/deployment/). - Create an `appveyor.yml` file in your repo. ``` build_script: - pip install cibuildwheel - cibuildwheel --output-dir wheelhouse artifacts: - path: "wheelhouse\\*.whl" name: Wheels ``` Appveyor will store the built wheels for you - you can access them from the project console. Alternatively, you may want to store them in the same place as the Travis CI build. See [Appveyor deployment docs](https://www.appveyor.com/docs/deployment/) for more info. - Commit those files, enable building of your repo on Travis CI and Appveyor, and push. All being well, you should get wheels delivered to you in a few minutes. > ⚠️ Got an error? Check the [checklist](#it-didnt-work) below. Options ------- ``` usage: cibuildwheel [-h] [--output-dir OUTPUT_DIR] [--platform PLATFORM] [project_dir] Build wheels for all the platforms. positional arguments: project_dir Path to the project that you want wheels for. Default: the current directory. optional arguments: -h, --help show this help message and exit --platform {auto,linux,macos,windows} Platform to build for. For "linux" you need docker running, on Mac or Linux. For "macos", you need a Mac machine, and note that this script is going to automatically install MacPython on your system, so don't run on your development machine. For "windows", you need to run in Windows, and it will build and test for all versions of Python at C:\PythonXX[-x64]. --output-dir OUTPUT_DIR Destination folder for the wheels. ``` Most of the config is via environment variables. These go into `.travis.yml` and `appveyor.yml` nicely. | Environment variable: `CIBW_PLATFORM` | Command line argument: `--platform` | --- | --- Options: `auto` `linux` `macos` `windows` Default: `auto` `auto` will auto-detect platform using environment variables, such as `TRAVIS_OS_NAME`/`APPVEYOR`. For `linux` you need Docker running, on Mac or Linux. For `macos`, you need a Mac machine, and note that this script is going to automatically install MacPython on your system, so don't run on your development machine. For `windows`, you need to run in Windows, and it will build and test for all versions of Python at `C:\PythonXX[-x64]`. | Environment variable: `CIBW_TEST_COMMAND` | --- Optional. Shell command to run the tests. The project root should be included in the command as "{project}". The wheel will be installed automatically and available for import from the tests. Example: `nosetests {project}/tests` | Environment variable: `CIBW_TEST_REQUIRES` | --- Optional. Space-separated list of dependencies required for running the tests. Example: `pytest` Example: `nose==1.3.7 moto==0.4.31` | Environment variable: `CIBW_SKIP` | 🔶 coming soon 🔶 | --- | --- Optional. Space-separated list of builds to skip. Each build has an identifier like `cp27-linux_x86_64` or `cp34-macosx_10_6_intel` - you can list ones to skip here and `cibuildwheel` won't try to build them. The format is `python_tag-platform_tag`. The tags are as defined in [PEP 0425](https://www.python.org/dev/peps/pep-0425/#details). Python tags look like `cp27` `cp34` `cp35` `cp36` Platform tags look like `macosx_10_6_intel` `linux_x86_64` `linux_i386` `win32` `win_amd64` You can also use shell-style globbing syntax (as per `fnmatch`) Example: `cp27-macosx_10_6_intel ` (don't build on Python 2 on Mac) Example: `cp27-win*` (don't build on Python 2.7 on Windows) Example: `cp34-*` (don't build on Python 3.4) -- #### Example YML syntax
example .travis.yml environment variables |
example appveyor.yml environment variables |