Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Doc/howto/abi3t-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,18 @@ or :c:member:`PyTypeObject.tp_itemsize`), it cannot be ported to
``abi3t`` 3.15.


.. _abi3t-migration-build:

Setting up the build
====================

If you use a build tool (such as setuptools, meson-python, scikit-build-core),
search its documentation for a way to select ``abi3t``.
At the time of writing, not all of them have this; but if your tool does,
use it.
If your build tool supports ``abi3t``, use it to select the ABI.
See the documentation for `meson-python
<https://mesonbuild.com/meson-python/how-to-guides/limited-api.html#the-abi3t-stable-abi>`__,
`scikit-build-core
<https://scikit-build-core.readthedocs.io/en/stable/configuration/#customizing-the-output-wheel>`__,
and `Maturin <https://www.maturin.rs/bindings#py_limited_apiabi3>`__,
all of which support ``abi3t``.
You may want to verify that it set the right flag by temporarily adding the
following just after ``#include <Python.h>``::

Expand All @@ -185,6 +190,13 @@ following just after ``#include <Python.h>``::

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

.. seealso::

`Building and distributing abi3t extensions
<https://py-free-threading.github.io/abi3t/>`__:
Build configuration and wheel testing examples in the community-maintained
Python Free-Threading Guide.

.. note::

If your build tool doesn't support ``abi3t`` yet, set the following macro
Expand Down
11 changes: 7 additions & 4 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +572,19 @@ the existing Stable ABI (``abi3``) and the version-specific ABI for
free-threading (``cp315t``) separately.

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

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

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

Expand Down
Loading