Skip to content

Commit f477a5d

Browse files
zklausAA-Turner
andauthored
Apply suggestions from code review
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 0dce958 commit f477a5d

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

peps/pep-0780.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@ Title: ABI features as environment markers
33
Author: Klaus Zimmermann <klaus_zimmermann@gmx.de>,
44
Ralf Gommers <ralf.gommers@gmail.com>
55
Sponsor: Lysandros Nikolaou <lisandrosnik@gmail.com>
6-
Discussions-To: https://discuss.python.org/t/60007
76
Status: Draft
87
Type: Standards Track
98
Topic: Packaging
109
Created: 21-Mar-2025
1110
Python-Version: 3.14
11+
Post-History:
12+
`5 Aug 2024 <https://discuss.python.org/t/60007>`__,
1213

1314
..
14-
If adopted, the contents of this pep should be integrated into the
15+
If accepted, the contents of this PEP should be integrated into the
1516
canonical documentation in the Python Packaging User Guide and the
1617
following directive should be added here:
1718
.. canonical-pypa-spec:: :ref:`packaging:dependency-specifiers`
1819
1920
Abstract
2021
========
2122

22-
This PEP defines new environment markers for project dependencies.
23+
This PEP defines using ABI features as environment markers for project
24+
dependencies, through a new ``sys_abi_features`` environment marker and
25+
:data:`!sys.abi_features` attribute in the :mod:`sys` module.
2326
:pep:`508` (later moved to :ref:`packaging:dependency-specifiers`) introduced
2427
environment markers to specify dependencies based on rules that describe
2528
when the dependency should be used.
2629
This PEP extends the environment markers to allow specifying dependencies
2730
based on specific ABI features of the Python interpreter.
2831
For this, it defines a set of `ABI Features`_ and specifies how they are made
2932
available via an `Addition to the Python Standard Library`_ in the form of a
30-
new attribute ``sys.abi_features``, as well as for `Environment Markers`_ as a
33+
new attribute :data:`!sys.abi_features`, as well as for `Environment Markers`_ as a
3134
new marker variable, ``sys_abi_features``.
3235

3336
Motivation
@@ -55,7 +58,7 @@ marker for free-threading`_ Discourse thread:
5558
- Cython has (experimental) support for free-threading only in its master
5659
branch, and is used by a lot of projects that already publish ``cp313t``
5760
wheels. Picking up the wrong Cython version is causing a lot of obscure build
58-
failures and runtime crashes. It would be quite beneficial if the metadata
61+
failures and runtime crashes. It would be beneficial if the metadata
5962
could express that (c.f. `Require Cython Pre-release for Free-Threaded
6063
Python`_).
6164
- CFFI has no support for free-threading yet, and `Armin Rigo, one of the
@@ -73,23 +76,21 @@ marker for free-threading`_ Discourse thread:
7376
While these concrete examples may be addressed later this year by Cython and
7477
CFFI making compatible releases, the same issue is going to repeat further up
7578
the stack. The free-threading rollout is expected to take several years, and an
76-
environment marker for free-threading will make that rollout significantly less
77-
bumpy.
79+
environment marker for free-threading will make that rollout significantly easier.
7880

7981
Another important ABI feature that is not yet covered by environment markers is
8082
the bitness of the interpreter. In most cases, the ``sys_platform`` or
8183
``platform_system`` markers are enough, because there's only a single bitness
8284
in use per platform. This is not the case on Windows however: both 32-bit and
8385
64-bit Python interpreters are widely used on x86-64 Windows. Not being able to
84-
distinguish between the two may be relevant for packages that provide C
86+
distinguish between the two may be relevant for packages that provide compiled
8587
extensions. For example, SciPy does not provide ``win32`` wheels (it isn't able
8688
to due to the lack of a suitable 32-bit compiler toolchain with Fortran
8789
support). Those wheels lacking can be awkward especially for projects where
8890
SciPy is an optional dependency only. In that case, it would be useful to be
8991
able to specify that SciPy is required *unless* the interpreter is a 32-bit one
90-
on Windows (c.f. `Require SciPy Unless on 32-bit win32`_) - it avoids users who
91-
install such packages to get failed from-source installs because of the missing
92-
wheels.
92+
on Windows (c.f. `Require SciPy Unless on 32-bit win32`_), to avoid failed
93+
from-source installations due to the missing wheels.
9394

9495

9596
Rationale
@@ -122,7 +123,7 @@ more clarity.
122123
A Forward Looking View on Free-Threaded Python
123124
----------------------------------------------
124125

125-
:pep:`703`, which is the accepted proposal for free threading, states that the
126+
:pep:`703`, the accepted proposal for free threading, states that the
126127
rollout of free-threaded Python should be gradual, which has been clarified
127128
by the Python Steering Council in `the PEP 703 acceptance post`_ to mean a
128129
three stage process over multiple releases. It is therefore important to make
@@ -193,7 +194,7 @@ ABI features are intrinsic properties of the Python interpreter, expressed as
193194
simple, understandable strings.
194195
However, not all features are equally applicable to all Python interpreters or
195196
Python versions. For example, the distinction between free-threaded and
196-
GIL-enabled interpreters is only relevant for CPython >=3.13, but the bitness
197+
GIL-enabled interpreters is only relevant for CPython 3.13 onwards, but the bitness
197198
of the interpreter is relevant for all interpreters.
198199

199200
All interpreters MUST handle the following ABI features as stated.

0 commit comments

Comments
 (0)