From e1112fe661253cf1ab78aa8d04fa458ed213fb00 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 25 Oct 2024 22:30:37 +0200 Subject: [PATCH] remove support for {python} and {pip} in commands --- cibuildwheel/__main__.py | 6 +++--- cibuildwheel/util.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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]: