fix: error if selector is empty
This commit is contained in:
committed by
Henry Schreiner
parent
e75a3d480a
commit
27a0053386
@@ -5,7 +5,7 @@ import textwrap
|
||||
import traceback
|
||||
from configparser import ConfigParser
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Set, overload
|
||||
from typing import Dict, List, Optional, Set, Union, overload
|
||||
|
||||
import cibuildwheel
|
||||
import cibuildwheel.linux
|
||||
@@ -194,8 +194,14 @@ def main() -> None:
|
||||
archs_config_str = get_option_from_environment('CIBW_ARCHS', platform=platform, default='auto')
|
||||
archs = Architecture.parse_config(archs_config_str, platform=platform)
|
||||
|
||||
identifiers = get_build_identifiers(platform, build_selector, archs)
|
||||
if not identifiers:
|
||||
print("ERROR: No build identifiers selected!")
|
||||
sys.exit(3)
|
||||
|
||||
if args.print_build_identifiers:
|
||||
print_build_identifiers(platform, build_selector, archs)
|
||||
for identifier in identifiers:
|
||||
print(identifier)
|
||||
sys.exit(0)
|
||||
|
||||
manylinux_images: Optional[Dict[str, str]] = None
|
||||
@@ -311,20 +317,22 @@ def print_preamble(platform: str, build_options: BuildOptions) -> None:
|
||||
print('\nHere we go!\n')
|
||||
|
||||
|
||||
def print_build_identifiers(
|
||||
platform: str, build_selector: BuildSelector, architectures: Set[Architecture]
|
||||
) -> None:
|
||||
|
||||
python_configurations: List[Any] = []
|
||||
def get_build_identifiers(
|
||||
platform: PlatformName, build_selector: BuildSelector, architectures: Set[Architecture]
|
||||
) -> List[str]:
|
||||
python_configurations: Union[List[cibuildwheel.linux.PythonConfiguration],
|
||||
List[cibuildwheel.windows.PythonConfiguration],
|
||||
List[cibuildwheel.macos.PythonConfiguration]]
|
||||
if platform == 'linux':
|
||||
python_configurations = cibuildwheel.linux.get_python_configurations(build_selector, architectures)
|
||||
elif platform == 'windows':
|
||||
python_configurations = cibuildwheel.windows.get_python_configurations(build_selector, architectures)
|
||||
elif platform == 'macos':
|
||||
python_configurations = cibuildwheel.macos.get_python_configurations(build_selector)
|
||||
else:
|
||||
assert_never(platform)
|
||||
|
||||
for config in python_configurations:
|
||||
print(config.identifier)
|
||||
return [config.identifier for config in python_configurations]
|
||||
|
||||
|
||||
def detect_warnings(platform: str, build_options: BuildOptions) -> List[str]:
|
||||
|
||||
Reference in New Issue
Block a user