You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Added
11
11
12
-
- Added the optional `PackageManager.createForProject` factory for package managers whose operations depend on the calling Python project.
12
+
- Added the optional `PackageManager.createForProject` factory for package managers whose operations depend on the calling Python project. Explicit project contexts are used directly; environment-only operations use a scoped manager only when exactly one tracked project matches.
Copy file name to clipboardExpand all lines: docs/README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1621,6 +1621,44 @@ Reports and changes the packages of an environment.
1621
1621
|`formatInstallSpec(packageName, version)`|`(packageName: string, version: string) => string`| No | Formats a pinned specifier for this tool, for example `requests==2.31.0` for pip or `requests=2.31.0` for conda. Callers default to `name==version` when absent. |
1622
1622
|`onDidChangePackages`|`Event<DidChangePackagesEventArgs>`| No | Fire when packages change. |
1623
1623
1624
+
##### Project-scoped package managers
1625
+
1626
+
Implement `createForProject` when package operations depend on project files or
1627
+
the process working directory, as they do for tools such as Poetry. Callers that
1628
+
already have a `PythonProject` use that project directly. For environment-only
1629
+
operations, the extension selects a project-scoped manager only when exactly one
1630
+
tracked project uses the environment; it does not choose arbitrarily when no
1631
+
project or multiple projects match.
1632
+
1633
+
Environment-only command and API paths may still use the originally registered
1634
+
manager as an unbound fallback, while package views can suppress operations when
1635
+
there is no unique project. Project-sensitive methods on the root manager must
1636
+
therefore fail clearly or report that data is unavailable rather than running
1637
+
from the extension host's working directory. Keep project-specific caches and
1638
+
mutable state on the manager returned by `createForProject`.
0 commit comments