Skip to content

Prefer Python Install Manager for Windows Python acquisition - #1935

Merged
Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:pymanager-python-installation
Oct 16, 2026
Merged

Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:pymanager-python-installation

Conversation

@StellaHuang95

Copy link
Copy Markdown
Contributor

Summary

  • prefer an existing Python Install Manager on Windows for base-Python acquisition, while retaining uv when PyManager is absent
  • share provider selection across Global creation, project venv creation, activation-time acquisition, and PEP 723 inline-script setup
  • verify the actual installed CPython interpreter, serialize PyManager mutations, prevent unsafe downgrades, and pause package watchers during in-place runtime updates
  • supplement Global discovery with verified PyManager-owned runtimes while preserving existing uv-managed interpreter behavior
  • surface provider-specific cancellation and failure states without starting a second installer or publishing partial selections

Validation

  • npm run lint
  • npm run compile-tests
  • npm run unittest — 3,306 passing, 9 pending
  • npm run compile
  • npm run smoke-test — 30 passing, 1 pending
  • npm run e2e-test — 4 passing
  • non-interactive integration suite — 60 passing, 5 pending
  • multi-root integration suite — 3 passing, 1 pending
  • native Windows PyManager probes succeeded for installed, online, and --one JSON listings (82 online catalogue entries)

The full integration run reached 60 passing and 8 pending, with the existing interactive environment-creation case timing out because the headless VS Code test host cannot answer the real Global Python version picker. The equivalent provider picker and creation flows were verified manually in an Extension Development Host.

Use an existing Python Install Manager for Windows runtime acquisition while preserving the original uv path when PyManager is absent. Share the provider across Global, venv, and PEP 723 flows, verify installed runtimes, coordinate discovery and package watchers, and preserve cancellation and fallback semantics.

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

Rich Chiodo (rchiodo) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@StellaHuang95 Stella Huang (StellaHuang95) added the feature-request Request for new features or functionality label Oct 15, 2026
@rchiodo

Copy link
Copy Markdown
Contributor

Result: ⚠️ partially-verified

Verification details

Verification: Isolated verification observed failures that were not classified as caused by this PR: Dependency and test-runner discovery.

Summary: Test compilation and three targeted Mocha runs passed: 972 passing tests and five pending. Coverage included provider selection, interpreter verification, mutation serialization, downgrade prevention, watcher coordination, discovery, venv creation, inline scripts, and uv regressions. Offline dependency installation succeeded; discovery exited 128 because the container snapshot lacked Git metadata. Native Windows PyManager and Electron-hosted integration flows were not exercised, so verification remains partial.

Test runs: 5 passed, 1 failed

  • ❌ Failed | unrelated to this PR | Dependency and test-runner discovery | printf 'Sandbox profile: %s\n' "$AUTOMATION_SANDBOX_PROFILE"; node --version; npm --version; git status --short; node -e "const p=require('./package.json'); console.log(JSON.stringify({scripts:p.scripts,engines:p.engines},null,2)); const fs=require('fs'); for (const f of ['node_modules','node_modules/mocha/bin/mocha.js','node_modules/typescript/bin/tsc','out/test/unittests.js']) console.log(f,fs.existsSync(f));"; cat build/.mocha.unittests.json; sed -n '1,110p' src/test/unittests.ts; git log -1 --oneline
  • ✅ Passed | Installer process, PyManager detection, runtime candidates, and provider orchestration | node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 20000 --reporter dot out/test/common/installerProcess.unit.test.js out/test/managers/builtin/pymanagerPythonInstaller.unit.test.js out/test/managers/builtin/pythonRuntimeCandidates.unit.test.js out/test/managers/builtin/pythonInstaller.unit.test.js
  • ✅ Passed | Watcher coordination, system discovery, saved selection, venv creation, and fast paths | node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 20000 --reporter dot out/test/managers/common/packageWatcher.unit.test.js out/test/managers/builtin/sysPythonManager.pymanager.unit.test.js out/test/managers/builtin/sysPythonManager.savedSelection.unit.test.js out/test/managers/builtin/venvManager.createRemove.unit.test.js out/test/managers/fastPath.get.unit.test.js
  • ✅ Passed | Inline-script integration, onboarding isolation, tool managers, and uv regressions | node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 20000 --reporter dot out/test/features/inlineScript/setupEnvironment.unit.test.js out/test/managers/builtin/inlineScript/envManager.unit.test.js out/test/internal/discoveryIsolation.unit.test.js out/test/internal/pythonToolManagers.unit.test.js out/test/managers/builtin/uvPythonInstaller.unit.test.js out/test/managers/builtin/uvManagedPythonInstall.unit.test.js out/test/managers/builtin/venvUtils.uvTracking.unit.test.js
  • ✅ Passed | Offline dependency bootstrap | npm ci --offline --frozen-lockfile
  • ✅ Passed | TypeScript test compilation | npm run compile-tests
❌ Dependency and test-runner discovery diagnostic output
Sandbox profile: typescript
v22.21.1
10.9.4
node_modules false
node_modules/mocha/bin/mocha.js false
node_modules/typescript/bin/tsc false
out/test/unittests.js false
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[container exit=128]

@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.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Oct 16, 2026

@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.

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.

@StellaHuang95
Stella Huang (StellaHuang95) merged commit ee11740 into microsoft:main Oct 16, 2026
109 of 112 checks passed
@StellaHuang95
Stella Huang (StellaHuang95) deleted the pymanager-python-installation branch October 16, 2026 19:52
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 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