Skip to content

DOC: improve docs for limited api builds - #885

Open
ngoldbaum wants to merge 1 commit into
mesonbuild:mainfrom
ngoldbaum:abi3t-docs
Open

DOC: improve docs for limited api builds#885
ngoldbaum wants to merge 1 commit into
mesonbuild:mainfrom
ngoldbaum:abi3t-docs

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Aug 26, 2026

Copy link
Copy Markdown

I'm planning to add a section on meson-python abi3t builds in the free-threaded guide. See Quansight-Labs/free-threaded-compatibility#341 which has a stub for meson-python right now.

Ideally I'd like this section to be brief and mostly be linking to the meson-python docs.

I noticed that #856 didn't have any docs and the existing docs on limited API builds are a little thin. Since abi3t adds complexity and some issues for builds on 3.14, I think it's worth adding some more docs.

Let me know if you'd prefer I trim this down some or otherwise do this differently.

@rgommers rgommers added the documentation Improvements or additions to documentation label Aug 27, 2026

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ngoldbaum for writing docs for the Limited API! Overall this content looks like a great start. My main comment right now is that it's not in the right places: it can't be in the reference guide, and the examples section of the "Passing arguments to Meson" page also feels wrong. I think we need a new page, as a how-to under "Using shared libraries" called something like "Using the Limited C API" or some such title.

This content, put together in a single page, will be a great start. I have a few things I'd like to add, like how to set it up as opt-in (e.g., as in PyWavelets/pywt#828).

We can then also address a couple of open issues: gh-624, some parts of gh-787.

Comment thread docs/reference/pyproject-settings.rst Outdated
sufficient to compile the extension modules for ``abi3t`` when
building with free-threaded CPython 3.15 or later. Building
``abi3t`` extension modules with a GIL-enabled interpreter is not
supported, see `Meson issue 15637`_.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just say "not supported yet". We don't link issues from the docs, and there isn't much of interest to see anyway in that issue for the average user.

Comment thread docs/reference/pyproject-settings.rst Outdated
value ``abi3`` is used for the Python wheel filename ABI tag.
Python wheel filename ABI tag is set to the stable ABI tag:
``abi3`` when building with GIL-enabled CPython, and ``abi3.abi3t``
when building with free-threaded CPython 3.15 or later, see below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to keep the reference guide content very short and to the point. The above three sentences are enough on this page I'd say. Then reference the detailed docs for more info. That's where the below content should move.

@ngoldbaum

Copy link
Copy Markdown
Author

I rearranged with a new howto guide page. Let me know what you think.

@dnicolodi dnicolodi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few quick remarks. I find the content in the new howto page hard to read, mostly because there are things repeated several times with different language and because the content is not presented at increasing level of detail but zooming in and out constantly. The other are minor comments. Please squash the commits into just one commit.

Comment on lines 38 to -40
A boolean indicating whether the extension modules contained in the
Python package target the `Python limited API`_. Extension
modules can be compiled for the Python limited API specifying the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph should be kept.

Comment thread docs/reference/pyproject-settings.rst Outdated
Comment on lines +32 to +35
Python package target the `Python limited API`_. Extension modules
can be compiled for the Python limited API specifying the
``limited_api`` argument to the |extension_module()|_ function in the
Meson Python module. When this setting is set to true, the Python

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid whitespace only changes.

Comment thread docs/reference/pyproject-settings.rst Outdated
Comment on lines +36 to +41
wheel filename ABI tag is set to the stable ABI tag: ``abi3`` when
building with GIL-enabled CPython, and ``abi3.abi3t`` when building
with free-threaded CPython 3.15 or later. Free-threaded CPython before
3.15 does not support the limited API, so this setting must be
disabled at build time for those interpreter versions. See
:ref:`howto-limited-api` for more details and examples.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too detailed: the description of options should be as concise as possible.

Suggested change
wheel filename ABI tag is set to the stable ABI tag: ``abi3`` when
building with GIL-enabled CPython, and ``abi3.abi3t`` when building
with free-threaded CPython 3.15 or later. Free-threaded CPython before
3.15 does not support the limited API, so this setting must be
disabled at build time for those interpreter versions. See
:ref:`howto-limited-api` for more details and examples.
wheel filename ABI tag is set to ``abi3`` or ``abi3.abi3t`` when
the build targets a Python interpreter supporting the free-threaded
stable ABI. See :ref:`howto-limited-api` for details.

Comment thread docs/how-to-guides/limited-api.rst Outdated
Comment on lines +24 to +25
otherwise. This setting has no effect on the wheel tag when building
with PyPy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
otherwise. This setting has no effect on the wheel tag when building
with PyPy.
otherwise. PyPy does not support the limited API thus this setting has
no effect when building with PyPy.

Comment thread docs/how-to-guides/limited-api.rst Outdated
with free-threaded CPython 3.15 or later. Building ``abi3t`` extension
modules with a GIL-enabled interpreter is not supported yet.

``abi3t`` requires targeting limited API version 3.15 or later,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now stated in three different ways. Please find a way to make the content easier to follow.

@ngoldbaum

Copy link
Copy Markdown
Author

@dnicolodi thanks! I've applied your suggestions. I also rearranged the howto page and I think it's clearer now.

Comment on lines 38 to 40
A boolean indicating whether the extension modules contained in the
Python package target the `Python limited API`_. Extension
modules can be compiled for the Python limited API specifying the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants