Skip to content

Support PEP 730 (Adding iOS as a supported platform) #17557

@di

Description

@di

PEP 730 is accepted, https://peps.python.org/pep-0730/, PyPI needs to be updated to permit the additional wheel tags: https://peps.python.org/pep-0730/#packaging

The list of supported platform tags is currently here:

# Wheel platform checking
# Note: defining new platform ABI compatibility tags that don't
# have a python.org binary release to anchor them is a
# complex task that needs more than just OS+architecture info.
# For Linux specifically, the platform ABI is defined by each
# individual distro version, so wheels built on one version may
# not even work on older versions of the same distro, let alone
# a completely different distro.
#
# That means new entries should only be added given an
# accompanying ABI spec that explains how to build a
# compatible binary (see the manylinux specs as examples).
# These platforms can be handled by a simple static list:
_allowed_platforms = {
"any",
"win32",
"win_arm64",
"win_amd64",
"win_ia64",
"manylinux1_x86_64",
"manylinux1_i686",
"manylinux2010_x86_64",
"manylinux2010_i686",
"manylinux2014_x86_64",
"manylinux2014_i686",
"manylinux2014_aarch64",
"manylinux2014_armv7l",
"manylinux2014_ppc64",
"manylinux2014_ppc64le",
"manylinux2014_s390x",
"linux_armv6l",
"linux_armv7l",
}
# macosx is a little more complicated:
_macosx_platform_re = re.compile(r"macosx_(?P<major>\d+)_(\d+)_(?P<arch>.*)")
_macosx_arches = {
"ppc",
"ppc64",
"i386",
"x86_64",
"arm64",
"intel",
"fat",
"fat32",
"fat64",
"universal",
"universal2",
}
_macosx_major_versions = {
"10",
"11",
"12",
"13",
"14",
"15",
}
# manylinux pep600 and musllinux pep656 are a little more complicated:
_linux_platform_re = re.compile(r"(?P<libc>(many|musl))linux_(\d+)_(\d+)_(?P<arch>.*)")
_jointlinux_arches = {
"x86_64",
"i686",
"aarch64",
"armv7l",
"ppc64le",
"s390x",
}
_manylinux_arches = _jointlinux_arches | {"ppc64"}
_musllinux_arches = _jointlinux_arches
# Actual checking code;
def _valid_platform_tag(platform_tag):
if platform_tag in _allowed_platforms:
return True
m = _macosx_platform_re.match(platform_tag)
if (
m
and m.group("major") in _macosx_major_versions
and m.group("arch") in _macosx_arches
):
return True
m = _linux_platform_re.match(platform_tag)
if m and m.group("libc") == "musl":
return m.group("arch") in _musllinux_arches
if m and m.group("libc") == "many":
return m.group("arch") in _manylinux_arches
return False

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions