Skip to content

Commit f89f68a

Browse files
committed
docs: fix more issues, normalize a bit
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 23afecf commit f89f68a

File tree

1 file changed

+58
-75
lines changed

1 file changed

+58
-75
lines changed

docs/options.md

Lines changed: 58 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ builds.
354354

355355
Unlike all other cibuildwheel options, the environment variable setting will
356356
only add to the TOML config; you can't remove an enable by setting an empty or
357-
partial list in environment variables; use `CIBW_SKIP` instead.
357+
partial list in environment variables; use `CIBW_SKIP` instead. This way, if
358+
you apply `cpython-prerelease` during the beta period using `CIBW_ENABLE`
359+
without disabling your other enables.
358360

359361

360362
#### Examples
@@ -369,6 +371,9 @@ partial list in environment variables; use `CIBW_SKIP` instead.
369371
# Skip building free-threaded compatible wheels on Windows
370372
enable = ["cpython-freethreading"]
371373
skip = "*t-win*"
374+
375+
# Include all PyPy versions
376+
enable = ["pypy", "pypy-eol"]
372377
```
373378

374379

@@ -387,15 +392,11 @@ partial list in environment variables; use `CIBW_SKIP` instead.
387392
# Skip building free-threaded compatible wheels on Windows
388393
CIBW_ENABLE: cpython-freethreading
389394
CIBW_SKIP: *t-win*
390-
```
391-
392-
It is generally recommended to use `cpython-freethreading` in a config
393-
file as you can statically declare that you support free-threaded builds.
394-
395395

396+
# Include all PyPy versions
397+
CIBW_ENABLE = pypy pypy-eol
398+
```
396399

397-
It is generally not recommended to use `cpython-prerelease` in a config file,
398-
as it's intended for testing pre-releases for a 2-3 month period only.
399400

400401

401402
### `CIBW_ALLOW_EMPTY` {: #allow-empty cmd-line env-var}
@@ -588,6 +589,8 @@ Platform-specific environment variables are also available:<br/>
588589
SAMPLE_TEXT = "sample text"
589590
```
590591

592+
In configuration files, you can use a [TOML][] table instead of a raw string as shown above.
593+
591594
!!! tab examples "Environment variables"
592595

593596
```yaml
@@ -617,8 +620,6 @@ Platform-specific environment variables are also available:<br/>
617620

618621
Separate multiple values with a space.
619622

620-
In configuration mode, you can use a [TOML][] table instead of a raw string as shown above.
621-
622623
!!! note
623624
cibuildwheel always defines the environment variable `CIBUILDWHEEL=1`. This can be useful for [building wheels with optional extensions](faq.md#optional-extensions).
624625

@@ -637,31 +638,31 @@ To specify more than one environment variable, separate the variable names by sp
637638

638639
#### Examples
639640

640-
!!! tab examples "Environment passthrough"
641+
!!! tab examples "pyproject.toml"
642+
643+
```toml
644+
[tool.cibuildwheel.linux]
641645

642-
```yaml
643646
# Export a variable
644-
CIBW_ENVIRONMENT_PASS_LINUX: CFLAGS
647+
environment-pass = ["CFLAGS"]
645648

646649
# Set two flags variables
647-
CIBW_ENVIRONMENT_PASS_LINUX: BUILD_TIME SAMPLE_TEXT
650+
environment-pass = ["BUILD_TIME", "SAMPLE_TEXT"]
648651
```
649652

650-
Separate multiple values with a space.
651-
652-
!!! tab examples "pyproject.toml"
653+
In configuration files, you can use a [TOML][] list instead of a raw string as shown above.
653654

654-
```toml
655-
[tool.cibuildwheel.linux]
655+
!!! tab examples "Environment variables"
656656

657+
```yaml
657658
# Export a variable
658-
environment-pass = ["CFLAGS"]
659+
CIBW_ENVIRONMENT_PASS_LINUX: CFLAGS
659660

660661
# Set two flags variables
661-
environment-pass = ["BUILD_TIME", "SAMPLE_TEXT"]
662+
CIBW_ENVIRONMENT_PASS_LINUX: BUILD_TIME SAMPLE_TEXT
662663
```
663664

664-
In configuration mode, you can use a [TOML][] list instead of a raw string as shown above.
665+
Separate multiple values with a space.
665666

666667
### `before-all` {: #before-all env-var toml}
667668
> Execute a shell command on the build system before any wheels are built.
@@ -705,6 +706,8 @@ Platform-specific environment variables also available:<br/>
705706
]
706707
```
707708

709+
In configuration files, you can use a TOML array, and each line will be run sequentially - joined with `&&`.
710+
708711
!!! tab examples "Environment variables"
709712

