Skip to content

Commit

Permalink
fix: set minimal deployment target to macOS 10.13 with CPython 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Sep 9, 2024
1 parent 32c9be9 commit 88f8e3f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ def setup_python(
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
# For arm64, the minimal deployment target is 11.0.
# On x86_64 (or universal2), use 10.9 as a default.
# CPython 3.13 needs 10.13.
# CPython 3.12.6+ needs 10.13.
if config_is_arm64:
default_target = "11.0"
elif Version(python_configuration.version) >= Version("3.13"):
elif Version(python_configuration.version) >= Version("3.12"):
default_target = "10.13"
elif python_configuration.identifier.startswith("pp") and Version(
python_configuration.version
Expand Down
30 changes: 16 additions & 14 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,25 +274,27 @@ def expected_wheels(
platform_tags = ["win32", "win_amd64"]

elif platform == "macos":
if python_abi_tag.startswith("pp"):
if python_abi_tag.startswith(("pp37", "pp38")):
min_macosx = macosx_deployment_target
else:
min_macosx = _floor_macosx(macosx_deployment_target, "10.15")
elif python_abi_tag.startswith("cp"):
if python_abi_tag.startswith(("cp36", "cp37", "cp38", "cp39", "cp310", "cp311")):
min_macosx = macosx_deployment_target
else:
min_macosx = _floor_macosx(macosx_deployment_target, "10.13")
else:
min_macosx = macosx_deployment_target

if machine_arch == "arm64":
arm64_macosx = _floor_macosx(macosx_deployment_target, "11.0")
arm64_macosx = _floor_macosx(min_macosx, "11.0")
platform_tags = [f'macosx_{arm64_macosx.replace(".", "_")}_arm64']
else:
if python_abi_tag.startswith("pp") and not python_abi_tag.startswith(
("pp37", "pp38")
):
pypy_macosx = _floor_macosx(macosx_deployment_target, "10.15")
platform_tags = [f'macosx_{pypy_macosx.replace(".", "_")}_x86_64']
elif python_abi_tag.startswith("cp313"):
pypy_macosx = _floor_macosx(macosx_deployment_target, "10.13")
platform_tags = [f'macosx_{pypy_macosx.replace(".", "_")}_x86_64']
else:
platform_tags = [f'macosx_{macosx_deployment_target.replace(".", "_")}_x86_64']
platform_tags = [f'macosx_{min_macosx.replace(".", "_")}_x86_64']

if include_universal2:
platform_tags.append(
f'macosx_{macosx_deployment_target.replace(".", "_")}_universal2',
)
platform_tags.append(f'macosx_{min_macosx.replace(".", "_")}_universal2')
else:
msg = f"Unsupported platform {platform!r}"
raise Exception(msg)
Expand Down

0 comments on commit 88f8e3f

Please sign in to comment.