feat: move default manylinux build to manylinux_2_28 (#2330)

This commit is contained in:
Matthieu Darbois
2025-03-24 17:00:44 +00:00
committed by GitHub
parent 141e702872
commit e6eff86c98
8 changed files with 100 additions and 100 deletions
+64 -62
View File
@@ -163,6 +163,57 @@ def expected_wheels(
include_universal2: bool = False,
single_python: bool = False,
single_arch: bool = False,
) -> list[str]:
"""
Returns a list of expected wheels from a run of cibuildwheel.
"""
if machine_arch is None:
machine_arch = pm.machine()
if platform == "linux":
machine_arch = arch_name_for_linux(machine_arch)
architectures = [machine_arch]
if not single_arch:
if platform == "linux":
if machine_arch == "x86_64":
architectures.append("i686")
elif (
machine_arch == "aarch64"
and sys.platform.startswith("linux")
and _AARCH64_CAN_RUN_ARMV7
):
architectures.append("armv7l")
elif platform == "windows" and machine_arch == "AMD64":
architectures.append("x86")
wheels: list[str] = []
for architecture in architectures:
wheels.extend(
_expected_wheels(
package_name,
package_version,
architecture,
manylinux_versions,
musllinux_versions,
macosx_deployment_target,
python_abi_tags,
include_universal2,
single_python,
)
)
return wheels
def _expected_wheels(
package_name: str,
package_version: str,
machine_arch: str,
manylinux_versions: list[str] | None,
musllinux_versions: list[str] | None,
macosx_deployment_target: str,
python_abi_tags: list[str] | None,
include_universal2: bool,
single_python: bool,
) -> list[str]:
"""
Returns a list of expected wheels from a run of cibuildwheel.
@@ -172,24 +223,12 @@ def expected_wheels(
# {python tag} and {abi tag} are closely related to the python interpreter used to build the wheel
# so we'll merge them below as python_abi_tag
if machine_arch is None:
machine_arch = pm.machine()
if platform == "linux" and machine_arch.lower() == "arm64":
# we're running linux tests from macOS/Windows arm64, override platform
machine_arch = "aarch64"
if manylinux_versions is None:
if machine_arch in ("armv7l", "aarch64"):
manylinux_versions = ["manylinux_2_17", "manylinux2014", "manylinux_2_31"]
elif machine_arch == "x86_64":
manylinux_versions = [
"manylinux_2_5",
"manylinux1",
"manylinux_2_17",
"manylinux2014",
]
else:
manylinux_versions = ["manylinux_2_17", "manylinux2014"]
manylinux_versions = {
"armv7l": ["manylinux_2_17", "manylinux2014", "manylinux_2_31"],
"i686": ["manylinux_2_5", "manylinux1", "manylinux_2_17", "manylinux2014"],
"x86_64": ["manylinux_2_5", "manylinux1", "manylinux_2_28"],
}.get(machine_arch, ["manylinux_2_17", "manylinux2014", "manylinux_2_28"])
if musllinux_versions is None:
musllinux_versions = ["musllinux_1_2"]
@@ -207,7 +246,7 @@ def expected_wheels(
"cp313-cp313t",
]
if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]:
if machine_arch in ["x86_64", "i686", "AMD64", "aarch64", "arm64"]:
python_abi_tags += [
"pp38-pypy38_pp73",
"pp39-pypy39_pp73",
@@ -215,22 +254,6 @@ def expected_wheels(
"pp311-pypy311_pp73",
]
if platform == "macos" and machine_arch == "arm64":
# arm64 macs are only supported by cp38+
python_abi_tags = [
"cp38-cp38",
"cp39-cp39",
"cp310-cp310",
"cp311-cp311",
"cp312-cp312",
"cp313-cp313",
"cp313-cp313t",
"pp38-pypy38_pp73",
"pp39-pypy39_pp73",
"pp310-pypy310_pp73",
"pp311-pypy311_pp73",
]
if single_python:
python_tag = "cp{}{}-".format(*SINGLE_PYTHON_VERSION)
python_abi_tags = [
@@ -253,44 +276,23 @@ def expected_wheels(
platform_tags = []
if platform == "linux":
architectures = [arch_name_for_linux(machine_arch)]
if not single_arch:
if machine_arch == "x86_64":
architectures.append("i686")
elif (
machine_arch == "aarch64"
and sys.platform.startswith("linux")
and not python_abi_tag.startswith("pp")
and _AARCH64_CAN_RUN_ARMV7
):
architectures.append("armv7l")
if len(manylinux_versions) > 0:
platform_tags = [
".".join(
f"{manylinux_version}_{architecture}"
f"{manylinux_version}_{machine_arch}"
for manylinux_version in manylinux_versions
if (manylinux_version, architecture) != ("manylinux_2_31", "aarch64")
)
for architecture in architectures
]
if len(musllinux_versions) > 0 and not python_abi_tag.startswith("pp"):
platform_tags.extend(
[
".".join(
f"{musllinux_version}_{architecture}"
for musllinux_version in musllinux_versions
)
for architecture in architectures
]
platform_tags.append(
".".join(
f"{musllinux_version}_{machine_arch}"
for musllinux_version in musllinux_versions
)
)
elif platform == "windows":
if python_abi_tag.startswith("pp"):
platform_tags = ["win_amd64"]
else:
platform_tags = ["win32", "win_amd64"]
platform_tags = ["win_amd64"] if machine_arch == "AMD64" else ["win32"]
elif platform == "macos":
if python_abi_tag.startswith("pp"):