Skip to content

Commit 6cf2445

Browse files
committed
PEP 803: add comments from David Hewitt and Ralf Gommers
1 parent 021428c commit 6cf2445

File tree

1 file changed

+67
-6
lines changed

1 file changed

+67
-6
lines changed

peps/pep-0803.rst

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ on Discourse for a free-threaded stable ABI:
112112
long as we have O(1) builds, that’s ok. What we can’t/won’t do is O(n)
113113
where we need new builds for every Python release.
114114

115-
When one of the PEP authors asked him in the ``#pyca`` Libera IRC channel, he
116-
said:
115+
When one of the PEP authors asked Alex in the ``#pyca`` Libera IRC channel for
116+
his current opinion, he said:
117117

118118
One other thing I'll note that's *really* valuable about ``abi3`` is that it
119119
means our old wheels keep working for new Python versions. If we have
@@ -149,9 +149,51 @@ free-threaded build, he commented:
149149
I will revisit this again once Python 3.15 is released. Hopefully the ABI
150150
will be stable (or even better, free-threading will be the default).
151151

152-
These two libraries -- cryptography and moocore -- both have low maintainer
153-
bandwidth and would like to have a stable ABI on the free-threaded build they
154-
can use to ship wheels and reduce their maintenance burden.
152+
Pydantic
153+
^^^^^^^^
154+
155+
Pydantic maintainer David Hewitt `observed
156+
<https://github.com/python/peps/pull/4831#issuecomment-3972183807>`_:
157+
158+
Pydantic distributes wheels for a native core built using Rust & PyO3. The
159+
latest release of `pydantic-core distributed
160+
<https://pypi.org/project/pydantic_core/2.42.0/#files>`_ 112 wheels and
161+
this number is set to grow as more environments are to be added
162+
(e.g. Android, iOS, wasm). Pydantic has historically not distributed using
163+
the stable ABI because the feature set was too immature. Much Pydantic
164+
functionality interacts with Python objects via the C API in hot loops so
165+
performance is key concern. As the stable ABI matures it will be ideal for
166+
Pydantic to switch tier 2 platforms to the stable ABI (and perhaps
167+
eventually tier 1 platforms too), which will significantly reduce the
168+
number of wheels to build, test, and distribute.
169+
170+
I would like to highlight that if free-threading does not adopt a stable
171+
ABI, all the benefits above will be lost when free-threading becomes the
172+
default and only build (which seems the expected long-term plan).
173+
174+
175+
SciPy
176+
^^^^^
177+
178+
The SciPy project uploaded 60 version-specific wheel files for its `last release
179+
<https://pypi.org/project/scipy/1.17.1/#files>`_ to support four different
180+
CPython versions. They do not upload wheels for PyPy.
181+
182+
When asked about this proposal, SciPy steering council chair Ralf Gommers `said
183+
<https://github.com/python/peps/pull/4831#issuecomment-3968143777>`_:
184+
185+
SciPy and a number of other projects in the scientific Python ecosystem
186+
are quite interested in starting to use the Stable ABI, in particular to
187+
reduce the maintenance load of `providing more wheels
188+
<https://pypackaging-native.github.io/meta-topics/user_expectations_wheels/>`_.
189+
With recent CPython, Cython and NumPy releases, this now seems
190+
possible. The performance costs seem acceptable and small, although we'll
191+
only really build confidence in that assessment after having made the
192+
switch.
193+
194+
By providing a new free-threaded stable ABI in Python 3.15, SciPy will not have
195+
to consider the lack of a stable ABI on the free-threaded build as the project
196+
considers switching to stable API wheels.
155197

156198

157199
Bindings generators
@@ -169,7 +211,26 @@ defined in CPython's ``main`` branch, indicates that PyO3, CFFI, and Cython will
169211
all work with PEP 803 using packaging tools that have been patched to account
170212
for an ``abi3.abi3t`` tag.
171213

172-
Cython maintainer David Woods `says
214+
PyO3 maintainer David Hewitt `said
215+
<https://github.com/python/peps/pull/4831#issuecomment-3972183807>`_ in
216+
support of this proposal:
217+
218+
PyO3 greatly benefits from having a stable ABI - one of the biggest
219+
challenges for the framework is the need to abstract over a wide range of
220+
Python / OS / CPU / environment combinations. We also offer the
221+
possibility to build with the stable ABI for each of these environments
222+
(targeting a given minimum Python version's stable ABI). The goal is
223+
always that all functionality PyO3 offers works the same on all these
224+
combinations (sometimes with a Python version floor to access certain
225+
features). We currently support Python 3.7+. All functionality added to
226+
the stable ABI is a very welcome promise that PyO3 will not need to
227+
introduce further conditional code to support a given feature. In the long
228+
run this makes it possible for PyO3 to simplify code paths as support for
229+
older Python versions is dropped, helping to keep maintenance burden under
230+
control.
231+
232+
When asked to comment about this proposal, Cython
233+
maintainer David Woods `said
173234
<https://github.com/cython/cython/issues/7399#issuecomment-3947605797>`_:
174235

175236
Cython doesn't have huge problems with the number of wheels we distribute

0 commit comments

Comments
 (0)