2929 BuildFrontendConfig ,
3030 BuildSelector ,
3131 DependencyConstraints ,
32- EnableGroups ,
32+ EnableGroup ,
3333 TestSelector ,
3434 format_safe ,
35- read_python_configs ,
3635 resources_dir ,
3736 selector_matches ,
3837 strtobool ,
@@ -50,8 +49,8 @@ class CommandLineArguments:
5049 package_dir : Path
5150 print_build_identifiers : bool
5251 allow_empty : bool
53- prerelease_pythons : bool
5452 debug_traceback : bool
53+ enable : list [str ]
5554
5655 @staticmethod
5756 def defaults () -> CommandLineArguments :
@@ -63,9 +62,9 @@ def defaults() -> CommandLineArguments:
6362 config_file = "" ,
6463 output_dir = Path ("wheelhouse" ),
6564 package_dir = Path ("." ),
66- prerelease_pythons = False ,
6765 print_build_identifiers = False ,
6866 debug_traceback = False ,
67+ enable = [],
6968 )
7069
7170
@@ -618,28 +617,13 @@ def globals(self) -> GlobalOptions:
618617 enable_groups = self .reader .get (
619618 "enable" , env_plat = False , option_format = ListFormat (sep = " " ), env_rule = InheritRule .APPEND
620619 )
621- enable = {EnableGroups (group ) for group in enable_groups .split ()}
622-
623- free_threaded_support = strtobool (
624- self .reader .get ("free-threaded-support" , env_plat = False , ignore_empty = True )
625- )
626-
627- prerelease_pythons = args .prerelease_pythons or strtobool (
628- self .env .get ("CIBW_PRERELEASE_PYTHONS" , "0" )
629- )
630-
631- if free_threaded_support or prerelease_pythons :
632- msg = (
633- "free-threaded-support and prerelease-pythons should be specified by enable instead"
634- )
635- if enable :
636- raise OptionsReaderError (msg )
637- log .warning (msg )
638-
639- if free_threaded_support :
640- enable .add (EnableGroups .CPythonFreeThreading )
641- if prerelease_pythons :
642- enable .add (EnableGroups .CPythonPrerelease )
620+ try :
621+ enable = {EnableGroup (group ) for group in enable_groups .split ()}
622+ for command_line_group in args .enable :
623+ enable .add (EnableGroup (command_line_group ))
624+ except ValueError as e :
625+ msg = f"Failed to parse enable group. { e } . Valid group names are: { ', ' .join (g .value for g in EnableGroup )} "
626+ raise errors .ConfigurationError (msg ) from e
643627
644628 # This is not supported in tool.cibuildwheel, as it comes from a standard location.
645629 # Passing this in as an environment variable will override pyproject.toml, setup.cfg, or setup.py
@@ -656,30 +640,16 @@ def globals(self) -> GlobalOptions:
656640 build_config = args .only
657641 skip_config = ""
658642 architectures = Architecture .all_archs (self .platform )
659- enable = set (EnableGroups )
643+ enable = set (EnableGroup )
660644
661645 build_selector = BuildSelector (
662646 build_config = build_config ,
663647 skip_config = skip_config ,
664648 requires_python = requires_python ,
665- enable = frozenset (
666- enable | {EnableGroups .PyPy }
667- ), # For backwards compatibility, we are adding PyPy for now
649+ enable = frozenset (enable ),
668650 )
669651 test_selector = TestSelector (skip_config = test_skip )
670652
671- all_configs = read_python_configs (self .platform )
672- all_pypy_ids = {
673- config ["identifier" ] for config in all_configs if config ["identifier" ].startswith ("pp" )
674- }
675- if (
676- not self ._defaults
677- and EnableGroups .PyPy not in enable
678- and any (build_selector (build_id ) for build_id in all_pypy_ids )
679- ):
680- msg = "PyPy builds will be disabled by default in version 3. Enabling PyPy builds should be specified by enable"
681- log .warning (msg )
682-
683653 return GlobalOptions (
684654 package_dir = package_dir ,
685655 output_dir = output_dir ,
0 commit comments