Skip to content

Commit 1fa0436

Browse files
committed
fix(venv): use only the vendored uv, drop system-PATH fallback
_uv_bin no longer falls back to a uv found on PATH. The uv PyPI package is a declared dependency and is always present in our install (including Docker), so the analyzer should use that pinned, vendored binary rather than whatever uv happens to be on the user's PATH. Returns None only if the package is missing, in which case callers fall back to pip.
1 parent 7089acc commit 1fa0436

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

codeanalyzer/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,16 @@ def _get_base_interpreter() -> Path:
238238

239239
@staticmethod
240240
def _uv_bin() -> Optional[str]:
241-
"""Path to a uv binary: the one bundled with the ``uv`` PyPI package (a
242-
dependency, so normally always present -- including inside a Docker image),
243-
else a uv on PATH, else ``None`` (callers fall back to pip)."""
241+
"""Path to the uv binary bundled with the ``uv`` PyPI package (a declared
242+
dependency, so always present in our install -- including inside a Docker
243+
image). We deliberately ignore any uv on PATH so the analyzer always uses
244+
the pinned, vendored uv. Returns ``None`` only if the package is somehow
245+
missing (callers fall back to pip)."""
244246
try:
245247
from uv import find_uv_bin
246-
247248
return str(find_uv_bin())
248249
except Exception:
249-
return shutil.which("uv")
250+
return None
250251

251252
def _install_into_venv(self, venv_python: Path, args: List[str]) -> None:
252253
"""Install packages into the target venv, preferring uv for speed (parallel

0 commit comments

Comments
 (0)