@@ -354,7 +354,9 @@ builds.
354
354
355
355
Unlike all other cibuildwheel options, the environment variable setting will
356
356
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.
358
360
359
361
360
362
#### Examples
@@ -369,6 +371,9 @@ partial list in environment variables; use `CIBW_SKIP` instead.
369
371
# Skip building free-threaded compatible wheels on Windows
370
372
enable = ["cpython-freethreading"]
371
373
skip = "*t-win*"
374
+
375
+ # Include all PyPy versions
376
+ enable = ["pypy", "pypy-eol"]
372
377
```
373
378
374
379
@@ -387,15 +392,11 @@ partial list in environment variables; use `CIBW_SKIP` instead.
387
392
# Skip building free-threaded compatible wheels on Windows
388
393
CIBW_ENABLE: cpython-freethreading
389
394
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
-
395
395
396
+ # Include all PyPy versions
397
+ CIBW_ENABLE = pypy pypy-eol
398
+ ```
396
399
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.
399
400
400
401
401
402
### ` CIBW_ALLOW_EMPTY ` {: #allow-empty cmd-line env-var}
@@ -588,6 +589,8 @@ Platform-specific environment variables are also available:<br/>
588
589
SAMPLE_TEXT = "sample text"
589
590
```
590
591
592
+ In configuration files, you can use a [TOML][] table instead of a raw string as shown above.
593
+
591
594
!!! tab examples "Environment variables"
592
595
593
596
```yaml
@@ -617,8 +620,6 @@ Platform-specific environment variables are also available:<br/>
617
620
618
621
Separate multiple values with a space.
619
622
620
- In configuration mode, you can use a [TOML][] table instead of a raw string as shown above.
621
-
622
623
!!! note
623
624
cibuildwheel always defines the environment variable ` CIBUILDWHEEL=1 ` . This can be useful for [ building wheels with optional extensions] ( faq.md#optional-extensions ) .
624
625
@@ -637,31 +638,31 @@ To specify more than one environment variable, separate the variable names by sp
637
638
638
639
#### Examples
639
640
640
- !!! tab examples "Environment passthrough"
641
+ !!! tab examples "pyproject.toml"
642
+
643
+ ```toml
644
+ [tool.cibuildwheel.linux]
641
645
642
- ```yaml
643
646
# Export a variable
644
- CIBW_ENVIRONMENT_PASS_LINUX: CFLAGS
647
+ environment-pass = [" CFLAGS"]
645
648
646
649
# Set two flags variables
647
- CIBW_ENVIRONMENT_PASS_LINUX: BUILD_TIME SAMPLE_TEXT
650
+ environment-pass = [" BUILD_TIME", " SAMPLE_TEXT"]
648
651
```
649
652
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.
653
654
654
- ```toml
655
- [tool.cibuildwheel.linux]
655
+ !!! tab examples "Environment variables"
656
656
657
+ ```yaml
657
658
# Export a variable
658
- environment-pass = [" CFLAGS"]
659
+ CIBW_ENVIRONMENT_PASS_LINUX: CFLAGS
659
660
660
661
# Set two flags variables
661
- environment-pass = [" BUILD_TIME", " SAMPLE_TEXT"]
662
+ CIBW_ENVIRONMENT_PASS_LINUX: BUILD_TIME SAMPLE_TEXT
662
663
```
663
664
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 .
665
666
666
667
### ` before-all ` {: #before-all env-var toml}
667
668
> Execute a shell command on the build system before any wheels are built.
@@ -705,6 +706,8 @@ Platform-specific environment variables also available:<br/>
705
706
]
706
707
```
707
708
709
+ In configuration files, you can use a TOML array, and each line will be run sequentially - joined with `&&`.
710
+
708
711
!!! tab examples "Environment variables"
709
712
710
713
```yaml
@@ -726,12 +729,10 @@ Platform-specific environment variables also available:<br/>
726
729
here.](https://yaml-multiline.info).
727
730
728
731
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.
735
736
736
737
### ` before-build ` {: #before-build env-var toml}
737
738
> Execute a shell command preparing each wheel's build
@@ -772,6 +773,10 @@ Platform-specific environment variables are also available:<br/>
772
773
before-build = "{package}/script/prepare_for_build.sh"
773
774
```
774
775
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
+
775
780
!!! tab examples "Environment variables"
776
781
777
782
```yaml
@@ -789,10 +794,6 @@ Platform-specific environment variables are also available:<br/>
789
794
```
790
795
791
796
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
-
796
797
!!! note
797
798
If you need Python dependencies installed for the build, we recommend using
798
799
` pyproject.toml ` 's ` build-system.requires ` instead. This is an example
@@ -802,18 +803,15 @@ Platform-specific environment variables are also available:<br/>
802
803
requires = [
803
804
"setuptools>=42",
804
805
"Cython",
805
- "numpy==1.13.3; python_version<'3.5'",
806
- "oldest-supported-numpy; python_version>='3.5'",
806
+ "numpy",
807
807
]
808
808
809
809
build-backend = "setuptools.build_meta"
810
810
811
811
This [PEP 517][]/[PEP 518][] style build allows you to completely control
812
812
the build environment in cibuildwheel, [PyPA-build][], and pip, doesn't
813
813
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.
817
815
818
816
[PyPA-build]: https://pypa-build.readthedocs.io/en/latest/
819
817
[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
843
841
[tool.cibuildwheel]
844
842
# Allow access to the cmake and rustc binaries in the isolated cross-build environment.
845
843
xbuild-tools = ["cmake", "rustc"]
844
+
845
+ # No cross-build tools are required
846
+ xbuild-tools = []
846
847
```
847
848
848
849
!!! tab examples "Environment variables"
849
850
850
851
```yaml
851
852
# Allow access to the cmake and rustc binaries in the isolated cross-build environment.
852
853
CIBW_XBUILD_TOOLS: cmake rustc
853
- ```
854
854
855
- ```yaml
856
855
# No cross-build tools are required
857
856
CIBW_XBUILD_TOOLS:
858
857
```
859
858
860
859
861
-
862
- ```toml
863
- [tool.cibuildwheel]
864
- # No cross-build tools are required
865
- xbuild-tools = []
866
- ```
867
-
868
860
### ` repair-wheel-command ` {: #repair-wheel-command env-var toml}
869
861
> Execute a shell command to repair each built wheel
870
862
@@ -948,6 +940,9 @@ Platform-specific environment variables are also available:<br/>
948
940
]
949
941
```
950
942
943
+ In configuration files, you can use an inline array, and the items will be joined with `&&`.
944
+
945
+
951
946
!!! tab examples "Environment variables"
952
947
953
948
```yaml
@@ -979,10 +974,6 @@ Platform-specific environment variables are also available:<br/>
979
974
```
980
975
981
976
982
-
983
- In configuration mode, you can use an inline array, and the items will be joined with `&&`.
984
-
985
-
986
977
<div class =" link-target " id =" manylinux-image " ></div >
987
978
988
979
### ` 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
1069
1060
musllinux-i686-image = "quay.io/pypa/musllinux_1_1_i686:latest"
1070
1061
```
1071
1062
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
+
1072
1066
!!! tab examples "Environment variables"
1073
1067
1074
1068
```yaml
@@ -1094,11 +1088,6 @@ Auditwheel detects the version of the manylinux / musllinux standard in the imag
1094
1088
```
1095
1089
1096
1090
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
-
1102
1091
### ` container-engine ` {: #container-engine env-var toml}
1103
1092
> Specify the container engine to use when building Linux wheels
1104
1093
@@ -1162,7 +1151,6 @@ Options can be supplied after the name.
1162
1151
1163
1152
1164
1153
1165
-
1166
1154
### ` dependency-versions ` {: #dependency-versions env-var toml}
1167
1155
1168
1156
> Control the versions of the tools cibuildwheel uses
@@ -1302,6 +1290,9 @@ Platform-specific environment variables are also available:<br/>
1302
1290
]
1303
1291
```
1304
1292
1293
+ In configuration files, you can use an array, and the items will be joined with `&&`.
1294
+
1295
+
1305
1296
!!! tab examples "Environment variables"
1306
1297
1307
1298
```yaml
@@ -1318,9 +1309,6 @@ Platform-specific environment variables are also available:<br/>
1318
1309
```
1319
1310
1320
1311
1321
-
1322
- In configuration files, you can use an array, and the items will be joined with `&&`.
1323
-
1324
1312
### ` before-test ` {: #before-test env-var toml}
1325
1313
> Execute a shell command before testing each wheel
1326
1314
@@ -1363,6 +1351,8 @@ Platform-specific environment variables are also available:<br/>
1363
1351
before-test = "pip install cmake scikit-build"
1364
1352
```
1365
1353
1354
+ In configuration files, you can use an array, and the items will be joined with `&&`.
1355
+
1366
1356
!!! tab examples "Environment variables"
1367
1357
1368
1358
```yaml
@@ -1384,10 +1374,6 @@ Platform-specific environment variables are also available:<br/>
1384
1374
```
1385
1375
1386
1376
1387
-
1388
- In configuration files, you can use an array, and the items will be joined with `&&`.
1389
-
1390
-
1391
1377
### ` test-sources ` {: #test-sources env-var toml}
1392
1378
> Files and folders from the source tree that are copied into an isolated tree before running the tests
1393
1379
@@ -1414,6 +1400,8 @@ Platform-specific environment variables are also available:<br/>
1414
1400
test-sources = ["tests", "data/test-image.png"]
1415
1401
```
1416
1402
1403
+ In configuration files, you can use an array, and the items will be joined with a space.
1404
+
1417
1405
!!! tab examples "Environment variables"
1418
1406
1419
1407
```yaml
@@ -1422,10 +1410,6 @@ Platform-specific environment variables are also available:<br/>
1422
1410
```
1423
1411
1424
1412
1425
-
1426
- In configuration files, you can use an array, and the items will be joined with a space.
1427
-
1428
-
1429
1413
### ` test_requires ` {: #test-requires env-var toml}
1430
1414
> Install Python dependencies before running the tests
1431
1415
@@ -1448,6 +1432,8 @@ Platform-specific environment variables are also available:<br/>
1448
1432
test-requires = ["pytest==8.2.2", "packaging==24.1"]
1449
1433
```
1450
1434
1435
+ In configuration files, you can use an array, and the items will be joined with a space.
1436
+
1451
1437
!!! tab examples "Environment variables"
1452
1438
1453
1439
```yaml
@@ -1458,7 +1444,6 @@ Platform-specific environment variables are also available:<br/>
1458
1444
CIBW_TEST_REQUIRES: pytest==8.2.2 packaging==24.1
1459
1445
```
1460
1446
1461
- In configuration files, you can use an array, and the items will be joined with a space.
1462
1447
1463
1448
1464
1449
### ` test-extras ` {: #test-extras env-var toml}
@@ -1484,6 +1469,8 @@ Platform-specific environment variables are also available:<br/>
1484
1469
test-extras = ["test", "qt"]
1485
1470
```
1486
1471
1472
+ In configuration files, you can use an inline array, and the items will be joined with a comma.
1473
+
1487
1474
!!! tab examples "Environment variables"
1488
1475
1489
1476
```yaml
@@ -1495,9 +1482,6 @@ Platform-specific environment variables are also available:<br/>
1495
1482
1496
1483
1497
1484
1498
- In configuration files, you can use an inline array, and the items will be joined with a comma.
1499
-
1500
-
1501
1485
### ` test-groups ` {: #test-groups env-var toml}
1502
1486
> Specify test dependencies from your project's ` dependency-groups `
1503
1487
@@ -1520,6 +1504,9 @@ Platform-specific environment variables are also available:<br/>
1520
1504
test-groups = ["test", "qt"]
1521
1505
```
1522
1506
1507
+ In configuration files, you can use an inline array, and the items will be joined with a space.
1508
+
1509
+
1523
1510
!!! tab examples "Environment variables"
1524
1511
1525
1512
```yaml
@@ -1529,10 +1516,6 @@ Platform-specific environment variables are also available:<br/>
1529
1516
1530
1517
Separate multiple items with a space.
1531
1518
1532
-
1533
-
1534
- In configuration files, you can use an inline array, and the items will be joined with a space.
1535
-
1536
1519
### ` test-skip ` {: #test-skip env-var toml}
1537
1520
> Skip running tests on some builds
1538
1521
0 commit comments