Skip to content

Commit b267a4d

Browse files
committed
Line length adjustments
1 parent 90b3010 commit b267a4d

1 file changed

Lines changed: 35 additions & 34 deletions

File tree

peps/pep-0790.rst

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Python-Version: 3.14
1313
Post-History: <REQUIRED: dates, in dd-mmm-yyyy format, and corresponding links to PEP discussion threads>
1414

1515
..
16-
If adopted, the contents of this pep should be integrated into the canonical
17-
documentation in the Python Packaging User Guide and the following
18-
directive should be added here:
16+
If adopted, the contents of this pep should be integrated into the
17+
canonical documentation in the Python Packaging User Guide and the
18+
following directive should be added here:
1919
.. canonical-pypa-spec:: :ref:`packaging:dependency-specifiers`
2020
2121
Abstract
@@ -41,15 +41,15 @@ evolved and new features warrant their own environment markers.
4141

4242
The primary motivation for extending the allowed set of environment markers now
4343
is free-threaded CPython [#python-free-threading]_ emerging. Currently there is
44-
no way to distinguish between a GIL-enabled and a free-threaded CPython interpreter
45-
with an environment marker. This leads to real world issues for the adoption of
46-
free-threading and its incremental rollout. When a Python package is being made
47-
compatible with free-threaded CPython, it also needs all its build and runtime
48-
dependencies to be compatible. Capturing the first version of a dependency that
49-
is compatible precisely in metadata is currently not possible, and increasing
50-
the minimum version of a dependency also for the GIL-enabled build is usually
51-
undesirable since it unnecessarily limits compatibility between packages.
52-
44+
no way to distinguish between a GIL-enabled and a free-threaded CPython
45+
interpreter with an environment marker. This leads to real world issues for the
46+
adoption of free-threading and its incremental rollout. When a Python package
47+
is being made compatible with free-threaded CPython, it also needs all its
48+
build and runtime dependencies to be compatible. Capturing the first version of
49+
a dependency that is compatible precisely in metadata is currently not
50+
possible, and increasing the minimum version of a dependency also for the
51+
GIL-enabled build is usually undesirable since it unnecessarily limits
52+
compatibility between packages.
5353

5454
Some concrete examples of such issues have been discussed in the `Environment
5555
marker for free-threading`_ Discourse thread:
@@ -62,35 +62,36 @@ marker for free-threading`_ Discourse thread:
6262
Python`_).
6363
- CFFI has no support for free-threading yet, and `Armin Rigo, one of the
6464
maintainers, has stated
65-
<https://github.com/python-cffi/cffi/pull/143#issuecomment-2580781899>`__ that
66-
it may be a good idea to fork ``cffi``, implement support for free-threading, and
67-
only come back to the CFFI project with a single large PR that adds support
68-
after the functionality "is reasonably well-tested (either as tests or,
69-
better in this case, tested by being in use in various other projects)".
70-
There are a lot of projects that depend on ``cffi``. They are likely fine to
71-
start depending on a fork for free-threading only, however depending on a
72-
fork for >=3.13 or for all Python versions seems like a much larger ask, and
73-
more disruptive for distribution packagers.
65+
<https://github.com/python-cffi/cffi/pull/143#issuecomment-2580781899>`__
66+
that it may be a good idea to fork ``cffi``, implement support for
67+
free-threading, and only come back to the CFFI project with a single large PR
68+
that adds support after the functionality "is reasonably well-tested (either
69+
as tests or, better in this case, tested by being in use in various other
70+
projects)". There are a lot of projects that depend on ``cffi``. They are
71+
likely fine to start depending on a fork for free-threading only, however
72+
depending on a fork for >=3.13 or for all Python versions seems like a much
73+
larger ask, and more disruptive for distribution packagers.
7474

7575
While these concrete examples may be addressed later this year by Cython and
7676
CFFI making compatible releases, the same issue is going to repeat further up
7777
the stack. The free-threading rollout is expected to take several years, and an
7878
environment marker for free-threading will make that rollout significantly less
7979
bumpy.
8080

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

9596

9697
Rationale

0 commit comments

Comments
 (0)