Add project-scoped package managers - #1816
Eduardo Villalpando Mello (edvilme) wants to merge 8 commits into
Conversation
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
|
GitHub cannot anchor PR review comments to unchanged lines in the diff. Falling back to a general PR comment for src/managers/poetry/poetryPackageManager.ts:L184.
📍 src/managers/poetry/poetryPackageManager.ts:174 [unverified] |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
10dfab8 to
338bbb0
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unscoped terminal watchers fail for Poetry, project-scoped managers are not evicted, and one unbound management path does not reject as documented.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (3)
Resolved since last review (2)
Files not reviewed (1)
- api/package-lock.json: Generated file
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unbound environment-view operations now fail for Poetry, and symlinked project directories resolve to the wrong working directory.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (2)
Files not reviewed (1)
- api/package-lock.json: Generated file
…ssification Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
Result: Verification detailsVerification: Isolated verification observed failures that were not classified as caused by this PR: Dependency and test discovery. Summary: Dependencies installed offline and TypeScript test compilation passed. Three targeted Mocha runs covering 106 tests all passed, including project scoping, event forwarding, watchers, Poetry working directories, and unbound-manager behavior. The discovery command's Git probe failed because the sandbox lacked Git metadata, unrelated to the PR. Coverage is still missing for the newly changed `managePackageVersion` scoped-manager error path. Test runs: 5 passed, 1 failed
❌
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Result: Verification detailsVerification: Isolated verification observed failures that were not classified as caused by this PR: Sandbox and test discovery probe. Summary: Offline dependency setup and TypeScript test compilation succeeded. The targeted package-manager, event-forwarding, watcher, command, Poetry, and conformance tests passed, with the explicit targeted run reporting **107 passing**. The discovery probe only failed because the checkout lacked `HEAD^`, which is unrelated to the PR. Coverage is strong, but the new `managePackageVersion` project-required error path lacks a focused test. Test runs: 5 passed, 1 failed
❌
|
| const envManager = | ||
| view.parent.kind === EnvTreeItemKind.environmentGroup ? view.parent.parent.manager : view.parent.manager; | ||
| const pkgManager = managers?.getPackageManager(envManager.preferredPackageManagerId); | ||
| const pkgManager = managers?.resolvePackageManagerForEnvironment(view.environment).manager; |
There was a problem hiding this comment.
Issue · Please address or respond
When zero or multiple projects match a project-aware manager, this reduces projectRequired to undefined and silently skips refresh. Switch on resolution.kind and surface PackageManagerRequiresProjectError, consistent with the public API and package-management command paths.
[unverified]


Fixes #1779
Summary
Adds project-scoped package manager instances for package managers whose behavior depends on the active Python project. Instead of threading project context through every package operation, a provider can implement
PackageManager.createForProject(project)and return a manager bound to that project.Changes
PackageManager.createForProject(project)API.PythonProject:add,remove,show, andshow --top-levelrun from the project directory.manageandrefreshreject when Poetry is not project-bound.getPackagesandgetDirectPackageNamesreturnundefinedwhen Poetry is not project-bound.getVersionandformatInstallSpecremain available.Validation
npm run lintnpm run compile-testsnpm run unittest— 2,425 passing, 6 pending