Skip to content

Commit ce1ff7d

Browse files
committed
doc: add documentation for the CIBW_FREE_THREADED_SUPPORT option
1 parent 902bf33 commit ce1ff7d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/options.md

+47
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,53 @@ See the [cibuildwheel 1 documentation](https://cibuildwheel.pypa.io/en/1.x/) for
408408
}
409409
</style>
410410

411+
### `CIBW_FREE_THREADED_SUPPORT` {: #free-threaded-support}
412+
413+
> Choose whether free-threaded variants should be built
414+
415+
[PEP 703](https://www.python.org/dev/peps/pep-0703) introduced variants of CPython that can be built without the Global Interpreter Lock (GIL).
416+
Those variants are also known as free-threaded / no-gil.
417+
418+
Building for free-threaded variants is disabled by default.
419+
420+
Building can be enabled by setting this option to `true`. The free-threaded compatible wheels will be built in addition to the standard wheels.
421+
422+
This option doesn't support overrides.
423+
If you need to enable/disable it per platform or python version, set this option to `true` and use [`CIBW_BUILD`](#build-skip)/[`CIBW_SKIP`](#build-skip) options to filter the builds.
424+
425+
The build identifiers for those variants have a `t` suffix in their `python_tag` (e.g. `cp313t-manylinux_x86_64`)
426+
427+
!!! note
428+
This feature is experimental: [What’s New In Python 3.13](https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython)
429+
430+
#### Examples
431+
432+
!!! tab examples "Environment variables"
433+
434+
```yaml
435+
# Enable free-threaded support
436+
CIBW_FREE_THREADED_SUPPORT: 1
437+
438+
# Skip building free-threaded compatible wheels on Windows
439+
CIBW_FREE_THREADED_SUPPORT: 1
440+
CIBW_SKIP: *t-win*
441+
```
442+
443+
It is generally recommended to use `free-threaded-support` in a config file as you can statically declare that you
444+
support free-threaded builds.
445+
446+
!!! tab examples "pyproject.toml"
447+
448+
```toml
449+
[tool.cibuildwheel]
450+
# Enable free-threaded support
451+
free-threaded-support = true
452+
453+
# Skip building free-threaded compatible wheels on Windows
454+
free-threaded-support = true
455+
skip = "*t-win*"
456+
```
457+
411458
### `CIBW_ARCHS` {: #archs}
412459
> Change the architectures built on your machine by default.
413460

0 commit comments

Comments
 (0)