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: docs/design.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
2
2
# Python Environments API
3
-
The following helps describe the technical design of the Python Environments Extension for use mainly by contributing extension authors. This extension is the entry point which will surface the entire environment management experience for Python in VS Code and its modularity should allow for individual tools / libraries to implement these methods for their tool making them usable in VS Code.
3
+
The following guide describes the technical design of the Python Environments Extension. Its intended use is mainly for contributing extension authors. This extension is the entry point which will surface the entire environment management experience for Python in VS Code and its modularity should allow for individual tools / libraries to implement these methods for their tool making them usable in VS Code.
4
4
5
5
6
6
**Table of Contents**
@@ -21,7 +21,7 @@ The following helps describe the technical design of the Python Environments Ext
21
21
22
22
23
23
## Functionalities of Extension & its API
24
-
The python environment extension has four main functionalities:
24
+
The Python Environments extension has four main functionalities:
25
25
- getting / setting environments (including the packages found in them)
26
26
- terminal activation
27
27
- code execution
@@ -37,16 +37,16 @@ The python environment extension has four main functionalities:
37
37
38
38
## Objects in Extension API
39
39
The core components are as follows:
40
-
-`PythonEnvironment`: a python environment
40
+
-`PythonEnvironment`: a python environment (created using `createPythonEnvironmentItem`)
41
41
- Has unique id and correlates to a `EnvironmentManager`
42
42
- Contains `PythonEnvironmentExecutionInfo`
43
43
-`EnvironmentManager`: an object which manages `PythonEnvironment`
44
-
- registered by an extension in form with id `<publisher-id>.<extension-id>:<manager-name>`
44
+
- registered by an extension in form with id `<publisher-id>.<extension-id>:<manager-name>` (id is generated internally by extension)
45
45
- acts on an environment (get, set, etc) `PythonEnvironment`
46
46
- one `EnvironmentManager` can create many `PythonEnvironment` objects
47
47
-`PackageManagementOptions`: actions relating to, and specifying packages
48
48
-`PackageManager`: an object which manages packages
49
-
- registered by an extension in form with id `<publisher-id>.<extension-id>:<manager-name>`
49
+
- registered by an extension in form with id `<publisher-id>.<extension-id>:<manager-name>` (Id is generated internally by the extension)
50
50
- performs actions for packages using `PackageManagementOptions`
51
51
52
52
@@ -56,7 +56,7 @@ Generally in the extension, the PackageManagers and EnvironmentManagers handle t
56
56
57
57
### Workspace and Environments
58
58
The relationship between **workspaces** and **environments** in the extension can be any of the following configurations:
59
-
|workspace|environment|description|example|
59
+
|Workspace|Environment|Description|Example|
60
60
| -------- | ------- | -------- | ------- |
61
61
| 1 | 1 | single workspace, single environment | simplest, think Django app in a workspace |
62
62
| 1 | n | single workspace, multiple environments | one workspace with a client and server which have diff envs OR monorepo with multiple environments |
@@ -90,8 +90,10 @@ A `PackageManager` provides a variety of action which can be taken on an environ
90
90
91
91
| EnvironmentManager | PackageManager |
92
92
| -------- | ------- |
93
-
| venv | pip |
93
+
| venv | pip/uv|
94
94
| conda | conda |
95
+
| pyenv | pip/uv |
96
+
| poetry | poetry |
95
97
96
98
97
99
Note two things in the table, a given python tool like conda can be both a `EnvironmentManager` and a `PackageManager`. Secondly an `EnvironmentManager`'s preferred `PackageManager` is an opinionated selection made by the manager's author but can be overruled in specific package actions (ie install packageA using into envA using packageManager X). For the default `EnvironmentManager` (venv) the default `PackageManager` is `pip`.
0 commit comments