Skip to content

Commit 67903ae

Browse files
committed
Undo reflow; pushing to a potentially separate PR
1 parent 6eda6ef commit 67903ae

File tree

1 file changed

+29
-103
lines changed

1 file changed

+29
-103
lines changed

docs/options.md

Lines changed: 29 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,11 @@ CIBW_PROJECT_REQUIRES_PYTHON: ">=3.6"
299299
### `CIBW_ENVIRONMENT` {: #environment}
300300
> Set environment variables needed during the build
301301

302-
A space-separated list of environment variables to set during the build. Bash
303-
syntax should be used, even on Windows.
302+
A space-separated list of environment variables to set during the build. Bash syntax should be used, even on Windows.
304303

305-
You must set this variable to pass variables to Linux builds (since they
306-
execute in a Docker container). It also works for the other platforms.
304+
You must set this variable to pass variables to Linux builds (since they execute in a Docker container). It also works for the other platforms.
307305

308-
You can use `$PATH` syntax to insert other variables, or the `$(pwd)` syntax to
309-
insert the output of other shell commands.
306+
You can use `$PATH` syntax to insert other variables, or the `$(pwd)` syntax to insert the output of other shell commands.
310307

311308
To specify more than one environment variable, separate the assignments by spaces.
312309

@@ -332,29 +329,18 @@ CIBW_ENVIRONMENT: "BUILD_TIME=$(date) SAMPLE_TEXT=\"sample text\""
332329
```
333330
334331
!!! note
335-
`cibuildwheel` always defines the environment variable `CIBUILDWHEEL=1`.
336-
This can be useful for [building wheels with optional
337-
extensions](faq.md#building-packages-with-optional-c-extensions).
332+
`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).
338333

339334
### `CIBW_BEFORE_ALL` {: #before-all}
340335
> Execute a shell command on the build system before any wheels are built.
341336

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).
344338

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.
351340

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`.
354342

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.
358344

359345
Platform-specific variants also available:<br/>
360346
`CIBW_BEFORE_ALL_MACOS` | `CIBW_BEFORE_ALL_WINDOWS` | `CIBW_BEFORE_ALL_LINUX`
@@ -376,21 +362,11 @@ instead.
376362
### `CIBW_BEFORE_BUILD` {: #before-build}
377363
> Execute a shell command preparing each wheel's build
378364

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.
383366

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.
389368

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`.
394370

395371
The command is run in a shell, so you can write things like `cmd1 && cmd2`.
396372

@@ -447,9 +423,8 @@ Default:
447423
- on macOS: `'delocate-listdeps {wheel} && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}'`
448424
- on Windows: `''`
449425

450-
A shell command to repair a built wheel by copying external library
451-
dependencies into the wheel tree and relinking them. The command is run on
452-
each built wheel (except for pure Python ones) before testing it.
426+
A shell command to repair a built wheel by copying external library dependencies into the wheel tree and relinking them.
427+
The command is run on each built wheel (except for pure Python ones) before testing it.
453428

454429
The following placeholders must be used inside the command and will be replaced by `cibuildwheel`:
455430

