Skip to content

Commit 7860f2f

Browse files
committed
fix: set minimal deployment target to macOS 10.13 with CPython 3.12
1 parent cd8c50e commit 7860f2f

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

cibuildwheel/macos.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ def setup_python(
294294
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
295295
# For arm64, the minimal deployment target is 11.0.
296296
# On x86_64 (or universal2), use 10.9 as a default.
297-
# CPython 3.13 needs 10.13.
297+
# CPython 3.12.6+ needs 10.13.
298298
if config_is_arm64:
299299
default_target = "11.0"
300-
elif Version(python_configuration.version) >= Version("3.13"):
300+
elif Version(python_configuration.version) >= Version("3.12"):
301301
default_target = "10.13"
302302
elif python_configuration.identifier.startswith("pp") and Version(
303303
python_configuration.version

test/utils.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,27 @@ def expected_wheels(
274274
platform_tags = ["win32", "win_amd64"]
275275

276276
elif platform == "macos":
277+
if python_abi_tag.startswith("pp"):
278+
if python_abi_tag.startswith(("pp37", "pp38")):
279+
min_macosx = macosx_deployment_target
280+
else:
281+
min_macosx = _floor_macosx(macosx_deployment_target, "10.15")
282+
elif python_abi_tag.startswith("cp"):
283+
if python_abi_tag.startswith(("cp36", "cp37", "cp38", "cp39", "cp310", "cp311")):
284+
min_macosx = macosx_deployment_target
285+
else:
286+
min_macosx = _floor_macosx(macosx_deployment_target, "10.13")
287+
else:
288+
min_macosx = macosx_deployment_target
289+
277290
if machine_arch == "arm64":
278-
arm64_macosx = _floor_macosx(macosx_deployment_target, "11.0")
291+
arm64_macosx = _floor_macosx(min_macosx, "11.0")
279292
platform_tags = [f'macosx_{arm64_macosx.replace(".", "_")}_arm64']
280293
else:
281-
if python_abi_tag.startswith("pp") and not python_abi_tag.startswith(
282-
("pp37", "pp38")
283-
):
284-
pypy_macosx = _floor_macosx(macosx_deployment_target, "10.15")
285-
platform_tags = [f'macosx_{pypy_macosx.replace(".", "_")}_x86_64']
286-
elif python_abi_tag.startswith("cp313"):
287-
pypy_macosx = _floor_macosx(macosx_deployment_target, "10.13")
288-
platform_tags = [f'macosx_{pypy_macosx.replace(".", "_")}_x86_64']
289-
else:
290-
platform_tags = [f'macosx_{macosx_deployment_target.replace(".", "_")}_x86_64']
294+
platform_tags = [f'macosx_{min_macosx.replace(".", "_")}_x86_64']
291295

292296
if include_universal2:
293-
platform_tags.append(
294-
f'macosx_{macosx_deployment_target.replace(".", "_")}_universal2',
295-
)
297+
platform_tags.append(f'macosx_{min_macosx.replace(".", "_")}_universal2')
296298
else:
297299
msg = f"Unsupported platform {platform!r}"
298300
raise Exception(msg)

0 commit comments

Comments
 (0)