Skip to content

Split UV/Venv EnvironmentManager's - #1945

Merged
Eduardo Villalpando Mello (edvilme) merged 4 commits into
mainfrom
uv-managers-environment
Oct 28, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 4 commits into
mainfrom
uv-managers-environment

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1941 that extracts venv and uv environment operations into peer backend managers composed under BuiltInEnvironmentManager, while preserving ms-python.python:venv compatibility.

Changes

  • VenvEnvironmentManager (src/managers/builtin/venvEnvironmentManager.ts):
    • Owns venv environment features: python -m venv creation, venv / virtualEnv / virtualEnvWrapper classification, and VENV_WORKSPACE_KEY / VENV_GLOBAL_KEY workspace/global selection cache keys.
  • UvEnvironmentManager (src/managers/builtin/uvEnvironmentManager.ts):
    • Owns uv environment features: uv venv --verbose --seed --python creation (with scoped getUvExecutable(projectDir)), venvUv / uvWorkspace classification, isUvManagedPythonInstall filtering so standalone uv-managed base Pythons remain in SysPythonManager, 'uv' / 'uv workspace' descriptions, and UV_ENVS_KEY persistence tracking/untracking/cache clearing.
  • BuiltInEnvironmentManager (src/managers/builtin/builtInEnvironmentManager.ts, renamed from venvManager.ts):
    • Composes VenvEnvironmentManager and UvEnvironmentManager as peers under the ms-python.python:venv EnvironmentManager registration so nativeFinder.refresh() runs once per refresh and existing settings/identities remain non-breaking.
    • Routes creation via selectBackend(venvRoot, venv, uv) (await shouldUseUv(log, venvRoot.fsPath) ? uv : venv) and delegates discovery classification, descriptions, persistence tracking, removal cleanup, and cache clearing to the peer backends (venvUtils.ts, venvStepBasedFlow.ts).
  • SysPythonManager.create quickCreate guard (src/managers/builtin/sysPythonManager.ts):
    • Returns undefined when options?.quickCreate is true so non-interactive quick creation requests against ms-python.python:system do not open an interactive version QuickPick in headless environments when uv is installed.

@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code quality issues label Oct 22, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) marked this pull request as ready for review October 22, 2026 21:51
@heejaechang

Heejae Chang (heejaechang) commented Oct 22, 2026 •

Copy link
Copy Markdown

🔒 Automated review in progress — Heejae Chang (@heejaechang) is auto-reviewing this PR.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved via Review Center.

@heejaechang Heejae Chang (heejaechang) added the review-auto:approved Automated review: no blocking findings (approval posted). label Oct 28, 2026

@rchiodo Rich Chiodo (rchiodo) 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.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved via Review Center.

@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 68b16f1 into main Oct 28, 2026
110 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the uv-managers-environment branch October 28, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants