diff --git a/python/uv/_build_backend.py b/python/uv/_build_backend.py index 5ab4cb1ba3f45..88bd54c91286c 100644 --- a/python/uv/_build_backend.py +++ b/python/uv/_build_backend.py @@ -26,14 +26,17 @@ def warn_config_settings(config_settings: "dict | None" = None): def call(args: "list[str]", config_settings: "dict | None" = None) -> str: """Invoke a uv subprocess and return the filename from stdout.""" + import shutil import subprocess import sys - from ._find_uv import find_uv_bin - warn_config_settings(config_settings) + # Unlike `find_uv_bin`, this mechanism must work according to PEP 517 + uv_bin = shutil.which("uv") + if uv_bin is None: + raise RuntimeError("uv was not properly installed") # Forward stderr, capture stdout for the filename - result = subprocess.run([find_uv_bin()] + args, stdout=subprocess.PIPE) + result = subprocess.run([uv_bin] + args, stdout=subprocess.PIPE) if result.returncode != 0: sys.exit(result.returncode) # If there was extra stdout, forward it (there should not be extra stdout)