-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable abi3 wheel tag for PyPy #626
Conversation
Thanks for working on this @lpsinger. The current behavior certainly doesn't seem quite right - we should never be producing something with a tag that Related to gh-624. If I understand correctly, with the build option discussed in gh-624 you can disable asking for limited API usage, which will then produce a tag like CI is a little unhappy, the tests need updating to match:
|
That's correct. I'm looking to avoid having to add this line to projects that use the limited API and cibuildwheel: https://github.com/nasa-gcn/hpx/blob/main/pyproject.toml#L81-L84 |
228d3e9
to
0e1e1c6
Compare
I pushed a change for that; let's see if it fixes the CI. |
My understanding is that PyPy supports the limited API but does not use a dedicated filename suffix for extension modules compiled for the limited API. The Python support in Meson implies the same understanding https://github.com/mesonbuild/meson/blob/cfd57180eef9036c7167c5682b9f3055a540fccc/mesonbuild/scripts/python_info.py#L103-L107 What I am not sure about is whether, when using the limited API, PyPy implements a stable ABI, and thus the resulting wheels should be taggeg @mattip Can you confirm that my understanding is correct? I added the |
PyPy does not implement a stable ABI. Wheels for PyPy should not be tagged |
Thanks for the clarification @mattip. My reasoning for implementing the |
One of the reasons to remove the |
You can’t do that on windows. No suffix there. In scikit-build-core, I use wheel.py-api, which is the wheel tag and you can get both limited api and pythonless wheels from that, see https://scikit-build-core.readthedocs.io/en/latest/configuration.html#customizing-the-output-wheel. Setting something like cp311 is ignored on CPython < 3.11, PyPy, and free-threaded Python. |
IIRC, on windows there is no suffix specific to |
@henryiii Thanks for the pointer to how scikit-build-core solves this. However, it is not clear to me how you handle the case when the user requires the stable ABI tag |
My impression is that the current build option is fine, since it works as designed for CPython. For PyPy, proceeding with the regular minor-version-specific tag as done in this PR would seem reasonable to me. The question I have is whether we should be emitting a warning when doing that.
PyPy could implement it in the future in principle (it's just a missing feature now), so I wouldn't attach too much value to this since conceptually it does make sense. Moreover, PyPy is probably going to fade away pretty quickly over the next 1-2 years - there is unlikely to be a 3.11 release for PyPy, so next year when Python 3.10 starts being dropped that's the end of it. Conda-forge is also starting to drop PyPy builds because of maintenance issues and no real future. Hence deprecating because of PyPy isn't needed imho. |
The way selecting if(NOT "${SKBUILD_SABI_COMPONENT}" STREQUAL "")
python_add_library(some_ext MODULE WITH_SOABI USE_SABI 3.11 ...)
else()
python_add_library(some_ext MODULE WITH_SOABI ...)
endif() (USE_SABI also sets the Limited API define) Though I haven't checked to see exactly how CMake's FindPython module handles it, it might do the right thing (IMO which is to ignore this setting if it doesn't apply). Not setting the define just means you are not limited to the Limited API, so shouldn't hurt user code. |
Does that mean that this is a "won't fix?" |
I don't think so. This is a minor change that to me seems strictly an improvement over the status quo. So I'd be in favor of merging it as is. The larger change @dnicolodi was thinking about (this comment above) is orthogonal, and may or may not happen. I'd suggest that it shouldn't be blocking for this PR. |
PyPy is probably not long for this world; see mesonbuild/meson-python#626 (comment). Fixes astropy#216.
PyPy is probably not long for this world; see mesonbuild/meson-python#626 (comment). Fixes #216.
50550f1
to
d192fe0
Compare
PyPy supports the limited API but not the stable ABI.
d192fe0
to
732edd1
Compare
Pip does not support installing PyPy wheels with the abi3 tag. If you build a wheel for PyPy and set the ABI tag to
abi3
, pip will not be able to install it.Full output: