Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from cibuildwheel.typing import PLATFORMS, PlatformName
from cibuildwheel.util.file import CIBW_CACHE_PATH
from cibuildwheel.util.helpers import strtobool
from cibuildwheel.util.resources import read_all_configs


@dataclasses.dataclass
Expand Down Expand Up @@ -132,6 +133,8 @@ def main_inner(global_options: GlobalOptions) -> None:
parser.add_argument(
"--only",
default=None,
choices=[v["identifier"] for vv in read_all_configs().values() for v in vv],
metavar="IDENTIFIER",
help="""
Force a single wheel build when given an identifier. Overrides
CIBW_BUILD/CIBW_SKIP. --platform and --arch cannot be specified
Expand Down
9 changes: 6 additions & 3 deletions cibuildwheel/util/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

# this value is cached because it's used a lot in unit tests
@functools.cache
def read_python_configs(config: PlatformName) -> list[dict[str, str]]:
def read_all_configs() -> dict[str, list[dict[str, str]]]:
with BUILD_PLATFORMS.open("rb") as f:
loaded_file = tomllib.load(f)
results: list[dict[str, str]] = list(loaded_file[config]["python_configurations"])
return results
return {k: list[dict[str, str]](v["python_configurations"]) for k, v in loaded_file.items()}


def read_python_configs(config: PlatformName) -> list[dict[str, str]]:
return read_all_configs()[config]
Loading