fix(venv): use only the vendored uv, drop system-PATH fallback#52
Merged
Conversation
_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
_uv_binuse only the vendoreduvand drop the system-PATH fallback. Plus a 0.3.0 changelog entry.Motivation and Context
uvis a declared dependency, so its binary is always present in our install (including Docker). Falling back toshutil.which("uv")could pick up an arbitrary, possibly mismatcheduvfrom the user's PATH. We want the pinned, vendored one.How Has This Been Tested?
Existing test suite passes locally. The change only affects which
uvbinary is resolved (orNone, in which case callers already fall back to pip).Breaking Changes
None for normal installs. Only a setup that relied on
_uv_binfinding a PATHuvwhen theuvpackage was missing is affected, and that path now returnsNoneand falls back to pip.Types of changes
Checklist
Additional context
Before:
return shutil.which("uv")on import failure.After:
return Noneon import failure, so only the vendored uv is ever used.The changelog gains a 0.3.0 section. That release had no entry yet, so it also records the level 2 PyCG backend and the adaptive sharding that already merged to main.