@@ -476,51 +451,16 @@ CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --lib-sdir . -w {dest_dir} {
476451
### `CIBW_MANYLINUX_X86_64_IMAGE`, `CIBW_MANYLINUX_I686_IMAGE`, `CIBW_MANYLINUX_PYPY_X86_64_IMAGE`, `CIBW_MANYLINUX_AARCH64_IMAGE`, `CIBW_MANYLINUX_PPC64LE_IMAGE`, `CIBW_MANYLINUX_S390X_IMAGE` {: #manylinux-image}
477452
> Specify alternative manylinux docker images
478453

479-
An alternative Docker image to be used for building
480-
[`manylinux`](https://github.com/pypa/manylinux) wheels. `cibuildwheel` will
481-
then pull these instead of the default images,
482-
[`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64),
483-
[`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686),
484-
[`pypywheels/manylinux2010-pypy_x86_64`](https://hub.docker.com/r/pypywheels/manylinux2010-pypy_x86_64),
485-
[`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64),
486-
[`quay.io/pypa/manylinux2014_ppc64le`](https://quay.io/pypa/manylinux2014_ppc64le),
487-
and
488-
[`quay.io/pypa/manylinux2014_s390x`](https://quay.io/pypa/manylinux2010_s390x).
489-
490-
The value of this option can either be set to `manylinux1`, `manylinux2010`,
491-
`manylinux2014` or `manylinux_2_24` to use a pinned version of the [official
492-
`manylinux` images](https://github.com/pypa/manylinux) and [PyPy `manylinux`
493-
images](https://github.com/pypy/manylinux). Alternatively, set these options to
494-
any other valid Docker image name. Note that for PyPy, only the official
495-
`manylinux2010` image is currently available. For architectures other than x86
496-
(x86\_64 and i686) `manylinux2014` or `manylinux_2_24` must be used because the
497-
first version of the manylinux specification that supports additional
498-
architectures is `manylinux2014`.
499-
500-
Beware to specify a valid Docker image that can be used in the same way as the
501-
official, default Docker images: all necessary Python and pip versions need to
502-
be present in `/opt/python/`, and the `auditwheel` tool needs to be present for
503-
`cibuildwheel` to work. Apart from that, the architecture and relevant shared
504-
system libraries need to be manylinux1-, manylinux2010- or
505-
manylinux2014-compatible in order to produce valid
506-
`manylinux1`/`manylinux2010`/`manylinux2014`/`manylinux_2_24` wheels (see
507-
[pypa/manylinux on GitHub](https://github.com/pypa/manylinux), [PEP
508-
513](https://www.python.org/dev/peps/pep-0513/), [PEP
509-
571](https://www.python.org/dev/peps/pep-0571/), [PEP
510-
599](https://www.python.org/dev/peps/pep-0599/) and [PEP
511-
600](https://www.python.org/dev/peps/pep-0600/) for more details).
512-
513-
Note that `auditwheel` detects the version of the `manylinux` standard in the
514-
Docker image through the `AUDITWHEEL_PLAT` environment variable, as
515-
`cibuildwheel` has no way of detecting the correct `--plat` command line
516-
argument to pass to `auditwheel` for a custom image. If a Docker image does not
517-
correctly set this `AUDITWHEEL_PLAT` environment variable, the
518-
`CIBW_ENVIRONMENT` option can be used to do so (e.g.,
519-
`CIBW_ENVIRONMENT='AUDITWHEEL_PLAT="manylinux2010_$(uname -m)"'`).
520-
521-
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).
524464

525465
#### Examples
526466

@@ -636,16 +576,10 @@ CIBW_TEST_COMMAND: "echo Wheel installed"
636576
### `CIBW_BEFORE_TEST` {: #before-test}
637577
> Execute a shell command before testing each wheel
638578

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)
644581

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`.
649583

650584
The command is run in a shell, so you can write things like `cmd1 && cmd2`.
651585

@@ -710,14 +644,9 @@ CIBW_TEST_EXTRAS: test,qt
710644
### `CIBW_TEST_SKIP` {: #test-skip}
711645
> Skip running tests on some builds
712646

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.
717648

718-
With macOS `universal2` wheels, you can also skip the the individual archs
719-
inside the wheel using an `:arch` suffix. For example,
720-
`cp39-macosx_universal2:x86_64` or `cp39-macosx_universal2:arm64`.
649+
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`.
721650

722651
#### Examples
723652

@@ -735,10 +664,7 @@ CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
735664
### `CIBW_BUILD_VERBOSITY` {: #build-verbosity}
736665
> Increase/decrease the output of pip wheel
737666

738-
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.
742668

743669
Platform-specific variants also available:<br/>
744670
`CIBW_BUILD_VERBOSITY_MACOS` | `CIBW_BUILD_VERBOSITY_WINDOWS` | `CIBW_BUILD_VERBOSITY_LINUX`

0 commit comments

Comments
 (0)