Adopt package manager command classes - #1686
Open
edvilme wants to merge 6 commits into
Open
Conversation
This was referenced Jul 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Pip/UV, Conda, and Poetry package manager call sites to the newer package-manager command class layer (introduced in #1621), and removes older helper utilities/tests that those call sites depended on.
Changes:
- Replaces ad-hoc command construction/execution with concrete command classes for Pip/UV, Conda, and Poetry.
- Refactors Pip/Conda/Poetry package manager flows to use command objects (including progress + cancellation wiring).
- Removes superseded parsing/execution utilities and replaces related unit tests with command-focused tests.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/managers/poetry/commands.unit.test.ts | Adds Poetry command smoke tests (currently mostly “does not reject”). |
| src/test/managers/conda/commands.unit.test.ts | Adds Conda command smoke tests (currently mostly “does not reject”). |
| src/test/managers/builtin/commands.unit.test.ts | Adds Pip/UV command smoke tests (currently mostly “does not reject”). |
| src/test/managers/builtin/pipVersions.unit.test.ts | Removes tests for the old pip-index-versions parsing helper. |
| src/test/managers/builtin/pipListUtils.unit.test.ts | Removes tests for the old pip list / uv tree parsing helpers. |
| src/managers/poetry/poetryPackageManager.ts | Switches Poetry package operations to command classes; refactors Poetry cwd selection into helper. |
| src/managers/conda/condaUtils.ts | Removes superseded managePackages() helper. |
| src/managers/conda/condaPackageManager.ts | Switches Conda package operations/list/version/available-versions to command classes. |
| src/managers/builtin/utils.ts | Adds parsePackageSpecs() helper and removes older pip-related utility functions from this module. |
| src/managers/builtin/pipUtils.ts | Switches installed-package enumeration to command classes; removes isPipInstallCommand(). |
| src/managers/builtin/pipPackageManager.ts | Switches pip/uv operations to command classes; refactors available versions and direct-name listing. |
| src/managers/builtin/pipListUtils.ts | Deletes the old pip list / uv tree parsing module. |
| src/managers/builtin/helpers.ts | Adjusts logging behavior for python stderr output. |
| package-lock.json | Lockfile update (tslib metadata change). |
- pipPackageManager.manage(): rethrow CancellationError instead of swallowing it, so callers (e.g. venv creation's pkgInstallationCancelled) can distinguish cancel from failure; restores parity with main and the conda/poetry managers. - getDirectPackageNames: fix docstring to reflect uv uses 'uv pip tree --depth=0' (not 'uv pip list --not-required'). - parsePackageSpecs: omit undefined version property and clarify wording. - runPython: restore 'python:' prefix on stderr log output for consistency. - Remove overlapping command smoke tests; the reworked, parsed-value versions are owned by the tests PR (#1677). Co-authored-by: Copilot <[email protected]> Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
Public-API-driven integration test exercising install/list/direct-deps/uninstall for every discovered package manager, parametrized over environments grouped by managerId so future managers are covered automatically. Consolidated into this PR per review preference rather than a separate PR. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
Add a capability-guarded available-versions step to the package manager roundtrip integration test. Uses an optional cast so it compiles and runs regardless of whether the active API build surfaces the getter, and skips the assertion for managers that resolve to undefined. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
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.
Summary
Adopts the package manager command classes introduced in #1621 across Pip/UV, Conda, and Poetry.
Changes
managerId, so future managers are covered automatically. The available-versions step is capability-guarded so it runs when the API surfacesgetPackageAvailableVersionsand skips gracefully otherwise.Relationship
maindirectly and depends only on the already-merged command classes (Introduce package manager command classes #1621). Independent of the smoke-tests PR Add package manager command smoke tests #1677.main.Testing
npm run compile-testsnpm run unittest(1,475 passing)npm run integration-test.