diff options
author | Daniel Katz <katzdm@gmail.com> | 2020-10-16 10:05:05 -0400 |
---|---|---|
committer | Daniel Katz <katzdm@gmail.com> | 2020-10-27 19:00:22 -0400 |
commit | e08ec3593d1c6d88995b56d8062d818827f065f0 (patch) | |
tree | ae396003fdc7cead626f910be1b9d4ec6241e198 | |
parent | 7237bd3397dd22a44ea65bb869d15d7b5e6a4310 (diff) | |
download | pip-e08ec3593d1c6d88995b56d8062d818827f065f0.tar.gz |
Expand platform-tags unconditionally.
-rw-r--r-- | src/pip/_internal/utils/compatibility_tags.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/pip/_internal/utils/compatibility_tags.py b/src/pip/_internal/utils/compatibility_tags.py index eb1727e3d..d5e6ab552 100644 --- a/src/pip/_internal/utils/compatibility_tags.py +++ b/src/pip/_internal/utils/compatibility_tags.py @@ -86,6 +86,20 @@ def _get_custom_platforms(arch): return arches +def _expand_allowed_platforms(platforms): + seen = set() + result = [] + + for p in platforms: + if p in seen: + continue + additions = [c for c in _get_custom_platforms(p) if c not in seen] + seen.update(additions) + result.extend(additions) + + return result + + def _get_python_version(version): # type: (str) -> PythonVersion if len(version) > 1: @@ -130,10 +144,7 @@ def get_supported( interpreter = _get_custom_interpreter(impl, version) - if platforms and len(platforms) == 1: - # Only expand list of platforms if a single platform was provided. - # Otherwise, assume that the list provided is comprehensive. - platforms = _get_custom_platforms(platforms[0]) + platforms = _expand_allowed_platforms(platforms) is_cpython = (impl or interpreter_name()) == "cp" if is_cpython: |