- 
                Notifications
    You must be signed in to change notification settings 
- Fork 171
fix PyPy SOABI parsing #484
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -17,7 +17,6 @@ | |
| from email.generator import BytesGenerator, Generator | ||
| from io import BytesIO | ||
| from shutil import rmtree | ||
| from sysconfig import get_config_var | ||
|         
                  agronholm marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| from zipfile import ZIP_DEFLATED, ZIP_STORED | ||
|  | ||
| import pkg_resources | ||
|  | @@ -55,7 +54,7 @@ def get_platform(archive_root): | |
| def get_flag(var, fallback, expected=True, warn=True): | ||
| """Use a fallback value for determining SOABI flags if the needed config | ||
| var is unset or unavailable.""" | ||
| val = get_config_var(var) | ||
| val = sysconfig.get_config_var(var) | ||
| if val is None: | ||
| if warn: | ||
| warnings.warn( | ||
|  | @@ -69,8 +68,8 @@ def get_flag(var, fallback, expected=True, warn=True): | |
|  | ||
|  | ||
| def get_abi_tag(): | ||
| """Return the ABI tag based on SOABI (if available) or emulate SOABI (PyPy).""" | ||
| soabi = get_config_var("SOABI") | ||
| """Return the ABI tag based on SOABI (if available) or emulate SOABI (PyPy2).""" | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not really related, just noticed this) Is PyPy2 really still supported by wheel? I thought it requires Python 3.7+? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all platforms these days have a valid SOABI, even windows. So "PyPy2" is more of a generic placeholder for "weird platform". | ||
| soabi = sysconfig.get_config_var("SOABI") | ||
| impl = tags.interpreter_name() | ||
| if not soabi and impl in ("cp", "pp") and hasattr(sys, "maxunicode"): | ||
| d = "" | ||
|  | @@ -87,9 +86,9 @@ def get_abi_tag(): | |
| m = "m" | ||
|  | ||
| abi = f"{impl}{tags.interpreter_version()}{d}{m}{u}" | ||
| elif soabi and soabi.startswith("cpython-"): | ||
| elif soabi and impl == "cp": | ||
| abi = "cp" + soabi.split("-")[1] | ||
| elif soabi and soabi.startswith("pypy-"): | ||
| elif soabi and impl == "pp": | ||
| # we want something like pypy36-pp73 | ||
| abi = "-".join(soabi.split("-")[:2]) | ||
| abi = abi.replace(".", "_").replace("-", "_") | ||
|  | ||
Uh oh!
There was an error while loading. Please reload this page.