Skip to content

Commit e706535

Browse files
committed
fix: tests and corrected pypy mins
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 043a17b commit e706535

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

cibuildwheel/macos.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ def setup_python(
260260
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
261261
# For arm64, the minimal deployment target is 11.0.
262262
# On x86_64 (or universal2), use 10.9 as a default.
263-
# PyPy needs 10.10. CPython 3.13 needs 10.13.
263+
# CPython 3.13 needs 10.13.
264264
if config_is_arm64:
265265
default_target = "11.0"
266266
elif Version(python_configuration.version) >= Version("3.13"):
267267
default_target = "10.13"
268-
elif python_configuration.identifier.startswith("pp"):
269-
default_target = "10.10"
268+
elif python_configuration.identifier.startswith("pp") and Version(
269+
python_configuration.version
270+
) >= Version("3.9"):
271+
default_target = "10.15"
270272
else:
271273
default_target = "10.9"
272274
env.setdefault("MACOSX_DEPLOYMENT_TARGET", default_target)

test/utils.py

+16-11
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,11 @@ def cibuildwheel_run(
137137
return wheels
138138

139139

140-
def _get_arm64_macosx_deployment_target(macosx_deployment_target: str) -> str:
140+
def _floor_macosx_deployment_target(*args: str) -> str:
141141
"""
142-
The first version of macOS that supports arm is 11.0. So the wheel tag
143-
cannot contain an earlier deployment target, even if
144-
MACOSX_DEPLOYMENT_TARGET sets it.
142+
Make sure a deployment target is not less than some value.
145143
"""
146-
version_tuple = tuple(map(int, macosx_deployment_target.split(".")))
147-
if version_tuple <= (11, 0):
148-
return "11.0"
149-
else:
150-
return macosx_deployment_target
144+
return max(args, key=lambda x: tuple(map(int, x.split("."))))
151145

152146

153147
def expected_wheels(
@@ -282,11 +276,22 @@ def expected_wheels(
282276

283277
elif platform == "macos":
284278
if machine_arch == "arm64":
285-
arm64_macosx_deployment_target = _get_arm64_macosx_deployment_target(
286-
macosx_deployment_target
279+
arm64_macosx_deployment_target = _floor_macosx_deployment_target(
280+
macosx_deployment_target, "11.0"
287281
)
288282
platform_tags = [f'macosx_{arm64_macosx_deployment_target.replace(".", "_")}_arm64']
289283
else:
284+
if python_abi_tag.startswith("pp") and not python_abi_tag.startswith(
285+
("pp37", "pp38")
286+
):
287+
macosx_deployment_target = _floor_macosx_deployment_target(
288+
macosx_deployment_target, "10.15"
289+
)
290+
elif python_abi_tag.startswith("cp3.13"):
291+
macosx_deployment_target = _floor_macosx_deployment_target(
292+
macosx_deployment_target, "10.13"
293+
)
294+
290295
platform_tags = [f'macosx_{macosx_deployment_target.replace(".", "_")}_x86_64']
291296

292297
if include_universal2:

0 commit comments

Comments
 (0)