File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,16 @@ def setup_python(
267267 # retrieve the one supplied by the user, otherwise 10.9 is supported with every installer.
268268 # An exception can be made for wheel built explicitly for arm64, this will be fixed later on.
269269 # PyPy defaults to 10.7, causing inconsistencies if it's left unset.
270- deployment_target = tuple (map (int , env .get ("MACOSX_DEPLOYMENT_TARGET" , "10.9" ).split ("." )))
270+ # it's valid to set e.g. MACOSX_DEPLOYMENT_TARGET=10.12.1 or MACOSX_DEPLOYMENT_TARGET=11
271+ # always normalize as tuple(major, minor)
272+ deployment_target = tuple (map (int , env .get ("MACOSX_DEPLOYMENT_TARGET" , "10.9" ).split ("." )[:2 ]))
273+ if deployment_target [0 ] >= 11 :
274+ # starting with macOS 11, the minor version in fact represents patch version
275+ deployment_target = (deployment_target [0 ], 0 )
276+ if len (deployment_target ) < 2 :
277+ # even though it didn't make much sense before macOS 11, it was valid to set
278+ # MACOSX_DEPLOYMENT_TARGET=10 which is 10.0
279+ deployment_target = (deployment_target [0 ], 0 )
271280
272281 config_is_arm64 = python_configuration .identifier .endswith ("arm64" )
273282 config_is_universal2 = python_configuration .identifier .endswith ("universal2" )
You can’t perform that action at this time.
0 commit comments