@@ -460,17 +460,31 @@ def check_for_invalid_selectors(
460460 warnings = []
461461
462462 for selector in selector_value .split ():
463- if not any (selector_matches (selector , i ) for i in all_enabled_identifiers ):
463+ selector_ = selector
464+ if selector_name == "test_skip" :
465+ # macosx_universal2 uses an additional identifier for tests which ends with ":{arch}"
466+ values = selector .split (":" )
467+ universal2_identifiers = filter (
468+ lambda x : x .endswith ("-macosx_universal2" ), all_valid_identifiers
469+ )
470+ if len (values ) == 2 and any (
471+ selector_matches (selector_ , f"{ i } :{ arch } " )
472+ for i in universal2_identifiers
473+ for arch in ["arm64" , "x86_64" ]
474+ ):
475+ # just ignore the arch part in the rest of the check
476+ selector_ = values [0 ]
477+ if not any (selector_matches (selector_ , i ) for i in all_enabled_identifiers ):
464478 msg = f"Invalid { selector_name } selector: { selector !r} . "
465479 error_type : type = errors .ConfigurationError
466480
467- if any (selector_matches (selector , i ) for i in all_valid_identifiers ):
481+ if any (selector_matches (selector_ , i ) for i in all_valid_identifiers ):
468482 msg += "This selector matches a group that wasn't enabled. Enable it using the `enable` option or remove this selector. "
469483
470- if "p2" in selector or "p35" in selector :
484+ if "p2" in selector_ or "p35" in selector_ :
471485 msg += f"cibuildwheel 3.x no longer supports Python < 3.8. Please use the 1.x series or update `{ selector_name } `. "
472486 error_type = errors .DeprecationError
473- if "p36" in selector or "p37" in selector :
487+ if "p36" in selector_ or "p37" in selector_ :
474488 msg += f"cibuildwheel 3.x no longer supports Python < 3.8. Please use the 2.x series or update `{ selector_name } `. "
475489 error_type = errors .DeprecationError
476490
0 commit comments