File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -255,8 +255,23 @@ def setup_python(
255
255
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
256
256
# For arm64, the minimal deployment target is 11.0.
257
257
# 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
260
275
261
276
if python_configuration .version not in {"3.6" , "3.7" }:
262
277
if config_is_arm64 :
You can’t perform that action at this time.
0 commit comments