Pass the environment directory to uv package commands - #1742
Open
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 2 commits into
Open
Pass the environment directory to uv package commands#1742Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 2 commits into
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 2 commits into
Conversation
Copilot started work on behalf of
Eduardo Villalpando Mello (edvilme)
August 27, 2026 04:57
View session
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix command class architecture for package-manager operations
Pass the environment directory to uv package commands
Aug 27, 2026
Eduardo Villalpando Mello (edvilme)
marked this pull request as ready for review
August 27, 2026 16:16
Contributor
|
Fixes #1674 |
Rich Chiodo (rchiodo)
approved these changes
Aug 27, 2026
Eduardo Villalpando Mello (edvilme)
enabled auto-merge (squash)
August 27, 2026 22:14
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.
UV-backed package operations were constructed with
environment.execInfo.run.executable. For symlinked virtual environments (e.g. Pipenv), that executable can resolve to a uv-managed base interpreter, souv pip install --python <exe>operated on the externally managed base interpreter instead of the selected environment.uv accepts an environment directory as its
--pythontarget, so the fix is to hand UV commandsenvironment.environmentPath.fsPathat the pip/uv boundary. Ordinary pip commands still need the interpreter executable.Changes
src/managers/builtin/commands/factory.ts: whenshouldUseUv(...)selects uv, construct the UV command with a copy of the options whosepythonExecutableisenvironmentPath. Pip commands keep the original options.src/test/managers/builtin/commands.unit.test.ts: stubshouldUseUvonce in the existing setup and add regression coverage that UV install/uninstall/list/direct-names all pass the environment directory after--pythonand never the base interpreter, and that pip still runsrunPythonwith the original interpreter.Fixing this centrally covers every factory-created UV operation without touching each command class. Call sites were reviewed:
UvVersionCommand(uv --version) andUvAvailableVersionsCommand(uv tool run pip index versions …) don't referencepythonExecutablein their arguments, so they're unaffected.This adapts the intent of #1673 to the command-class refactor merged later in #1686.