Skip to content
Open
17 changes: 14 additions & 3 deletions peps/pep-0780.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,23 @@ Require Free-Threaded Fork of PyYAML
------------------------------------
PyYAML initially decided not to support free-threading in its mainline
distribution before wider testing of free-threaded Python in the real world.
To faciliate this testing, a free-threaded fork, PyYAML-ft, was created.
To facilitate this testing, a free-threaded fork, PyYAML-ft, was created.
To require this fork, for a free-threaded Python interpreter, without forcing
it also on the GIL-enabled interpreter, the following dependency specification
can be used::

pyyaml-ft; "free_threaded::True" in sys_abi_info
pyyaml; "free_threaded::True" not in sys_abi_info

Note that in the absence of the features described in this PEP, early adopting
projects have had to resort to using the fork for *all* builds of a potentially
free threading Python interpreter; typical dependencies than look like::

pyyaml; python_version<"3.13"
pyyaml-ft; python_version>="3.13"

which is an undesirable side effect for GIL-enabled environments.

Backwards Compatibility
=======================

Expand All @@ -304,8 +313,8 @@ ecosystem tools, especially those which attempt to support examination of data
in ``pyproject.toml`` and ``requirements.txt``.

In particular, current tools generally work with a fixed list of environment
variables, either in their own implementation (e.g. `uv <https://github.com/astral-sh/uv/blob/86e7b2e97a193ce3f506804be4c41c611191fa72/crates/uv-pep508/src/marker/tree.rs#L170>`_)
or via an established package like `pypa/packaging <https://github.com/pypa/packaging/blob/8f13a4309aa620bf643cd508304f783b456e8c49/src/packaging/_tokenizer.py#L63>`_ (e.g. pip).
variables, either in their own implementation (e.g. `uv`_) or via an
established package like `pypa/packaging`_ (e.g. pip).
Hence, it is principally impossible to add any new environment markers without
making new packages using these markers incompatible with older versions of
these tools.
Expand Down Expand Up @@ -415,6 +424,8 @@ Footnotes
particularly on platforms that allow the execution of either kind of binary.


.. _uv: https://github.com/astral-sh/uv/blob/86e7b2e97a193ce3f506804be4c41c611191fa72/crates/uv-pep508/src/marker/tree.rs#L170
.. _pypa/packaging: https://github.com/pypa/packaging/blob/8f13a4309aa620bf643cd508304f783b456e8c49/src/packaging/_tokenizer.py#L63
.. _Python experimental support for free threading: https://docs.python.org/3/howto/free-threading-python.html
.. _Python free-threading guide: https://py-free-threading.github.io/
.. _Environment marker for free-threading: https://discuss.python.org/t/environment-marker-for-free-threading/60007
Expand Down