-
Notifications
You must be signed in to change notification settings - Fork 3k
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
SOABI support for Python 2.X and PyPy #3075
Conversation
impl = get_abbr_impl() | ||
if not soabi and impl in ('cp', 'pp'): | ||
d = 'd' if hasattr(sys, 'pydebug') and sys.pydebug else '' | ||
m = 'm' if impl == 'cp' else '' |
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.
Isn't this inaccurate? This doesn't tell us if Python was compiled with --pymalloc
or not does it?
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.
Maybe using something like sysconfig.get_config_var('WITH_PYMALLOC')
would let us inspect it.
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.
Sorry, that bit came from Nick's comments here. sysconfig.get_config_var('WITH_PYMALLOC')
does indeed seem to work, updating shortly.
I verified the ABI flags with all subsets of |
Hmm, I wonder what the effect of merging this would be. If we merge it in pip install wheels made by a wheel without this patch applied? What about the inverse, if we merge it in wheel, will pip without this patch install those wheels? |
ditto what @dstufft said, and also would be nice to add tests for this. the duplication of this maybe move it to https://github.com/pypa/packaging , which pip vendors, and then wheel could depend on packaging. |
@dstufft wheels built with an unmodified wheel can be installed with the modified pip. Wheel will generate e.g. Default wheels built with a modified wheel cannot be installed with the unmodified pip since on 2.x, unmodified pip will not match any wheel with an ABI tag other than @qwcode Agree regarding the duplication, and there will be more when the enhanced platform detection for Linux lands. The two |
@natefoo That's fine, it just means we should probably make sure that pip is released prior to wheel. |
pep425tags was sortof supposed to be a thing vendored into wheel and into pip, but it has diverged. https://bitbucket.org/dholth/pep425tags |
I have changed the way wide unicode detection works because it was doing the wrong thing on Python >= 3.3 (in the unlikely event that the SOABI config var is unset). I also added some unit tests for the manual ABI flag detection. |
👍 |
Can you merge in develop into this or rebase it please? |
…d `d` ABI flags.
Pythons with PEP 393 Flexible String Representation (so >= 3.3). Granted, on these Pythons, the SOABI config var should always be set, but the manual SOABI code path should still try to do the right thing.
@dstufft Ok, I rebased it. |
Hmm, I'm not sure why that test is failing. It doesn't seem related to this PR, but it's passing on develops last build on Travis it appears. Another thing I thought of though while reviewing this again. It's currently not handling the case where 2.x has unicode disabled. Right now this will just be treated as a narrow unicode build. I wonder if this is a case that we should care about or not? It's not handled by PEP3149 because that's specific to Python 3.x and 3.x doesn't allow disabling unicode. The other thing I noticed, it's going to treat a missing config variable the same as not having a feature enabled. Is that the right behavior? Will it return |
I'm getting the same error if I run the tests locally against develop. Unfortunately there's no flag for "no unicode", so adding one would require a standards update, correct?. FWIW I have never encountered a no-unicode Python in the wild. Perhaps to avoid the standards issue we could drop the ABI tag back to "none" for no-unicode builds? For the config variable issue, I could warn and also fall back to the "old" logic for detecting the flags, as laid out here and as implemented in the earlier commits in this PR. |
It would probably require a standards update yes, going back to none might be reasonable in that case (it's certainly no worse then where we are today anyways). Warning and falling back is probably reasonable there too. |
Okay, about done with the changes. Two things:
|
Hmm, I thought |
Ahh, looks like it works for 2.7.10. 2.6.9's |
Awesome. Assuming pymalloc with a warning is probably fine. Ideally this case shouldn't get hit. Sent from my iPhone
|
Ok, I pushed a new change that creates a fallback if config vars are unavailable, and forces a For the record, a |
Ha. Probably it would have been fine. I've never had a Unicode-less build, I just knew it was an option. Thanks for making those changes. I'll give it another review when I get home. Sent from my iPhone
|
SOABI support for Python 2.X and PyPy
Ok merged. Wheel should wait to pull this change in until pip 8 is released. |
Or unless we release it in another version I guess. |
Thanks @dstufft! |
Additionally, fix the version portion of the Python tag on wheels built with PyPy that use the Python API. It will now be the Python major version concatenated with the PyPy major and minor versions.
Fixes #2671, #2882.
xrefs: