Skip to content

Commit 6e58574

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 8eac87b commit 6e58574

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

263278
if python_configuration.version not in {"3.6", "3.7"}:
264279
if config_is_arm64:

0 commit comments

Comments
 (0)