Skip to content

Commit 63bdd4f

Browse files
authored
docs: Improve docs on how to skip free-threaded builds (#2549)
* Improve docs on how to skip free-threaded builds * Add a reference to the Python Free-Threading Guide
1 parent 5952330 commit 63bdd4f

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

docs/options.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Windows arm64 platform support is experimental.
7474

7575
See the [cibuildwheel 2 documentation](https://cibuildwheel.pypa.io/en/2.x/) for past end-of-life versions of Python.
7676

77-
#### Examples
77+
#### Examples {: #build-skip-examples }
7878

7979
!!! tab examples "pyproject.toml"
8080

@@ -106,6 +106,12 @@ See the [cibuildwheel 2 documentation](https://cibuildwheel.pypa.io/en/2.x/) for
106106

107107
# Disable building PyPy wheels on all platforms
108108
skip = "pp*"
109+
110+
# Disable free-threading builds on all platforms
111+
skip = "cp3??t-*"
112+
113+
# Disable free-threading builds on Windows
114+
skip = "cp3??t-win*"
109115
```
110116

111117
!!! tab examples "Environment variables"
@@ -137,11 +143,15 @@ See the [cibuildwheel 2 documentation](https://cibuildwheel.pypa.io/en/2.x/) for
137143

138144
# Disable building PyPy wheels on all platforms
139145
CIBW_SKIP: pp*
140-
```
141146

142-
Separate multiple selectors with a space.
147+
# Disable free-threading builds on all platforms
148+
CIBW_SKIP: "cp3??t-*"
143149

150+
# Disable free-threading builds on Windows
151+
CIBW_SKIP: "cp3??t-win*"
152+
```
144153

154+
Separate multiple selectors with a space.
145155

146156
It is generally recommended to set `CIBW_BUILD` as an environment variable, though `skip`
147157
tends to be useful in a config file; you can statically declare that you don't
@@ -344,13 +354,9 @@ values are:
344354

345355
- `cpython-prerelease`: Enables beta versions of Pythons if any are available
346356
(May-July, approximately).
347-
- `cpython-freethreading`: [PEP 703](https://www.python.org/dev/peps/pep-0703)
348-
introduced variants of CPython that can be built without the Global
349-
Interpreter Lock (GIL). Those variants are also known as free-threaded /
350-
no-gil. This will enable building these wheels for 3.13, which was considered
351-
experimental. The build identifiers for those variants have a `t` suffix in
352-
their `python_tag` (e.g. `cp313t-manylinux_x86_64`). Starting in 3.14,
353-
free-threaded builds are no longer experimental, so this enable is not needed.
357+
- `cpython-freethreading`: Enable experimental free-threaded builds for CPython 3.13.
358+
Free-threading wheels for 3.14+ are available without this flag, as it's [no
359+
longer considered experimental](https://peps.python.org/pep-0779/).
354360
- `pypy`: Enable PyPy.
355361
- `pypy-eol`: Enable PyPy versions that have passed end of life (if still available).
356362
- `graalpy`: Enable GraalPy.
@@ -368,7 +374,15 @@ values are:
368374
that version of Python will become available without this flag.
369375

370376
!!! note
371-
Free threading was experimental in 3.13: [What’s New In Python 3.13](https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython)
377+
[PEP 703](https://www.python.org/dev/peps/pep-0703) introduced variants of
378+
CPython that can be built without the Global Interpreter Lock (GIL). Those
379+
variants are also known as free-threaded / no-gil. The build identifiers for
380+
those variants have a `t` suffix in their `python_tag` (e.g.
381+
`cp313t-manylinux_x86_64`).
382+
383+
Free threading was [experimental in 3.13](https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython), so it required an explicit enable flag. But, as noted above, free-threading doesn't require an enable flag for 3.14+.
384+
385+
For more info on building for free-threading, see the [Python Free-Threading Guide](https://py-free-threading.github.io/).
372386

373387
Default: empty.
374388

@@ -392,12 +406,8 @@ without disabling your other enables.
392406

393407
```toml
394408
[tool.cibuildwheel]
395-
# Enable free-threaded support
396-
enable = ["cpython-freethreading"]
397-
398-
# Skip building free-threaded compatible wheels on Windows
409+
# Enable free-threaded support for CPython 3.13
399410
enable = ["cpython-freethreading"]
400-
skip = "*t-win*"
401411

402412
# Include all PyPy versions
403413
enable = ["pypy", "pypy-eol"]
@@ -410,18 +420,14 @@ without disabling your other enables.
410420
# Include latest Python beta
411421
CIBW_ENABLE: cpython-prerelease
412422

413-
# Include free-threaded support
423+
# Include free-threaded support for CPython 3.13
414424
CIBW_ENABLE: cpython-freethreading
415425

416426
# Include both
417427
CIBW_ENABLE: cpython-prerelease cpython-freethreading
418428

419-
# Skip building free-threaded compatible wheels on Windows
420-
CIBW_ENABLE: cpython-freethreading
421-
CIBW_SKIP: *t-win*
422-
423429
# Include all PyPy versions
424-
CIBW_ENABLE = pypy pypy-eol
430+
CIBW_ENABLE: pypy pypy-eol
425431
```
426432

427433

0 commit comments

Comments
 (0)