Skip to content

uv: fall back to workspace-local executable - #1821

Merged
Eleanor Boyd (eleanorjboyd) merged 2 commits into
microsoft:mainfrom
eleanorjboyd:work/uv-workspace-fallback
Sep 25, 2026
Merged

Eleanor Boyd (eleanorjboyd) merged 2 commits into
microsoft:mainfrom
eleanorjboyd:work/uv-workspace-fallback

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Prefer uv on the extension PATH, then check a trusted workspace’s .pyprojectx/main/uv (uv.exe on Windows) for environments within that workspace.
  • Carry the resolved executable through package commands and virtual-environment creation so detection and execution agree.
  • Document that external/shared environments still require uv on PATH; the integrated terminal PATH is unchanged.

Closes #812.

Prefer uv on PATH, then use a trusted workspace pyprojectx executable for environments in that workspace. Carry the resolved command through package operations and venv creation without modifying terminal PATH, with focused multi-root and trust coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eleanorjboyd Eleanor Boyd (eleanorjboyd) added the feature-request Request for new features or functionality label Sep 25, 2026
Construct mocked executable paths from Uri.fsPath, matching the path returned by workspace folder resolution on Windows where URI drive letters may be lowercased.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved findings include repeated UV probing, remote-workspace URI handling, and fallback telemetry.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds trusted workspace-local uv fallback and propagates the selected executable through environment creation and package commands.

Changes:

  • Falls back to .pyprojectx/main/uv when PATH lookup fails.
  • Passes the resolved executable to UV operations.
  • Adds tests and documents fallback behavior.
File Summary
src/​test/​managers/​builtin/​venvUtils.createWithProgress.unit.test.ts Tests UV executable propagation during environment creation.
src/​test/​managers/​builtin/​pipPackageManager.unit.test.ts Tests package manager behavior.
src/​test/​managers/​builtin/​helpers.runUV.unit.test.ts Tests UV execution.
src/​test/​managers/​builtin/​helpers.isUvInstalled.unit.test.ts Tests UV discovery and fallback.
src/​test/​managers/​builtin/​commands.unit.test.ts Tests command executable propagation.
src/​managers/​builtin/​venvUtils.ts Uses resolved UV during creation.
src/​managers/​builtin/​helpers.ts Resolves and runs UV executables.
src/​managers/​builtin/​commands/​version.ts Supports the configured UV executable.
src/​managers/​builtin/​commands/​uninstall.ts Supports the configured UV executable.
src/​managers/​builtin/​commands/​listDirectNames.ts Supports the configured UV executable.
src/​managers/​builtin/​commands/​list.ts Supports the configured UV executable.
src/​managers/​builtin/​commands/​install.ts Supports the configured UV executable.
src/​managers/​builtin/​commands/​factory.ts Supplies the UV executable to commands.
src/​managers/​builtin/​commands/​availableVersions.ts Supports the configured UV executable.
src/​managers/​base/​commands/​packageManagerCommand.ts Stores executable configuration.
src/​common/​workspace.apis.ts Exposes workspace trust access.
README.md Documents fallback and PATH behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

UvCommand: CommandConstructor<U>,
): Promise<PipOrUvCommand<P, U>> {
if (await shouldUseUv(options.log, environmentPath)) {
const uvExecutable = await getUvExecutable(options.log, environmentPath);
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) merged commit 97dd21c into microsoft:main Sep 25, 2026
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow usage of non-global uv executable

3 participants