710713
```yaml
@@ -726,12 +729,10 @@ Platform-specific environment variables also available:<br/>
726729
here.](https://yaml-multiline.info).
727730

728731

729-
730-
In configuration files, you can use a TOML array, and each line will be run sequentially - joined with `&&`.
731-
732-
Note that manylinux_2_31 builds occur inside a debian derivative docker container, where
733-
manylinux2014 builds occur inside a CentOS one. So for `manylinux_2_31` the `CIBW_BEFORE_ALL_LINUX` command
734-
must use `apt-get -y` instead.
732+
Note that `manylinux_2_31` builds occur inside a Debian derivative docker
733+
container, where `manylinux2014` builds occur inside a CentOS one. So for
734+
`manylinux_2_31` the `CIBW_BEFORE_ALL_LINUX` command must use `apt-get -y`
735+
instead.
735736

736737
### `before-build` {: #before-build env-var toml}
737738
> Execute a shell command preparing each wheel's build
@@ -772,6 +773,10 @@ Platform-specific environment variables are also available:<br/>
772773
before-build = "{package}/script/prepare_for_build.sh"
773774
```
774775

776+
In configuration files, you can use a array, and the items will be joined
777+
with `&&`. In TOML, using a single-quote string will avoid escapes - useful for
778+
Windows paths.
779+
775780
!!! tab examples "Environment variables"
776781

777782
```yaml
@@ -789,10 +794,6 @@ Platform-specific environment variables are also available:<br/>
789794
```
790795

791796

792-
793-
In configuration mode, you can use a array, and the items will be joined with `&&`. In TOML, using a single-quote string will avoid escapes - useful for
794-
Windows paths.
795-
796797
!!! note
797798
If you need Python dependencies installed for the build, we recommend using
798799
`pyproject.toml`'s `build-system.requires` instead. This is an example
@@ -802,18 +803,15 @@ Platform-specific environment variables are also available:<br/>
802803
requires = [
803804
"setuptools>=42",
804805
"Cython",
805-
"numpy==1.13.3; python_version<'3.5'",
806-
"oldest-supported-numpy; python_version>='3.5'",
806+
"numpy",
807807
]
808808

809809
build-backend = "setuptools.build_meta"
810810

811811
This [PEP 517][]/[PEP 518][] style build allows you to completely control
812812
the build environment in cibuildwheel, [PyPA-build][], and pip, doesn't
813813
force downstream users to install anything they don't need, and lets you do
814-
more complex pinning (Cython, for example, requires a wheel to be built
815-
with an equal or earlier version of NumPy; pinning in this way is the only
816-
way to ensure your module works on all available NumPy versions).
814+
more complex pinning.
817815

818816
[PyPA-build]: https://pypa-build.readthedocs.io/en/latest/
819817
[PEP 517]: https://www.python.org/dev/peps/pep-0517/
@@ -843,28 +841,22 @@ Platform-specific environment variables are also available on platforms that use
843841
[tool.cibuildwheel]
844842
# Allow access to the cmake and rustc binaries in the isolated cross-build environment.
845843
xbuild-tools = ["cmake", "rustc"]
844+
845+
# No cross-build tools are required
846+
xbuild-tools = []
846847
```
847848

848849
!!! tab examples "Environment variables"
849850

850851
```yaml
851852
# Allow access to the cmake and rustc binaries in the isolated cross-build environment.
852853
CIBW_XBUILD_TOOLS: cmake rustc
853-
```
854854

855-
```yaml
856855
# No cross-build tools are required
857856
CIBW_XBUILD_TOOLS:
858857
```
859858

860859

861-
862-
```toml
863-
[tool.cibuildwheel]
864-
# No cross-build tools are required
865-
xbuild-tools = []
866-
```
867-
868860
### `repair-wheel-command` {: #repair-wheel-command env-var toml}
869861
> Execute a shell command to repair each built wheel
870862
@@ -948,6 +940,9 @@ Platform-specific environment variables are also available:<br/>
948940
]
949941
```
950942

943+
In configuration files, you can use an inline array, and the items will be joined with `&&`.
944+
945+
951946
!!! tab examples "Environment variables"
952947

953948
```yaml
@@ -979,10 +974,6 @@ Platform-specific environment variables are also available:<br/>
979974
```
980975

981976

982-
983-
In configuration mode, you can use an inline array, and the items will be joined with `&&`.
984-
985-
986977
<div class="link-target" id="manylinux-image"></div>
987978

