Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PEP 738 (Adding Android as a supported platform) #17549

Open
di opened this issue Feb 3, 2025 · 2 comments · May be fixed by #17556
Open

Support PEP 738 (Adding Android as a supported platform) #17549

di opened this issue Feb 3, 2025 · 2 comments · May be fixed by #17556
Labels
APIs/feeds blocked Issues we can't or shouldn't get to yet feature request

Comments

@di
Copy link
Member

di commented Feb 3, 2025

PEP 738 is accepted, https://peps.python.org/pep-0738/, PyPI needs to be updated to permit the additional wheel tags: https://peps.python.org/pep-0738/#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

@mara004
Copy link

mara004 commented Feb 4, 2025

Taking a look at the quoted code, I think you might also want to open an issue for PEP 730 (iOS support) ?

@di
Copy link
Member Author

di commented Feb 4, 2025

@mara004 Thanks, I filed #17557 as well.

@di di added the blocked Issues we can't or shouldn't get to yet label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIs/feeds blocked Issues we can't or shouldn't get to yet feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants