You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document setting limited-api via build option better #624
The limited-api option can only be set through pyproject.toml, not through the build config settings that you can provide on the command line to pip or python -m build.
Would you please consider supporting limited-api as a build config setting? I am using cibuildwheel to build a package that uses the limited API, but my build fails when it tries to install the build package and run my tests under pypy with the following error:
ERROR: hpx-0.0.1-pp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is not a supported wheel on this platform.
I would like to be able to customize the build so that it sets limited-api to false for PyPy, but I can't do this because limited-api is not a build config setting. Here's what I would like to do:
[tool.cibuildwheel]
config-settings.limited-api = true# PyPy does not support the Python limited API.
[[tool.cibuildwheel.overrides]]
select = "pp*"config-settings.limited-api = false
changed the title [-]Support setting limited-api via build config settings[/-][+]Document setting limited-api via build option better[/+]on May 2, 2024
I found that this only works one way: defaulting to limited-api=true in pyproject.toml and then opting out via -Csetup-args=-Dpython.allow_limited_api=false works, but one cannot do the reverse and opt into building an abi3 wheel in any way.
In addition, using limited-api=true in pyproject.toml will not work with free-threaded interpreters, since they don't yet support the limited API (that will only happen in Python 3.15) and hence defaulting to true in pyproject.toml breaks pip install pkgname which is bad. At a minimum, that needs a change like gh-626 to handle this the same way as for PyPy.
There is more to do though, see gh-793 (and gh-787)
Activity
eli-schwartz commentedon May 1, 2024
build config settings, as in the kind that are compatible with
pip install --config-settings="....", take the form:as documented by https://mesonbuild.com/Builtin-options.html#module-options
rgommers commentedon May 1, 2024
Yes, we should be handling
python.allow_limited_api:meson-python/mesonpy/__init__.py
Line 758 in 6c728bd
And we just added a more descriptive error a few lines below that (not in the 0.16.0 release yet), but only for free-threaded CPython and not PyPy.
Guess we should improve the error message and the docs a bit more.
lpsinger commentedon May 2, 2024
Yes, this worked, although somehow I found it hard to find this in the documentation.
[-]Support setting limited-api via build config settings[/-][+]Document setting limited-api via build option better[/+]rgommers commentedon May 2, 2024
Great, thanks for confirming. Changed the issue title to reflect that we need to improve the docs here.
trim21 commentedon Nov 27, 2024
What's the best way to do this currently?
Enable limited-api pyproject.toml and disable it with
--config-settings=setup-args="-Dpython.allow_limited_api=false"?rgommers commentedon Oct 19, 2025
I found that this only works one way: defaulting to
limited-api=trueinpyproject.tomland then opting out via-Csetup-args=-Dpython.allow_limited_api=falseworks, but one cannot do the reverse and opt into building anabi3wheel in any way.In addition, using
limited-api=trueinpyproject.tomlwill not work with free-threaded interpreters, since they don't yet support the limited API (that will only happen in Python 3.15) and hence defaulting totrueinpyproject.tomlbreakspip install pkgnamewhich is bad. At a minimum, that needs a change like gh-626 to handle this the same way as for PyPy.There is more to do though, see gh-793 (and gh-787)
oscarbenjamin commentedon Oct 19, 2025
I think I got this working in flintlib/python-flint#326.
You can set the default for
allow_limited_apito false at the top of meson.build:rgommers commentedon Oct 19, 2025
Thanks @oscarbenjamin 🙏🏼. Agreed it does work (if clumsily). I saw your suggestions in gh-787 after writing my initial comment. Trying that out now.