summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Katz <katzdm@gmail.com>2020-10-16 10:05:05 -0400
committerDaniel Katz <katzdm@gmail.com>2020-10-27 19:00:22 -0400
commite08ec3593d1c6d88995b56d8062d818827f065f0 (patch)
treeae396003fdc7cead626f910be1b9d4ec6241e198
parent7237bd3397dd22a44ea65bb869d15d7b5e6a4310 (diff)
downloadpip-e08ec3593d1c6d88995b56d8062d818827f065f0.tar.gz
Expand platform-tags unconditionally.
-rw-r--r--src/pip/_internal/utils/compatibility_tags.py19
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: