You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`cibuildwheel` always defines the environment variable `CIBUILDWHEEL=1`. This can be useful for [building wheels with optional extensions](faq.md#building-packages-with-optional-c-extensions).
338
333
339
334
### `CIBW_BEFORE_ALL` {: #before-all}
340
335
> Execute a shell command on the build system before any wheels are built.
341
336
342
-
Shell command to prepare a common part of the project (e.g. build or install
343
-
libraries which does not depend on the specific version of Python).
337
+
Shell command to prepare a common part of the project (e.g. build or install libraries which does not depend on the specific version of Python).
344
338
345
-
This option is very useful for the Linux build, where builds take place in
346
-
isolated Docker containers managed by cibuildwheel. This command will run
347
-
inside the container before the wheel builds start. Note, if you're building
348
-
both x86_64 and i686 wheels (the default), your build uses two different Docker
349
-
images. In that case, this command will execute twice - once per build
350
-
container.
339
+
This option is very useful for the Linux build, where builds take place in isolated Docker containers managed by cibuildwheel. This command will run inside the container before the wheel builds start. Note, if you're building both x86_64 and i686 wheels (the default), your build uses two different Docker images. In that case, this command will execute twice - once per build container.
351
340
352
-
The placeholder `{package}` can be used here; it will be replaced by the path
353
-
to the package being built by `cibuildwheel`.
341
+
The placeholder `{package}` can be used here; it will be replaced by the path to the package being built by `cibuildwheel`.
354
342
355
-
On Windows and macOS, the version of Python available inside `CIBW_BEFORE_ALL`
356
-
is whatever is available on the host machine. On Linux, a modern Python version
357
-
is available on PATH.
343
+
On Windows and macOS, the version of Python available inside `CIBW_BEFORE_ALL` is whatever is available on the host machine. On Linux, a modern Python version is available on PATH.
> Execute a shell command preparing each wheel's build
378
364
379
-
A shell command to run before building the wheel. This option allows you to run
380
-
a command in **each** Python environment before the `pip wheel` command. This
381
-
is useful if you need to set up some dependency so it's available during the
382
-
build.
365
+
A shell command to run before building the wheel. This option allows you to run a command in **each** Python environment before the `pip wheel` command. This is useful if you need to set up some dependency so it's available during the build.
383
366
384
-
If dependencies are required to build your wheel (for example if you include a
385
-
header from a Python module), instead of using this command, we recommend
386
-
adding requirements to a pyproject.toml file. This is reproducible, and users
387
-
who do not get your wheels (such as Alpine or ClearLinux users) will still
388
-
benefit.
367
+
If dependencies are required to build your wheel (for example if you include a header from a Python module), instead of using this command, we recommend adding requirements to a pyproject.toml file. This is reproducible, and users who do not get your wheels (such as Alpine or ClearLinux users) will still benefit.
389
368
390
-
The active Python binary can be accessed using `python`, and pip with `pip`;
391
-
`cibuildwheel`makes sure the right version of Python and pip will be executed.
392
-
The placeholder `{package}` can be used here; it will be replaced by the path
393
-
to the package being built by `cibuildwheel`.
369
+
The active Python binary can be accessed using `python`, and pip with `pip`; `cibuildwheel` makes sure the right version of Python and pip will be executed. The placeholder `{package}` can be used here; it will be replaced by the path to the package being built by `cibuildwheel`.
394
370
395
371
The command is run in a shell, so you can write things like `cmd1 && cmd2`.
Note that `manylinux2014`/`manylinux_2_24` don't support builds with Python 2.7
522
-
- when building with `manylinux2014`/`manylinux_2_24`, skip Python 2.7 using
523
-
`CIBW_SKIP`(see example below).
454
+
An alternative Docker image to be used for building [`manylinux`](https://github.com/pypa/manylinux) wheels. `cibuildwheel` will then pull these instead of the default images, [`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64), [`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686), [`pypywheels/manylinux2010-pypy_x86_64`](https://hub.docker.com/r/pypywheels/manylinux2010-pypy_x86_64), [`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64), [`quay.io/pypa/manylinux2014_ppc64le`](https://quay.io/pypa/manylinux2014_ppc64le), and [`quay.io/pypa/manylinux2014_s390x`](https://quay.io/pypa/manylinux2010_s390x).
455
+
456
+
The value of this option can either be set to `manylinux1`, `manylinux2010`, `manylinux2014` or `manylinux_2_24` to use a pinned version of the [official `manylinux` images](https://github.com/pypa/manylinux) and [PyPy `manylinux` images](https://github.com/pypy/manylinux). Alternatively, set these options to any other valid Docker image name. Note that for PyPy, only the official `manylinux2010` image is currently available. For architectures other
457
+
than x86 (x86\_64 and i686) `manylinux2014` or `manylinux_2_24` must be used because the first version of the manylinux specification that supports additional architectures is `manylinux2014`.
458
+
459
+
Beware to specify a valid Docker image that can be used in the same way as the official, default Docker images: all necessary Python and pip versions need to be present in `/opt/python/`, and the `auditwheel` tool needs to be present for `cibuildwheel` to work. Apart from that, the architecture and relevant shared system libraries need to be manylinux1-, manylinux2010- or manylinux2014-compatible in order to produce valid `manylinux1`/`manylinux2010`/`manylinux2014`/`manylinux_2_24` wheels (see [pypa/manylinux on GitHub](https://github.com/pypa/manylinux), [PEP 513](https://www.python.org/dev/peps/pep-0513/), [PEP 571](https://www.python.org/dev/peps/pep-0571/), [PEP 599](https://www.python.org/dev/peps/pep-0599/) and [PEP 600](https://www.python.org/dev/peps/pep-0600/) for more details).
460
+
461
+
Note that `auditwheel` detects the version of the `manylinux` standard in the Docker image through the `AUDITWHEEL_PLAT` environment variable, as `cibuildwheel` has no way of detecting the correct `--plat` command line argument to pass to `auditwheel` for a custom image. If a Docker image does not correctly set this `AUDITWHEEL_PLAT` environment variable, the `CIBW_ENVIRONMENT` option can be used to do so (e.g., `CIBW_ENVIRONMENT='AUDITWHEEL_PLAT="manylinux2010_$(uname -m)"'`).
462
+
463
+
Note that `manylinux2014`/`manylinux_2_24` don't support builds with Python 2.7 - when building with `manylinux2014`/`manylinux_2_24`, skip Python 2.7 using `CIBW_SKIP` (see example below).
> Execute a shell command before testing each wheel
638
578
639
-
A shell command to run in **each** test virtual environment, before your wheel
640
-
is installed and tested. This is useful if you need to install a non pip
641
-
package, change values of environment variables or perform multi step pip
642
-
installation (e.g. installing `scikit-build` or `cython` before install test
643
-
package)
579
+
A shell command to run in **each** test virtual environment, before your wheel is installed and tested. This is useful if you need to install a non pip package, change values of environment variables
580
+
or perform multi step pip installation (e.g. installing `scikit-build` or `cython` before install test package)
644
581
645
-
The active Python binary can be accessed using `python`, and pip with `pip`;
646
-
`cibuildwheel`makes sure the right version of Python and pip will be executed.
647
-
The placeholder `{package}` can be used here; it will be replaced by the path
648
-
to the package being built by `cibuildwheel`.
582
+
The active Python binary can be accessed using `python`, and pip with `pip`; `cibuildwheel` makes sure the right version of Python and pip will be executed. The placeholder `{package}` can be used here; it will be replaced by the path to the package being built by `cibuildwheel`.
649
583
650
584
The command is run in a shell, so you can write things like `cmd1 && cmd2`.
651
585
@@ -710,14 +644,9 @@ CIBW_TEST_EXTRAS: test,qt
710
644
### `CIBW_TEST_SKIP` {: #test-skip}
711
645
> Skip running tests on some builds
712
646
713
-
This will skip testing on any identifiers that match the given skip patterns
714
-
(see [`CIBW_SKIP`](#build-skip)). This can be used to mask out tests for wheels
715
-
that have missing dependencies upstream that are slow or hard to build, or to
716
-
mask up slow tests on emulated architectures.
647
+
This will skip testing on any identifiers that match the given skip patterns (see [`CIBW_SKIP`](#build-skip)). This can be used to mask out tests for wheels that have missing dependencies upstream that are slow or hard to build, or to mask up slow tests on emulated architectures.
717
648
718
-
With macOS `universal2` wheels, you can also skip the the individual archs
719
-
inside the wheel using an `:arch` suffix. For example,
With macOS `universal2` wheels, you can also skip the the individual archs inside the wheel using an `:arch` suffix. For example, `cp39-macosx_universal2:x86_64` or `cp39-macosx_universal2:arm64`.
An number from 1 to 3 to increase the level of verbosity (corresponding to
739
-
invoking pip with `-v`, `-vv`, and `-vvv`), between -1 and -3 (`-q`, `-qq`, and
740
-
`-qqq`), or just 0 (default verbosity). These flags are useful while debugging
741
-
a build when the output of the actual build invoked by `pip wheel` is required.
667
+
An number from 1 to 3 to increase the level of verbosity (corresponding to invoking pip with `-v`, `-vv`, and `-vvv`), between -1 and -3 (`-q`, `-qq`, and `-qqq`), or just 0 (default verbosity). These flags are useful while debugging a build when the output of the actual build invoked by `pip wheel` is required.
0 commit comments