988979
### `manylinux-*-image`, `musllinux-*-image` {: #linux-image env-var toml}
@@ -1069,6 +1060,9 @@ Auditwheel detects the version of the manylinux / musllinux standard in the imag
10691060
musllinux-i686-image = "quay.io/pypa/musllinux_1_1_i686:latest"
10701061
```
10711062

1063+
Like any other option, these can be placed in `[tool.cibuildwheel.linux]`
1064+
if you prefer; they have no effect on `macos` and `windows`.
1065+
10721066
!!! tab examples "Environment variables"
10731067

10741068
```yaml
@@ -1094,11 +1088,6 @@ Auditwheel detects the version of the manylinux / musllinux standard in the imag
10941088
```
10951089

10961090

1097-
1098-
Like any other option, these can be placed in `[tool.cibuildwheel.linux]`
1099-
if you prefer; they have no effect on `macos` and `windows`.
1100-
1101-
11021091
### `container-engine` {: #container-engine env-var toml}
11031092
> Specify the container engine to use when building Linux wheels
11041093
@@ -1162,7 +1151,6 @@ Options can be supplied after the name.
11621151

11631152

11641153

1165-
11661154
### `dependency-versions` {: #dependency-versions env-var toml}
11671155

11681156
> Control the versions of the tools cibuildwheel uses
@@ -1302,6 +1290,9 @@ Platform-specific environment variables are also available:<br/>
13021290
]
13031291
```
13041292

1293+
In configuration files, you can use an array, and the items will be joined with `&&`.
1294+
1295+
13051296
!!! tab examples "Environment variables"
13061297

13071298
```yaml
@@ -1318,9 +1309,6 @@ Platform-specific environment variables are also available:<br/>
13181309
```
13191310

13201311

1321-
1322-
In configuration files, you can use an array, and the items will be joined with `&&`.
1323-
13241312
### `before-test` {: #before-test env-var toml}
13251313
> Execute a shell command before testing each wheel
13261314
@@ -1363,6 +1351,8 @@ Platform-specific environment variables are also available:<br/>
13631351
before-test = "pip install cmake scikit-build"
13641352
```
13651353

1354+
In configuration files, you can use an array, and the items will be joined with `&&`.
1355+
13661356
!!! tab examples "Environment variables"
13671357

13681358
```yaml
@@ -1384,10 +1374,6 @@ Platform-specific environment variables are also available:<br/>
13841374
```
13851375

13861376

1387-
1388-
In configuration files, you can use an array, and the items will be joined with `&&`.
1389-
1390-
13911377
### `test-sources` {: #test-sources env-var toml}
13921378
> Files and folders from the source tree that are copied into an isolated tree before running the tests
13931379
@@ -1414,6 +1400,8 @@ Platform-specific environment variables are also available:<br/>
14141400
test-sources = ["tests", "data/test-image.png"]
14151401
```
14161402

1403+
In configuration files, you can use an array, and the items will be joined with a space.
1404+
14171405
!!! tab examples "Environment variables"
14181406

14191407
```yaml
@@ -1422,10 +1410,6 @@ Platform-specific environment variables are also available:<br/>
14221410
```
14231411

14241412

1425-
1426-
In configuration files, you can use an array, and the items will be joined with a space.
1427-
1428-
14291413
### `test_requires` {: #test-requires env-var toml}
14301414
> Install Python dependencies before running the tests
14311415
@@ -1448,6 +1432,8 @@ Platform-specific environment variables are also available:<br/>
14481432
test-requires = ["pytest==8.2.2", "packaging==24.1"]
14491433
```
14501434

1435+
In configuration files, you can use an array, and the items will be joined with a space.
1436+
14511437
!!! tab examples "Environment variables"
14521438

14531439
```yaml
@@ -1458,7 +1444,6 @@ Platform-specific environment variables are also available:<br/>
14581444
CIBW_TEST_REQUIRES: pytest==8.2.2 packaging==24.1
14591445
```
14601446

1461-
In configuration files, you can use an array, and the items will be joined with a space.
14621447

14631448

14641449
### `test-extras` {: #test-extras env-var toml}
@@ -1484,6 +1469,8 @@ Platform-specific environment variables are also available:<br/>
14841469
test-extras = ["test", "qt"]
14851470
```
14861471

1472+
In configuration files, you can use an inline array, and the items will be joined with a comma.
1473+
14871474
!!! tab examples "Environment variables"
14881475

14891476
```yaml
@@ -1495,9 +1482,6 @@ Platform-specific environment variables are also available:<br/>
14951482

14961483

14971484

1498-
In configuration files, you can use an inline array, and the items will be joined with a comma.
1499-
1500-
15011485
### `test-groups` {: #test-groups env-var toml}
15021486
> Specify test dependencies from your project's `dependency-groups`
15031487
@@ -1520,6 +1504,9 @@ Platform-specific environment variables are also available:<br/>
15201504
test-groups = ["test", "qt"]
15211505
```
15221506

1507+
In configuration files, you can use an inline array, and the items will be joined with a space.
1508+
1509+
15231510
!!! tab examples "Environment variables"
15241511

15251512
```yaml
@@ -1529,10 +1516,6 @@ Platform-specific environment variables are also available:<br/>
15291516

15301517
Separate multiple items with a space.
15311518

1532-
1533-
1534-
In configuration files, you can use an inline array, and the items will be joined with a space.
1535-
15361519
### `test-skip` {: #test-skip env-var toml}
15371520
> Skip running tests on some builds
15381521

0 commit comments

Comments
 (0)