Skip to content

feat: DH-21980: Python managed servers#313

Draft
bmingles wants to merge 12 commits intomainfrom
DH-21980_python-managed-servers
Draft

feat: DH-21980: Python managed servers#313
bmingles wants to merge 12 commits intomainfrom
DH-21980_python-managed-servers

Conversation

@bmingles
Copy link
Collaborator

DH-21980: Python managed servers

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Deploying docs previews for 6e4f7db (available for 14 days)

VS Code Extension

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

End-to-end Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
330000017:33:59
A ctrf plugin

Failed Test Summary

No failed tests ✨

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Unit Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
7047040000000:00:00
A ctrf plugin

Failed Test Summary

No failed tests ✨

bmingles added 12 commits March 18, 2026 14:37
…hon Environments API to extensionApiUtils.ts. Currently only has MsPythonExtensionApi interface for old ms-python.python API. Need to add PythonEnvironmentApi interface matching the new ms-python.vscode-python-envs extension API including: PythonEnvironment, PythonEnvironmentId, PythonEnvironmentExecutionInfo, Package, PackageId interfaces and getEnvironment, getPackages, onDidChangePackages methods.

Added PythonEnvironmentApi interface with getEnvironment, getPackages, onDidChangePackages methods; added supporting interfaces PythonEnvironment, PythonEnvironmentExecutionInfo, PythonEnvironmentId, Package, PackageId, DidChangePackagesEventArgs, PackageChangeKind enum, GetEnvironmentScope type, and getPythonEnvironmentApi() getter function to extensionApiUtils.ts. TypeScript compiles with no errors. (#DH-21980)
…i function to extensionApiUtils.ts. Currently exports getMsPythonExtensionApi for ms-python.python extension. Add similar function for ms-python.vscode-python-envs extension that returns vscode.Extension<PythonEnvironmentApi>. Extension ID is 'ms-python.vscode-python-envs'.

Renamed getPythonEnvironmentApi to getPythonEnvsExtensionApi in extensionApiUtils.ts to match required function name. Returns vscode.Extension<PythonEnvironmentApi> | undefined using MS_PYTHON_ENVS_EXTENSION_ID. (#DH-21980)
…etPythonInterpreterPath to use new Python Environments API. Currently uses old ms-python.python API getActiveEnvironmentPath method (line 178). Replace with new API: call getEnvironment(undefined) for global scope, then return env.execInfo.run.executable. If new extension not available, disable managed servers by returning null (no fallback to old API needed).

Updated getPythonInterpreterPath to use getPythonEnvsExtensionApi and new api.getEnvironment(undefined) returning env.execInfo.run.executable (#DH-21980)
…kPipInstall with getPackages API. Currently spawns subprocess at line 107. Use getEnvironment then getPackages to check for deephaven-server package.

Replaced execFileSync subprocess call with getPackages API. Now calls getEnvironment(undefined) then getPackages(env) and checks for deephaven-server package by name. Removed execFileSync import. (#DH-21980)
…v.sysPrefix for VIRTUAL_ENV. Line 264 manually derives path with path.dirname. Use environment.sysPrefix directly from PythonEnvironment object. Works for venv, uv, conda, all manager types.

Updated checkPipInstall to return environment (PythonEnvironment), exported PythonEnvironment interface, and updated startServer to use environment.sysPrefix for VIRTUAL_ENV instead of manual path.dirname derivation (#DH-21980)
…cription in PipServerController constructor. Subscribe to API onDidChangePackages event. When deephaven-server installed or removed, call syncManagedServers with forceCheck true to update canStartServer status.

Added onDidChangePackages subscription in PipServerController constructor. Subscribes to the API event after activation, detects deephaven-server install/remove changes, and calls syncManagedServers with forceCheck true. (#DH-21980)
…for new Python Environments API integration. Test getPythonInterpreterPath with mocked new API. Test checkPipInstall with mocked getPackages. Follow existing test patterns in codebase.

Created PipServerController.spec.ts with 12 tests covering getPythonInterpreterPath (null when extension absent/env absent, returns path when active/inactive) and checkPipInstall (unsupported platform, no interpreter, no extension, no env, missing package, no packages, deephaven-server present). All mocking getPythonEnvsExtensionApi from ../util. All 12 tests pass. (#DH-21980)
… extension requirement and update related docs. Check if getMsPythonExtensionApi is still used anywhere. Update comments mentioning ms-python.python API. Consider adding note about new extension requirement to README or workspace-setup docs.

Removed unused getMsPythonExtensionApi function, MsPythonExtensionApi interface, and MS_PYTHON_EXTENSION_ID constant from extensionApiUtils.ts. Updated JSDoc comment in PipServerController.ts to reference Python Environments extension. Added Python Environments extension requirement note to docs/workspace-setup.md. (#DH-21980)
@bmingles bmingles force-pushed the DH-21980_python-managed-servers branch from 8b9f992 to 6e4f7db Compare March 18, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant