diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2023-01-24 00:05:40 +0200 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2023-01-24 00:05:54 +0200 |
commit | 886b86639582c2d94173098376d3b8af969f664a (patch) | |
tree | 679db2223893219d0d72372d9f4082323aa266c5 | |
parent | bd02d4cfef1a0386a7e11f40325932cf5b4b932e (diff) | |
download | wheel-git-886b86639582c2d94173098376d3b8af969f664a.tar.gz |
Upgraded vendored packaging to v23.0
-rw-r--r-- | docs/news.rst | 2 | ||||
-rw-r--r-- | src/wheel/vendored/packaging/_elffile.py | 2 | ||||
-rw-r--r-- | src/wheel/vendored/packaging/tags.py | 49 | ||||
-rw-r--r-- | src/wheel/vendored/vendor.txt | 2 |
4 files changed, 47 insertions, 8 deletions
diff --git a/docs/news.rst b/docs/news.rst index ab0f3c9..14e9cff 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -3,7 +3,7 @@ Release Notes **UNRELEASED** -- Updated vendored ``packaging`` to 22.0 +- Updated vendored ``packaging`` to 23.0 **0.38.4 (2022-11-09)** diff --git a/src/wheel/vendored/packaging/_elffile.py b/src/wheel/vendored/packaging/_elffile.py index 9fb5984..6fb19b3 100644 --- a/src/wheel/vendored/packaging/_elffile.py +++ b/src/wheel/vendored/packaging/_elffile.py @@ -53,7 +53,7 @@ class ELFFile: raise ELFInvalid(f"invalid magic: {magic!r}") self.capacity = ident[4] # Format for program header (bitness). - self.encoding = ident[5] # Data structure encoding (endianess). + self.encoding = ident[5] # Data structure encoding (endianness). try: # e_fmt: Format for program header. diff --git a/src/wheel/vendored/packaging/tags.py b/src/wheel/vendored/packaging/tags.py index a0e1ea2..19ccbde 100644 --- a/src/wheel/vendored/packaging/tags.py +++ b/src/wheel/vendored/packaging/tags.py @@ -225,10 +225,45 @@ def cpython_tags( yield Tag(interpreter, "abi3", platform_) -def _generic_abi() -> Iterator[str]: - abi = sysconfig.get_config_var("SOABI") - if abi: - yield _normalize_string(abi) +def _generic_abi() -> List[str]: + """ + Return the ABI tag based on EXT_SUFFIX. + """ + # The following are examples of `EXT_SUFFIX`. + # We want to keep the parts which are related to the ABI and remove the + # parts which are related to the platform: + # - linux: '.cpython-310-x86_64-linux-gnu.so' => cp310 + # - mac: '.cpython-310-darwin.so' => cp310 + # - win: '.cp310-win_amd64.pyd' => cp310 + # - win: '.pyd' => cp37 (uses _cpython_abis()) + # - pypy: '.pypy38-pp73-x86_64-linux-gnu.so' => pypy38_pp73 + # - graalpy: '.graalpy-38-native-x86_64-darwin.dylib' + # => graalpy_38_native + + 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')") + parts = ext_suffix.split(".") + if len(parts) < 3: + # CPython3.7 and earlier uses ".pyd" on Windows. + return _cpython_abis(sys.version_info[:2]) + soabi = parts[1] + if soabi.startswith("cpython"): + # non-windows + abi = "cp" + soabi.split("-")[1] + elif soabi.startswith("cp"): + # windows + abi = soabi.split("-")[0] + elif soabi.startswith("pypy"): + abi = "-".join(soabi.split("-")[:2]) + elif soabi.startswith("graalpy"): + abi = "-".join(soabi.split("-")[:3]) + elif soabi: + # pyston, ironpython, others? + abi = soabi + else: + return [] + return [_normalize_string(abi)] def generic_tags( @@ -252,8 +287,9 @@ def generic_tags( interpreter = "".join([interp_name, interp_version]) if abis is None: abis = _generic_abi() + else: + abis = list(abis) platforms = list(platforms or platform_tags()) - abis = list(abis) if "none" not in abis: abis.append("none") for abi in abis: @@ -463,6 +499,9 @@ def platform_tags() -> Iterator[str]: def interpreter_name() -> str: """ Returns the name of the running interpreter. + + Some implementations have a reserved, two-letter abbreviation which will + be returned when appropriate. """ name = sys.implementation.name return INTERPRETER_SHORT_NAMES.get(name) or name diff --git a/src/wheel/vendored/vendor.txt b/src/wheel/vendored/vendor.txt index a75029c..7eba1b4 100644 --- a/src/wheel/vendored/vendor.txt +++ b/src/wheel/vendored/vendor.txt @@ -1 +1 @@ -packaging==22.0 +packaging==23.0 |