Skip to content

Commit 8e22476

Browse files
committed
Simplify _get_custom_platforms
Since we only call this function when platform is not None, we can drop one of the branches. This is where we were originally populating manylinux arches, so those can be removed next.
1 parent 5f20c0b commit 8e22476

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/pip/_internal/pep425tags.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,13 @@ def _custom_manylinux_platforms(arch):
296296
return arches
297297

298298

299-
def _get_custom_platforms(arch, platform):
300-
# type: (str, Optional[str]) -> List[str]
299+
def _get_custom_platforms(arch):
300+
# type: (str) -> List[str]
301301
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
302302
if arch.startswith('macosx'):
303303
arches = _mac_platforms(arch)
304304
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
305305
arches = _custom_manylinux_platforms(arch)
306-
elif platform is None:
307-
arches = []
308-
if is_manylinux2014_compatible():
309-
arches.append('manylinux2014' + arch_sep + arch_suffix)
310-
if is_manylinux2010_compatible():
311-
arches.append('manylinux2010' + arch_sep + arch_suffix)
312-
if is_manylinux1_compatible():
313-
arches.append('manylinux1' + arch_sep + arch_suffix)
314-
arches.append(arch)
315306
else:
316307
arches = [arch]
317308
return arches
@@ -367,7 +358,7 @@ def get_supported(
367358

368359
platforms = None # type: Optional[List[str]]
369360
if platform is not None:
370-
platforms = _get_custom_platforms(platform, platform)
361+
platforms = _get_custom_platforms(platform)
371362

372363
is_cpython = (impl or interpreter_name()) == "cp"
373364
if is_cpython:

0 commit comments

Comments
 (0)