Skip to content

Commit c730a98

Browse files
committed
fix: set min target to 10.13 for 3.13 and floor it always
Signed-off-by: Henry Schreiner <[email protected]>
1 parent fc2cfe0 commit c730a98

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

cibuildwheel/macos.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,23 @@ def setup_python(
255255
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
256256
# For arm64, the minimal deployment target is 11.0.
257257
# On x86_64 (or universal2), use 10.9 as a default.
258-
# PyPy defaults to 10.7, causing inconsistencies if it's left unset.
259-
env.setdefault("MACOSX_DEPLOYMENT_TARGET", "11.0" if config_is_arm64 else "10.9")
258+
# PyPy needs 10.10. CPython 3.13 needs 10.13.
259+
if config_is_arm64:
260+
default_target = "11.0"
261+
elif Version(python_configuration.version) >= Version("3.13"):
262+
default_target = "10.13"
263+
elif python_configuration.identifier.startswith("pp"):
264+
default_target = "10.10"
265+
else:
266+
default_target = "10.9"
267+
env.setdefault("MACOSX_DEPLOYMENT_TARGET", default_target)
268+
269+
# This is a floor, it can't be set lower than the default_target.
270+
if Version(env["MACOSX_DEPLOYMENT_TARGET"]) <= Version(default_target):
271+
log.notice(
272+
f"Bumping MACOSX_DEPLOYMENT_TARGET ({env['MACOSX_DEPLOYMENT_TARGET']}) to the minimum required ({default_target})."
273+
)
274+
env["MACOSX_DEPLOYMENT_TARGET"] = default_target
260275

261276
if python_configuration.version not in {"3.6", "3.7"}:
262277
if config_is_arm64:

0 commit comments

Comments
 (0)