-
Notifications
You must be signed in to change notification settings - Fork 253
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
refactor _generic_api to use EXT_SUFFIX #607
Conversation
Does this not need to still support the old format so currently existing wheels can still work? |
Yes. The code should be backward compatible: the names should not change. |
I added tests to make sure that on PyPy the current SOABI and the future SOABI give the same value as they currently do. There should be no change here for CPython. |
According to PEP 3149,
There's also a chance |
|
Yes, sorry, there's a link just below to the same issue, one comment down. |
I wonder where I got that information (that |
I would assume it's because Also the warning for using
So it's pointing to |
@henryiii is there something to change in this PR to answer your comment? |
I wouldn't want to switch SOABI for EXT_SUFFIX without tacit approval from the package maintainers. |
My question was why not use EXT_SUFFIX? It is much more likely to be right, and it's suggested as the replacement for SO anyway, even though SOABI is a closer match. Then you don't have to do special processing to check to see if it's a malformed SOABI, you can just strip the extension suffix & leading dot and now you know it's a valid SOABI. |
Without approval from packaging maintainers, the current version is better than the status quo, so no unless packaging maintainers chime in. Setuptools/distutils rely on EXT_SUFFIX, like in https://github.com/pypa/setuptools/blob/a2c4c578e4921be7670448fc1cbf3f81792d86e4/setuptools/_distutils/command/build_ext.py#L710. |
If it leads to better results I'm up for trying it out. Is there anyone else to loop in here and ask how they might be affected? |
Are there any other Python implementations that might be using this? I couldn't figure out how to find IronPython 3.4 after installing it (and besides, that currently maxes out at Python 3.4, this would only affect 3.7+), and pyodide doesn't use this AFAICT (it "is" CPython in a sense). |
I am refactoring this to use |
packaging/tags.py
Outdated
|
||
ext_suffix = _get_config_var("EXT_SUFFIX", warn=True) | ||
if not isinstance(ext_suffix, str) or ext_suffix[0] != ".": | ||
raise SystemError("invalid sysconfig.get_config_var('EXT_SUFFIX')") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct or would the reviewers prefer the function return []
for an invalid EXT_SUFFIX
(which should never happen)? I prefer exceptions when reality clashes with my expectations, but maybe that is too optimistic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can't function w/o the information then an exception makes sense (have not thought about which one).
e6cd1cc
to
e606666
Compare
CI is passing. |
cc @timfel from GraalPy |
Looks like @timfel from GrallPy is the only person anyone could think of, so let's give them a chance to comment and then we can go from there. |
I'm happy with this for GraalPy. |
Please feel free to open an issue at python/cpython if we want to generalize some things, but moving all tag code upstream might not be doable as I can see some folks getting upset with embedding that much packaging knowledge into the stdlib (but we won't know until we ask 🤷). |
So, are we all in agreement on this PR? Last chance to speak up before I begin reviewing for technical/code reasons and not on results reasons. |
A version of meson-python has been released incorporating changes in the spirit of this PR. I don't think we will go back on these changes. Note that this means that SciPy (and other less prominent packages) is now uninstallable on GraalPy, unless meson-python is pinned to a previous version or other tricks are applied. |
... until the PR is merged and released, correct? |
Correct. But that's going to be a while. |
Co-authored-by: Brett Cannon <[email protected]>
Squashed review commits and rebase off main to clear merge conflict |
@brettcannon I'm gonna defer to you on this one completely. :) |
@mattip @brettcannon Any suggestions on what would be a good changelog entry for this? |
"Refactor _generic_api to use EXT_SUFFIX instead of SOABI" |
Hmm... I'm not sure that means much for end users, and mentioning an internal function name in the changelog isn't particularly meaningful either... What's the user-facing behaviour change here? |
Hopefully this change has absolutely no user facing changes. It is a code refactor to make the code more robust to the single-source of truth ( |
Fixes #606 where PyPy would like to change its non-compliant SOABI tag (
pypy36-pp73
) to a compliant one (pypy39-pp73-x86_64-linux-gnu
).The basic code is
taken from wheel.bdist_wheel's version.changed to use
EXT_SUFFIX
instead ofSOABI
.A few other changes:
- add a fallback for older cpython to call_cpython_abis
, which means passing in PythonVersioninterpreter_name
, since it actually is the 'cp' or 'pp' short name.If I was starting over, PyPy's ABI tag would be
pp39_73
rather thanpypy39_73
to save two letters. Maybe someday ...Edit (11-Nov-2022): refactored to use
EXT_SUFFIX