Skip to content

Commit 874d112

Browse files
miss-islingtonngoldbaumencukouhugovk
authored
[3.15] Doc: update abi3t build tool support (GH-158171) (#158959)
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 6fae227 commit 874d112

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

‎Doc/howto/abi3t-migration.rst‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,22 @@ or :c:member:`PyTypeObject.tp_itemsize`), it cannot be ported to
169169
``abi3t`` 3.15.
170170

171171

172+
.. _abi3t-migration-build:
173+
172174
Setting up the build
173175
====================
174176

175-
If you use a build tool (such as setuptools, meson-python, scikit-build-core),
176-
search its documentation for a way to select ``abi3t``.
177-
At the time of writing, not all of them have this; but if your tool does,
178-
use it.
179-
You may want to verify that it set the right flag by temporarily adding the
177+
If you use a build tool, search its documentation for "``abi3t``", and follow
178+
any instructions to select the ABI.
179+
For reference, here are direct links for several popular build tools:
180+
181+
- `meson-python
182+
<https://mesonbuild.com/meson-python/how-to-guides/limited-api.html#the-abi3t-stable-abi>`__
183+
- `scikit-build-core
184+
<https://scikit-build-core.readthedocs.io/en/stable/configuration/#customizing-the-output-wheel>`__
185+
- `Maturin <https://www.maturin.rs/bindings#py_limited_apiabi3>`__
186+
187+
You may want to verify that the tool set the right flag by temporarily adding the
180188
following just after ``#include <Python.h>``::
181189

182190
#if Py_TARGET_ABI3T+0 <= 0x30f0000
@@ -185,6 +193,13 @@ following just after ``#include <Python.h>``::
185193

186194
This should result in a different error than "``abi3t`` define is not set".
187195

196+
.. seealso::
197+
198+
`Building and distributing abi3t extensions
199+
<https://py-free-threading.github.io/abi3t/>`__:
200+
Build configuration and wheel testing examples in the community-maintained
201+
Python Free-Threading Guide.
202+
188203
.. note::
189204

190205
If your build tool doesn't support ``abi3t`` yet, set the following macro

‎Doc/whatsnew/3.15.rst‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,16 +572,19 @@ the existing Stable ABI (``abi3``) and the version-specific ABI for
572572
free-threading (``cp315t``) separately.
573573

574574
Stable ABI for Free-Threaded Builds should typically
575-
be selected in a build tool (such as, for example, Setuptools, meson-python,
576-
scikit-build-core, or Maturin).
577-
At the time of writing, these tools do **not** support ``abi3t``.
578-
If this is the case for your tool, compile for ``cp315t`` separately.
575+
be selected in a build tool. Tools with ``abi3t`` support include
576+
meson-python, scikit-build-core, and Maturin; see
577+
:ref:`abi3t-migration-build` for links to their documentation on ``abi3t`` builds.
578+
If your build tool does not support ``abi3t``, compile for ``cp315t`` separately.
579579
If not using a build tool -- or when writing such a tool -- you can select
580580
``abi3t`` by setting the macro :c:macro:`!Py_TARGET_ABI3T` as discussed
581581
in :ref:`abi3-compiling`.
582582

583583
A practical :ref:`migration guide <abi3t-migration-howto>` for switching to
584584
``abi3t`` is available.
585+
The community-maintained `Python Free-Threading Guide
586+
<https://py-free-threading.github.io/abi3t/>`__ provides examples of building
587+
and testing ``abi3t`` wheels.
585588

586589
.. seealso:: :pep:`803` for further details.
587590

0 commit comments

Comments
 (0)