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 @@ -257,8 +257,23 @@ def setup_python(
257
257
# Set MACOSX_DEPLOYMENT_TARGET, if the user didn't set it.
258
258
# For arm64, the minimal deployment target is 11.0.
259
259
# 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
262
277
263
278
if python_configuration .version not in {"3.6" , "3.7" }:
264
279
if config_is_arm64 :
You can’t perform that action at this time.
0 commit comments