1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Merge pull request #7566 from chrahunt/maint/use-packaging-tags-refactor-platform-list

Extract platform list into separate function in pep425tags
This commit is contained in:
Christopher Hunt 2020-01-07 14:38:26 +08:00 committed by GitHub
commit 4f7146c71c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,6 +366,27 @@ def _custom_manylinux_platforms(arch):
return arches
def _get_custom_platforms(arch, platform):
# type: (str, Optional[str]) -> List[str]
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
if arch.startswith('macosx'):
arches = _mac_platforms(arch)
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
arches = _custom_manylinux_platforms(arch)
elif platform is None:
arches = []
if is_manylinux2014_compatible():
arches.append('manylinux2014' + arch_sep + arch_suffix)
if is_manylinux2010_compatible():
arches.append('manylinux2010' + arch_sep + arch_suffix)
if is_manylinux1_compatible():
arches.append('manylinux1' + arch_sep + arch_suffix)
arches.append(arch)
else:
arches = [arch]
return arches
def get_supported(
version=None, # type: Optional[str]
platform=None, # type: Optional[str]
@ -411,23 +432,7 @@ def get_supported(
abis.append('none')
arch = platform or get_platform()
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
if arch.startswith('macosx'):
arches = _mac_platforms(arch)
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
arches = _custom_manylinux_platforms(arch)
elif platform is None:
arches = []
if is_manylinux2014_compatible():
arches.append('manylinux2014' + arch_sep + arch_suffix)
if is_manylinux2010_compatible():
arches.append('manylinux2010' + arch_sep + arch_suffix)
if is_manylinux1_compatible():
arches.append('manylinux1' + arch_sep + arch_suffix)
arches.append(arch)
else:
arches = [arch]
arches = _get_custom_platforms(platform or get_platform(), platform)
# Current version, current API (built specifically for our Python):
for abi in abis: