Skip to content

Commit 1825062

Browse files
committed
Move manylinux arch backfilling into separate function
1 parent d23668a commit 1825062

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

src/pip/_internal/pep425tags.py

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,32 @@ def _mac_platforms(arch):
280280
return arches
281281

282282

283+
def _custom_manylinux_platforms(arch):
284+
# type: (str) -> List[str]
285+
arches = [arch]
286+
287+
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
288+
289+
if arch_prefix == 'manylinux2014':
290+
# manylinux1/manylinux2010 wheels run on most manylinux2014 systems
291+
# with the exception of wheels depending on ncurses. PEP 599 states
292+
# manylinux1/manylinux2010 wheels should be considered
293+
# manylinux2014 wheels:
294+
# https://www.python.org/dev/peps/pep-0599/#backwards-compatibility-with-manylinux2010-wheels
295+
if arch_suffix in {'i686', 'x86_64'}:
296+
arches.append('manylinux2010' + arch_sep + arch_suffix)
297+
arches.append('manylinux1' + arch_sep + arch_suffix)
298+
299+
elif arch_prefix == 'manylinux2010':
300+
# manylinux1 wheels run on most manylinux2010 systems with the
301+
# exception of wheels depending on ncurses. PEP 571 states
302+
# manylinux1 wheels should be considered manylinux2010 wheels:
303+
# https://www.python.org/dev/peps/pep-0571/#backwards-compatibility-with-manylinux1-wheels
304+
arches.append('manylinux1' + arch_sep + arch_suffix)
305+
306+
return arches
307+
308+
283309
def get_supported(
284310
version=None, # type: Optional[str]
285311
platform=None, # type: Optional[str]
@@ -331,22 +357,8 @@ def get_supported(
331357
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
332358
if arch.startswith('macosx'):
333359
arches = _mac_platforms(arch)
334-
elif arch_prefix == 'manylinux2014':
335-
arches = [arch]
336-
# manylinux1/manylinux2010 wheels run on most manylinux2014 systems
337-
# with the exception of wheels depending on ncurses. PEP 599 states
338-
# manylinux1/manylinux2010 wheels should be considered
339-
# manylinux2014 wheels:
340-
# https://www.python.org/dev/peps/pep-0599/#backwards-compatibility-with-manylinux2010-wheels
341-
if arch_suffix in {'i686', 'x86_64'}:
342-
arches.append('manylinux2010' + arch_sep + arch_suffix)
343-
arches.append('manylinux1' + arch_sep + arch_suffix)
344-
elif arch_prefix == 'manylinux2010':
345-
# manylinux1 wheels run on most manylinux2010 systems with the
346-
# exception of wheels depending on ncurses. PEP 571 states
347-
# manylinux1 wheels should be considered manylinux2010 wheels:
348-
# https://www.python.org/dev/peps/pep-0571/#backwards-compatibility-with-manylinux1-wheels
349-
arches = [arch, 'manylinux1' + arch_sep + arch_suffix]
360+
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
361+
arches = _custom_manylinux_platforms(arch)
350362
elif platform is None:
351363
arches = []
352364
if is_manylinux2014_compatible():

0 commit comments

Comments
 (0)