diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index ba580d5c3..2b8c5cdbd 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -417,10 +417,10 @@ def detect_warnings(*, options: Options, identifiers: Iterable[str]) -> list[str if any(o and ("{python}" in o or "{pip}" in o) for o in option_values): # Reminder: in an f-string, double braces means literal single brace msg = ( - f"{option_name}: '{{python}}' and '{{pip}}' are no longer needed, " - "and will be removed in cibuildwheel 3. Simply use 'python' or 'pip' instead." + f"{option_name}: '{{python}}' and '{{pip}}' are no longer supported " + "and have been removed in cibuildwheel 3. Simply use 'python' or 'pip' instead." ) - warnings.append(msg) + raise errors.ConfigurationError(msg) return warnings diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index b2a598030..7c0eab3fa 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -219,12 +219,12 @@ def format_safe(template: str, **kwargs: str | os.PathLike[str]) -> str: def prepare_command(command: str, **kwargs: PathOrStr) -> str: """ - Preprocesses a command by expanding variables like {python}. + Preprocesses a command by expanding variables like {project}. For example, used in the test_command option to specify the path to the project's root. Unmatched syntax will mostly be allowed through. """ - return format_safe(command, python="python", pip="pip", **kwargs) + return format_safe(command, **kwargs) def get_build_verbosity_extra_flags(level: int) -> list[str]: