@vscode/python-environments 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +37 -0
- package/SECURITY.md +41 -0
- package/out/main.d.ts +1152 -0
- package/out/main.js +54 -0
- package/package.json +41 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @vscode/python-environments
|
|
2
|
+
|
|
3
|
+
This package provides type declarations and a helper to access the API exposed by the [Python Environments](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs) extension for VS Code.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install the package and add an `extensionDependencies` entry in your extension's `package.json`:
|
|
8
|
+
|
|
9
|
+
```jsonc
|
|
10
|
+
// package.json
|
|
11
|
+
{
|
|
12
|
+
"extensionDependencies": ["ms-python.vscode-python-envs"]
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. Install the npm package:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npm install @vscode/python-environments
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3. Import and use the API in your extension:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { PythonEnvironments } from '@vscode/python-environments';
|
|
26
|
+
|
|
27
|
+
export async function activate() {
|
|
28
|
+
const api = await PythonEnvironments.api();
|
|
29
|
+
|
|
30
|
+
// Get all discovered environments
|
|
31
|
+
const envs = await api.getEnvironments('all');
|
|
32
|
+
for (const env of envs) {
|
|
33
|
+
console.log(env.displayName, env.version);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.3 BLOCK -->
|
|
2
|
+
|
|
3
|
+
## Security
|
|
4
|
+
|
|
5
|
+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
|
6
|
+
|
|
7
|
+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](<https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)>) of a security vulnerability, please report it to us as described below.
|
|
8
|
+
|
|
9
|
+
## Reporting Security Issues
|
|
10
|
+
|
|
11
|
+
**Please do not report security vulnerabilities through public GitHub issues.**
|
|
12
|
+
|
|
13
|
+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
|
|
14
|
+
|
|
15
|
+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
|
|
16
|
+
|
|
17
|
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
|
18
|
+
|
|
19
|
+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
|
20
|
+
|
|
21
|
+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
22
|
+
- Full paths of source file(s) related to the manifestation of the issue
|
|
23
|
+
- The location of the affected source code (tag/branch/commit or direct URL)
|
|
24
|
+
- Any special configuration required to reproduce the issue
|
|
25
|
+
- Step-by-step instructions to reproduce the issue
|
|
26
|
+
- Proof-of-concept or exploit code (if possible)
|
|
27
|
+
- Impact of the issue, including how an attacker might exploit the issue
|
|
28
|
+
|
|
29
|
+
This information will help us triage your report more quickly.
|
|
30
|
+
|
|
31
|
+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
|
|
32
|
+
|
|
33
|
+
## Preferred Languages
|
|
34
|
+
|
|
35
|
+
We prefer all communications to be in English.
|
|
36
|
+
|
|
37
|
+
## Policy
|
|
38
|
+
|
|
39
|
+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
|
|
40
|
+
|
|
41
|
+
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
package/out/main.d.ts
ADDED
|
@@ -0,0 +1,1152 @@
|
|
|
1
|
+
import { Disposable, Event, FileChangeType, LogOutputChannel, MarkdownString, TaskExecution, Terminal, TerminalOptions, ThemeIcon, Uri } from 'vscode';
|
|
2
|
+
/**
|
|
3
|
+
* The path to an icon, or a theme-specific configuration of icons.
|
|
4
|
+
*/
|
|
5
|
+
export type IconPath = Uri | {
|
|
6
|
+
/**
|
|
7
|
+
* The icon path for the light theme.
|
|
8
|
+
*/
|
|
9
|
+
light: Uri;
|
|
10
|
+
/**
|
|
11
|
+
* The icon path for the dark theme.
|
|
12
|
+
*/
|
|
13
|
+
dark: Uri;
|
|
14
|
+
} | ThemeIcon;
|
|
15
|
+
/**
|
|
16
|
+
* Options for executing a Python executable.
|
|
17
|
+
*/
|
|
18
|
+
export interface PythonCommandRunConfiguration {
|
|
19
|
+
/**
|
|
20
|
+
* Path to the binary like `python.exe` or `python3` to execute. This should be an absolute path
|
|
21
|
+
* to an executable that can be spawned.
|
|
22
|
+
*/
|
|
23
|
+
executable: string;
|
|
24
|
+
/**
|
|
25
|
+
* Arguments to pass to the python executable. These arguments will be passed on all execute calls.
|
|
26
|
+
* This is intended for cases where you might want to do interpreter specific flags.
|
|
27
|
+
*/
|
|
28
|
+
args?: string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Contains details on how to use a particular python environment
|
|
32
|
+
*
|
|
33
|
+
* Running In Terminal:
|
|
34
|
+
* 1. If {@link PythonEnvironmentExecutionInfo.activatedRun} is provided, then that will be used.
|
|
35
|
+
* 2. If {@link PythonEnvironmentExecutionInfo.activatedRun} is not provided, then:
|
|
36
|
+
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is known, then that will be used.
|
|
37
|
+
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is not known, then:
|
|
38
|
+
* - 'unknown' will be used if provided.
|
|
39
|
+
* - {@link PythonEnvironmentExecutionInfo.activation} will be used otherwise.
|
|
40
|
+
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is not provided, then {@link PythonEnvironmentExecutionInfo.activation} will be used.
|
|
41
|
+
* - If {@link PythonEnvironmentExecutionInfo.activation} is not provided, then {@link PythonEnvironmentExecutionInfo.run} will be used.
|
|
42
|
+
*
|
|
43
|
+
* Creating a Terminal:
|
|
44
|
+
* 1. If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is known, then that will be used.
|
|
45
|
+
* 2. If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is not known, then {@link PythonEnvironmentExecutionInfo.activation} will be used.
|
|
46
|
+
* 3. If {@link PythonEnvironmentExecutionInfo.shellActivation} is not provided, then:
|
|
47
|
+
* - 'unknown' will be used if provided.
|
|
48
|
+
* - {@link PythonEnvironmentExecutionInfo.activation} will be used otherwise.
|
|
49
|
+
* 4. If {@link PythonEnvironmentExecutionInfo.activation} is not provided, then {@link PythonEnvironmentExecutionInfo.run} will be used.
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
export interface PythonEnvironmentExecutionInfo {
|
|
53
|
+
/**
|
|
54
|
+
* Details on how to run the python executable.
|
|
55
|
+
*/
|
|
56
|
+
run: PythonCommandRunConfiguration;
|
|
57
|
+
/**
|
|
58
|
+
* Details on how to run the python executable after activating the environment.
|
|
59
|
+
* If set this will overrides the {@link PythonEnvironmentExecutionInfo.run} command.
|
|
60
|
+
*/
|
|
61
|
+
activatedRun?: PythonCommandRunConfiguration;
|
|
62
|
+
/**
|
|
63
|
+
* Details on how to activate an environment.
|
|
64
|
+
*/
|
|
65
|
+
activation?: PythonCommandRunConfiguration[];
|
|
66
|
+
/**
|
|
67
|
+
* Details on how to activate an environment using a shell specific command.
|
|
68
|
+
* If set this will override the {@link PythonEnvironmentExecutionInfo.activation}.
|
|
69
|
+
* 'unknown' is used if shell type is not known.
|
|
70
|
+
* If 'unknown' is not provided and shell type is not known then
|
|
71
|
+
* {@link PythonEnvironmentExecutionInfo.activation} if set.
|
|
72
|
+
*/
|
|
73
|
+
shellActivation?: Map<string, PythonCommandRunConfiguration[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Details on how to deactivate an environment.
|
|
76
|
+
*/
|
|
77
|
+
deactivation?: PythonCommandRunConfiguration[];
|
|
78
|
+
/**
|
|
79
|
+
* Details on how to deactivate an environment using a shell specific command.
|
|
80
|
+
* If set this will override the {@link PythonEnvironmentExecutionInfo.deactivation} property.
|
|
81
|
+
* 'unknown' is used if shell type is not known.
|
|
82
|
+
* If 'unknown' is not provided and shell type is not known then
|
|
83
|
+
* {@link PythonEnvironmentExecutionInfo.deactivation} if set.
|
|
84
|
+
*/
|
|
85
|
+
shellDeactivation?: Map<string, PythonCommandRunConfiguration[]>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Interface representing the ID of a Python environment.
|
|
89
|
+
*/
|
|
90
|
+
export interface PythonEnvironmentId {
|
|
91
|
+
/**
|
|
92
|
+
* The unique identifier of the Python environment.
|
|
93
|
+
*/
|
|
94
|
+
id: string;
|
|
95
|
+
/**
|
|
96
|
+
* The ID of the manager responsible for the Python environment.
|
|
97
|
+
*/
|
|
98
|
+
managerId: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Display information for an environment group.
|
|
102
|
+
*/
|
|
103
|
+
export interface EnvironmentGroupInfo {
|
|
104
|
+
/**
|
|
105
|
+
* The name of the environment group. This is used as an identifier for the group.
|
|
106
|
+
*
|
|
107
|
+
* Note: The first instance of the group with the given name will be used in the UI.
|
|
108
|
+
*/
|
|
109
|
+
readonly name: string;
|
|
110
|
+
/**
|
|
111
|
+
* The description of the environment group.
|
|
112
|
+
*/
|
|
113
|
+
readonly description?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The tooltip for the environment group, which can be a string or a Markdown string.
|
|
116
|
+
*/
|
|
117
|
+
readonly tooltip?: string | MarkdownString;
|
|
118
|
+
/**
|
|
119
|
+
* The icon path for the environment group, which can be a string, Uri, or an object with light and dark theme paths.
|
|
120
|
+
*/
|
|
121
|
+
readonly iconPath?: IconPath;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Interface representing information about a Python environment.
|
|
125
|
+
*/
|
|
126
|
+
export interface PythonEnvironmentInfo {
|
|
127
|
+
/**
|
|
128
|
+
* The name of the Python environment.
|
|
129
|
+
*/
|
|
130
|
+
readonly name: string;
|
|
131
|
+
/**
|
|
132
|
+
* The display name of the Python environment.
|
|
133
|
+
*/
|
|
134
|
+
readonly displayName: string;
|
|
135
|
+
/**
|
|
136
|
+
* The short display name of the Python environment.
|
|
137
|
+
*/
|
|
138
|
+
readonly shortDisplayName?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The display path of the Python environment.
|
|
141
|
+
*/
|
|
142
|
+
readonly displayPath: string;
|
|
143
|
+
/**
|
|
144
|
+
* The version of the Python environment.
|
|
145
|
+
*/
|
|
146
|
+
readonly version: string;
|
|
147
|
+
/**
|
|
148
|
+
* Path to the python binary or environment folder.
|
|
149
|
+
*/
|
|
150
|
+
readonly environmentPath: Uri;
|
|
151
|
+
/**
|
|
152
|
+
* The description of the Python environment.
|
|
153
|
+
*/
|
|
154
|
+
readonly description?: string;
|
|
155
|
+
/**
|
|
156
|
+
* The tooltip for the Python environment, which can be a string or a Markdown string.
|
|
157
|
+
*/
|
|
158
|
+
readonly tooltip?: string | MarkdownString;
|
|
159
|
+
/**
|
|
160
|
+
* The icon path for the Python environment, which can be a string, Uri, or an object with light and dark theme paths.
|
|
161
|
+
*/
|
|
162
|
+
readonly iconPath?: IconPath;
|
|
163
|
+
/**
|
|
164
|
+
* Information on how to execute the Python environment. This is required for executing Python code in the environment.
|
|
165
|
+
*/
|
|
166
|
+
readonly execInfo: PythonEnvironmentExecutionInfo;
|
|
167
|
+
/**
|
|
168
|
+
* `sys.prefix` is the path to the base directory of the Python installation. Typically obtained by executing `sys.prefix` in the Python interpreter.
|
|
169
|
+
* This is required by extension like Jupyter, Pylance, and other extensions to provide better experience with python.
|
|
170
|
+
*/
|
|
171
|
+
readonly sysPrefix: string;
|
|
172
|
+
/**
|
|
173
|
+
* Optional `group` for this environment. This is used to group environments in the Environment Manager UI.
|
|
174
|
+
*/
|
|
175
|
+
readonly group?: string | EnvironmentGroupInfo;
|
|
176
|
+
/**
|
|
177
|
+
* Error message if the environment is broken or invalid.
|
|
178
|
+
* When set, indicates this environment has issues (e.g., broken symlinks, missing Python executable).
|
|
179
|
+
* The UI should display a warning indicator and show this message to help users diagnose and fix the issue.
|
|
180
|
+
*/
|
|
181
|
+
readonly error?: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Interface representing a Python environment.
|
|
185
|
+
*/
|
|
186
|
+
export interface PythonEnvironment extends PythonEnvironmentInfo {
|
|
187
|
+
/**
|
|
188
|
+
* The ID of the Python environment.
|
|
189
|
+
*/
|
|
190
|
+
readonly envId: PythonEnvironmentId;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Type representing the scope for setting a Python environment.
|
|
194
|
+
* Can be undefined or a URI.
|
|
195
|
+
*/
|
|
196
|
+
export type SetEnvironmentScope = undefined | Uri | Uri[];
|
|
197
|
+
/**
|
|
198
|
+
* Type representing the scope for getting a Python environment.
|
|
199
|
+
* Can be undefined or a URI.
|
|
200
|
+
*/
|
|
201
|
+
export type GetEnvironmentScope = undefined | Uri;
|
|
202
|
+
/**
|
|
203
|
+
* Type representing the scope for creating a Python environment.
|
|
204
|
+
* Can be a Python project or 'global'.
|
|
205
|
+
*/
|
|
206
|
+
export type CreateEnvironmentScope = Uri | Uri[] | 'global';
|
|
207
|
+
/**
|
|
208
|
+
* The scope for which environments are to be refreshed.
|
|
209
|
+
* - `undefined`: Search for environments globally and workspaces.
|
|
210
|
+
* - {@link Uri}: Environments in the workspace/folder or associated with the Uri.
|
|
211
|
+
*/
|
|
212
|
+
export type RefreshEnvironmentsScope = Uri | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* The scope for which environments are required.
|
|
215
|
+
* - `"all"`: All environments.
|
|
216
|
+
* - `"global"`: Python installations that are usually a base for creating virtual environments.
|
|
217
|
+
* - {@link Uri}: Environments for the workspace/folder/file pointed to by the Uri.
|
|
218
|
+
*/
|
|
219
|
+
export type GetEnvironmentsScope = Uri | 'all' | 'global';
|
|
220
|
+
/**
|
|
221
|
+
* Event arguments for when the current Python environment changes.
|
|
222
|
+
*/
|
|
223
|
+
export type DidChangeEnvironmentEventArgs = {
|
|
224
|
+
/**
|
|
225
|
+
* The URI of the environment that changed.
|
|
226
|
+
*/
|
|
227
|
+
readonly uri: Uri | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* The old Python environment before the change.
|
|
230
|
+
*/
|
|
231
|
+
readonly old: PythonEnvironment | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* The new Python environment after the change.
|
|
234
|
+
*/
|
|
235
|
+
readonly new: PythonEnvironment | undefined;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Enum representing the kinds of environment changes.
|
|
239
|
+
*/
|
|
240
|
+
export declare enum EnvironmentChangeKind {
|
|
241
|
+
/**
|
|
242
|
+
* Indicates that an environment was added.
|
|
243
|
+
*/
|
|
244
|
+
add = "add",
|
|
245
|
+
/**
|
|
246
|
+
* Indicates that an environment was removed.
|
|
247
|
+
*/
|
|
248
|
+
remove = "remove"
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Event arguments for when the list of Python environments changes.
|
|
252
|
+
*/
|
|
253
|
+
export type DidChangeEnvironmentsEventArgs = {
|
|
254
|
+
/**
|
|
255
|
+
* The kind of change that occurred (add or remove).
|
|
256
|
+
*/
|
|
257
|
+
kind: EnvironmentChangeKind;
|
|
258
|
+
/**
|
|
259
|
+
* The Python environment that was added or removed.
|
|
260
|
+
*/
|
|
261
|
+
environment: PythonEnvironment;
|
|
262
|
+
}[];
|
|
263
|
+
/**
|
|
264
|
+
* Type representing the context for resolving a Python environment.
|
|
265
|
+
*/
|
|
266
|
+
export type ResolveEnvironmentContext = Uri;
|
|
267
|
+
export interface QuickCreateConfig {
|
|
268
|
+
/**
|
|
269
|
+
* The description of the quick create step.
|
|
270
|
+
*/
|
|
271
|
+
readonly description: string;
|
|
272
|
+
/**
|
|
273
|
+
* The detail of the quick create step.
|
|
274
|
+
*/
|
|
275
|
+
readonly detail?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Interface representing an environment manager.
|
|
279
|
+
*
|
|
280
|
+
* @remarks
|
|
281
|
+
* Methods on this interface are invoked both by the Python Environments extension itself
|
|
282
|
+
* (in response to UI actions, startup, terminal activation, script execution, and so on)
|
|
283
|
+
* and directly by other extensions that consume the published API. Any "called when…"
|
|
284
|
+
* notes on individual methods list representative triggers only — they are not
|
|
285
|
+
* exhaustive, and the precise set of call sites may evolve over time. Implementations
|
|
286
|
+
* should focus on the documented contract rather than any specific caller.
|
|
287
|
+
*/
|
|
288
|
+
export interface EnvironmentManager {
|
|
289
|
+
/**
|
|
290
|
+
* The name of the environment manager. Allowed characters (a-z, A-Z, 0-9, -, _).
|
|
291
|
+
*/
|
|
292
|
+
readonly name: string;
|
|
293
|
+
/**
|
|
294
|
+
* The display name of the environment manager.
|
|
295
|
+
*/
|
|
296
|
+
readonly displayName?: string;
|
|
297
|
+
/**
|
|
298
|
+
* The preferred package manager ID for the environment manager. This is a combination
|
|
299
|
+
* of publisher id, extension id, and {@link EnvironmentManager.name package manager name}.
|
|
300
|
+
* `<publisher-id>.<extension-id>:<package-manager-name>`
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* 'ms-python.python:pip'
|
|
304
|
+
*/
|
|
305
|
+
readonly preferredPackageManagerId: string;
|
|
306
|
+
/**
|
|
307
|
+
* The description of the environment manager.
|
|
308
|
+
*/
|
|
309
|
+
readonly description?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The tooltip for the environment manager, which can be a string or a Markdown string.
|
|
312
|
+
*/
|
|
313
|
+
readonly tooltip?: string | MarkdownString | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* The icon path for the environment manager, which can be a string, Uri, or an object with light and dark theme paths.
|
|
316
|
+
*/
|
|
317
|
+
readonly iconPath?: IconPath;
|
|
318
|
+
/**
|
|
319
|
+
* The log output channel for the environment manager.
|
|
320
|
+
*/
|
|
321
|
+
readonly log?: LogOutputChannel;
|
|
322
|
+
/**
|
|
323
|
+
* The quick create details for the environment manager. Having this method also enables the quick create feature
|
|
324
|
+
* for the environment manager. Should Implement {@link EnvironmentManager.create} to support quick create.
|
|
325
|
+
*/
|
|
326
|
+
quickCreateConfig?(): QuickCreateConfig | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* Creates a new Python environment within the specified scope. Create should support adding a .gitignore file if it creates a folder within the workspace. If a manager does not support environment creation, do not implement this method; the UI disables "create" options when `this.manager.create === undefined`.
|
|
329
|
+
* @param scope - The scope within which to create the environment.
|
|
330
|
+
* @param options - Optional parameters for creating the Python environment.
|
|
331
|
+
* @returns A promise that resolves to the created Python environment, or undefined if creation failed.
|
|
332
|
+
*
|
|
333
|
+
* @remarks
|
|
334
|
+
* Invoked when an environment of this manager's type should be created for the given
|
|
335
|
+
* scope. Typical triggers include user-initiated environment-creation flows and
|
|
336
|
+
* programmatic creation via the API.
|
|
337
|
+
*/
|
|
338
|
+
create?(scope: CreateEnvironmentScope, options?: CreateEnvironmentOptions): Promise<PythonEnvironment | undefined>;
|
|
339
|
+
/**
|
|
340
|
+
* Removes the specified Python environment.
|
|
341
|
+
* @param environment - The Python environment to remove.
|
|
342
|
+
* @returns A promise that resolves when the environment is removed.
|
|
343
|
+
*
|
|
344
|
+
* @remarks
|
|
345
|
+
* Invoked to delete the given environment. Typical triggers include an explicit user
|
|
346
|
+
* action (such as a "Delete Environment" command) and programmatic removal via the API.
|
|
347
|
+
*/
|
|
348
|
+
remove?(environment: PythonEnvironment): Promise<void>;
|
|
349
|
+
/**
|
|
350
|
+
* Refreshes the list of Python environments within the specified scope.
|
|
351
|
+
* @param scope - The scope within which to refresh environments.
|
|
352
|
+
* @returns A promise that resolves when the refresh is complete.
|
|
353
|
+
*
|
|
354
|
+
* @remarks
|
|
355
|
+
* Forces the manager to re-discover environments for the given scope. Typically
|
|
356
|
+
* triggered by an explicit user "refresh" action.
|
|
357
|
+
*/
|
|
358
|
+
refresh(scope: RefreshEnvironmentsScope): Promise<void>;
|
|
359
|
+
/**
|
|
360
|
+
* Retrieves a list of Python environments within the specified scope.
|
|
361
|
+
* @param scope - The scope within which to retrieve environments.
|
|
362
|
+
* @returns A promise that resolves to an array of Python environments.
|
|
363
|
+
*
|
|
364
|
+
* @remarks
|
|
365
|
+
* Returns the environments known to this manager for the given scope. Called
|
|
366
|
+
* frequently by UI surfaces (tree views, pickers) and by other consumers of the API.
|
|
367
|
+
*/
|
|
368
|
+
getEnvironments(scope: GetEnvironmentsScope): Promise<PythonEnvironment[]>;
|
|
369
|
+
/**
|
|
370
|
+
* Event that is fired when the list of Python environments changes.
|
|
371
|
+
*/
|
|
372
|
+
onDidChangeEnvironments?: Event<DidChangeEnvironmentsEventArgs>;
|
|
373
|
+
/**
|
|
374
|
+
* Sets the current Python environment within the specified scope.
|
|
375
|
+
* @param scope - The scope within which to set the environment.
|
|
376
|
+
* @param environment - The Python environment to set. If undefined, the environment is unset.
|
|
377
|
+
* @returns A promise that resolves when the environment is set.
|
|
378
|
+
*
|
|
379
|
+
* @remarks
|
|
380
|
+
* Invoked when the active environment for the given scope should change — for example
|
|
381
|
+
* after the user selects an environment in a picker, after a newly created environment
|
|
382
|
+
* is auto-selected, or programmatically via the API.
|
|
383
|
+
*
|
|
384
|
+
* Also invoked at extension startup to rehydrate the active environment from
|
|
385
|
+
* persisted state.
|
|
386
|
+
*/
|
|
387
|
+
set(scope: SetEnvironmentScope, environment?: PythonEnvironment): Promise<void>;
|
|
388
|
+
/**
|
|
389
|
+
* Retrieves the current Python environment within the specified scope.
|
|
390
|
+
* @param scope - The scope within which to retrieve the environment.
|
|
391
|
+
* @returns A promise that resolves to the current Python environment, or undefined if none is set.
|
|
392
|
+
*
|
|
393
|
+
* @remarks
|
|
394
|
+
* Returns the currently active environment for the given scope, or `undefined` if
|
|
395
|
+
* none is selected. Called very frequently — at startup, after {@link set}, when a
|
|
396
|
+
* terminal is opened, before running Python, by UI surfaces that display the active
|
|
397
|
+
* interpreter, and by other extensions consuming the API.
|
|
398
|
+
*/
|
|
399
|
+
get(scope: GetEnvironmentScope): Promise<PythonEnvironment | undefined>;
|
|
400
|
+
/**
|
|
401
|
+
* Event that is fired when the current Python environment changes.
|
|
402
|
+
*/
|
|
403
|
+
onDidChangeEnvironment?: Event<DidChangeEnvironmentEventArgs>;
|
|
404
|
+
/**
|
|
405
|
+
* Resolves the specified Python environment. The environment can be either a {@link PythonEnvironment} or a {@link Uri} context.
|
|
406
|
+
*
|
|
407
|
+
* This method is used to obtain a fully detailed {@link PythonEnvironment} object. The input can be:
|
|
408
|
+
* - A {@link PythonEnvironment} object, which might be missing key details such as {@link PythonEnvironment.execInfo}.
|
|
409
|
+
* - A {@link Uri} object, which typically represents either:
|
|
410
|
+
* - A folder that contains the Python environment.
|
|
411
|
+
* - The path to a Python executable.
|
|
412
|
+
*
|
|
413
|
+
* @param context - The context for resolving the environment, which can be a {@link PythonEnvironment} or a {@link Uri}.
|
|
414
|
+
* @returns A promise that resolves to the fully detailed {@link PythonEnvironment}, or `undefined` if the environment cannot be resolved.
|
|
415
|
+
*
|
|
416
|
+
* @remarks
|
|
417
|
+
* Called to turn a lightly-populated {@link PythonEnvironment} or a {@link Uri}
|
|
418
|
+
* pointing at an interpreter or environment folder into a fully-populated
|
|
419
|
+
* {@link PythonEnvironment} with complete {@link PythonEnvironment.execInfo}. Typical
|
|
420
|
+
* triggers include the user manually selecting an interpreter path, resolving
|
|
421
|
+
* `python.defaultInterpreterPath` at startup, and populating execution details before
|
|
422
|
+
* launching Python.
|
|
423
|
+
*/
|
|
424
|
+
resolve(context: ResolveEnvironmentContext): Promise<PythonEnvironment | undefined>;
|
|
425
|
+
/**
|
|
426
|
+
* Clears the environment manager's cache.
|
|
427
|
+
*
|
|
428
|
+
* @returns A promise that resolves when the cache is cleared.
|
|
429
|
+
*
|
|
430
|
+
* @remarks
|
|
431
|
+
* Drops any cached environment data held by the manager so that subsequent calls to
|
|
432
|
+
* {@link EnvironmentManager.getEnvironments} or {@link EnvironmentManager.get}
|
|
433
|
+
* re-discover state from disk. Typically triggered by an explicit user "clear cache"
|
|
434
|
+
* action.
|
|
435
|
+
*/
|
|
436
|
+
clearCache?(): Promise<void>;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Interface representing a package ID.
|
|
440
|
+
*/
|
|
441
|
+
export interface PackageId {
|
|
442
|
+
/**
|
|
443
|
+
* The ID of the package.
|
|
444
|
+
*/
|
|
445
|
+
id: string;
|
|
446
|
+
/**
|
|
447
|
+
* The ID of the package manager.
|
|
448
|
+
*/
|
|
449
|
+
managerId: string;
|
|
450
|
+
/**
|
|
451
|
+
* The ID of the environment in which the package is installed.
|
|
452
|
+
*/
|
|
453
|
+
environmentId: string;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Interface representing package information.
|
|
457
|
+
*/
|
|
458
|
+
export interface PackageInfo {
|
|
459
|
+
/**
|
|
460
|
+
* The name of the package.
|
|
461
|
+
*/
|
|
462
|
+
readonly name: string;
|
|
463
|
+
/**
|
|
464
|
+
* The display name of the package.
|
|
465
|
+
*/
|
|
466
|
+
readonly displayName: string;
|
|
467
|
+
/**
|
|
468
|
+
* The version of the package.
|
|
469
|
+
*/
|
|
470
|
+
readonly version?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The description of the package.
|
|
473
|
+
*/
|
|
474
|
+
readonly description?: string;
|
|
475
|
+
/**
|
|
476
|
+
* The tooltip for the package, which can be a string or a Markdown string.
|
|
477
|
+
*/
|
|
478
|
+
readonly tooltip?: string | MarkdownString | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* The icon path for the package, which can be a string, Uri, or an object with light and dark theme paths.
|
|
481
|
+
*/
|
|
482
|
+
readonly iconPath?: IconPath;
|
|
483
|
+
/**
|
|
484
|
+
* The URIs associated with the package.
|
|
485
|
+
*/
|
|
486
|
+
readonly uris?: readonly Uri[];
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Interface representing a package.
|
|
490
|
+
*/
|
|
491
|
+
export interface Package extends PackageInfo {
|
|
492
|
+
/**
|
|
493
|
+
* The ID of the package.
|
|
494
|
+
*/
|
|
495
|
+
readonly pkgId: PackageId;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Enum representing the kinds of package changes.
|
|
499
|
+
*/
|
|
500
|
+
export declare enum PackageChangeKind {
|
|
501
|
+
/**
|
|
502
|
+
* Indicates that a package was added.
|
|
503
|
+
*/
|
|
504
|
+
add = "add",
|
|
505
|
+
/**
|
|
506
|
+
* Indicates that a package was removed.
|
|
507
|
+
*/
|
|
508
|
+
remove = "remove"
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Event arguments for when packages change.
|
|
512
|
+
*/
|
|
513
|
+
export interface DidChangePackagesEventArgs {
|
|
514
|
+
/**
|
|
515
|
+
* The Python environment in which the packages changed.
|
|
516
|
+
*/
|
|
517
|
+
environment: PythonEnvironment;
|
|
518
|
+
/**
|
|
519
|
+
* The package manager responsible for the changes.
|
|
520
|
+
*/
|
|
521
|
+
manager: PackageManager;
|
|
522
|
+
/**
|
|
523
|
+
* The list of changes, each containing the kind of change and the package affected.
|
|
524
|
+
*/
|
|
525
|
+
changes: {
|
|
526
|
+
kind: PackageChangeKind;
|
|
527
|
+
pkg: Package;
|
|
528
|
+
}[];
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Interface representing a package manager.
|
|
532
|
+
*/
|
|
533
|
+
export interface PackageManager {
|
|
534
|
+
/**
|
|
535
|
+
* The name of the package manager. Allowed characters (a-z, A-Z, 0-9, -, _).
|
|
536
|
+
*/
|
|
537
|
+
name: string;
|
|
538
|
+
/**
|
|
539
|
+
* The display name of the package manager.
|
|
540
|
+
*/
|
|
541
|
+
displayName?: string;
|
|
542
|
+
/**
|
|
543
|
+
* The description of the package manager.
|
|
544
|
+
*/
|
|
545
|
+
description?: string;
|
|
546
|
+
/**
|
|
547
|
+
* The tooltip for the package manager, which can be a string or a Markdown string.
|
|
548
|
+
*/
|
|
549
|
+
tooltip?: string | MarkdownString | undefined;
|
|
550
|
+
/**
|
|
551
|
+
* The icon path for the package manager, which can be a string, Uri, or an object with light and dark theme paths.
|
|
552
|
+
*/
|
|
553
|
+
iconPath?: IconPath;
|
|
554
|
+
/**
|
|
555
|
+
* The log output channel for the package manager.
|
|
556
|
+
*/
|
|
557
|
+
log?: LogOutputChannel;
|
|
558
|
+
/**
|
|
559
|
+
* Installs/Uninstall packages in the specified Python environment.
|
|
560
|
+
* @param environment - The Python environment in which to install packages.
|
|
561
|
+
* @param options - Options for managing packages.
|
|
562
|
+
* @returns A promise that resolves when the installation is complete.
|
|
563
|
+
*/
|
|
564
|
+
manage(environment: PythonEnvironment, options: PackageManagementOptions): Promise<void>;
|
|
565
|
+
/**
|
|
566
|
+
* Refreshes the package list for the specified Python environment.
|
|
567
|
+
* @param environment - The Python environment for which to refresh the package list.
|
|
568
|
+
* @returns A promise that resolves when the refresh is complete.
|
|
569
|
+
*/
|
|
570
|
+
refresh(environment: PythonEnvironment): Promise<void>;
|
|
571
|
+
/**
|
|
572
|
+
* Retrieves the list of packages for the specified Python environment.
|
|
573
|
+
* @param environment - The Python environment for which to retrieve packages.
|
|
574
|
+
* @returns An array of packages, or undefined if the packages could not be retrieved.
|
|
575
|
+
*/
|
|
576
|
+
getPackages(environment: PythonEnvironment): Promise<Package[] | undefined>;
|
|
577
|
+
/**
|
|
578
|
+
* Event that is fired when packages change.
|
|
579
|
+
*/
|
|
580
|
+
onDidChangePackages?: Event<DidChangePackagesEventArgs>;
|
|
581
|
+
/**
|
|
582
|
+
* Clears the package manager's cache.
|
|
583
|
+
* @returns A promise that resolves when the cache is cleared.
|
|
584
|
+
*/
|
|
585
|
+
clearCache?(): Promise<void>;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Interface representing a Python project.
|
|
589
|
+
*/
|
|
590
|
+
export interface PythonProject {
|
|
591
|
+
/**
|
|
592
|
+
* The name of the Python project.
|
|
593
|
+
*/
|
|
594
|
+
readonly name: string;
|
|
595
|
+
/**
|
|
596
|
+
* The URI of the Python project.
|
|
597
|
+
*/
|
|
598
|
+
readonly uri: Uri;
|
|
599
|
+
/**
|
|
600
|
+
* The description of the Python project.
|
|
601
|
+
*/
|
|
602
|
+
readonly description?: string;
|
|
603
|
+
/**
|
|
604
|
+
* The tooltip for the Python project, which can be a string or a Markdown string.
|
|
605
|
+
*/
|
|
606
|
+
readonly tooltip?: string | MarkdownString;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Options for creating a Python project.
|
|
610
|
+
*/
|
|
611
|
+
export interface PythonProjectCreatorOptions {
|
|
612
|
+
/**
|
|
613
|
+
* The name of the Python project.
|
|
614
|
+
*/
|
|
615
|
+
name: string;
|
|
616
|
+
/**
|
|
617
|
+
* Path provided as the root for the project.
|
|
618
|
+
*/
|
|
619
|
+
rootUri: Uri;
|
|
620
|
+
/**
|
|
621
|
+
* Boolean indicating whether the project should be created without any user input.
|
|
622
|
+
*/
|
|
623
|
+
quickCreate?: boolean;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Interface representing a creator for Python projects.
|
|
627
|
+
*/
|
|
628
|
+
export interface PythonProjectCreator {
|
|
629
|
+
/**
|
|
630
|
+
* The name of the Python project creator.
|
|
631
|
+
*/
|
|
632
|
+
readonly name: string;
|
|
633
|
+
/**
|
|
634
|
+
* The display name of the Python project creator.
|
|
635
|
+
*/
|
|
636
|
+
readonly displayName?: string;
|
|
637
|
+
/**
|
|
638
|
+
* The description of the Python project creator.
|
|
639
|
+
*/
|
|
640
|
+
readonly description?: string;
|
|
641
|
+
/**
|
|
642
|
+
* The tooltip for the Python project creator, which can be a string or a Markdown string.
|
|
643
|
+
*/
|
|
644
|
+
readonly tooltip?: string | MarkdownString;
|
|
645
|
+
/**
|
|
646
|
+
* Creates a new Python project(s) or, if files are not a project, returns Uri(s) to the created files.
|
|
647
|
+
* Anything that needs its own python environment constitutes a project.
|
|
648
|
+
* @param options Optional parameters for creating the Python project.
|
|
649
|
+
* @returns A promise that resolves to one of the following:
|
|
650
|
+
* - PythonProject or PythonProject[]: when a single or multiple projects are created.
|
|
651
|
+
* - Uri or Uri[]: when files are created that do not constitute a project.
|
|
652
|
+
* - undefined: if project creation fails.
|
|
653
|
+
*/
|
|
654
|
+
create(options?: PythonProjectCreatorOptions): Promise<PythonProject | PythonProject[] | Uri | Uri[] | undefined>;
|
|
655
|
+
/**
|
|
656
|
+
* A flag indicating whether the project creator supports quick create where no user input is required.
|
|
657
|
+
*/
|
|
658
|
+
readonly supportsQuickCreate?: boolean;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Event arguments for when Python projects change.
|
|
662
|
+
*/
|
|
663
|
+
export interface DidChangePythonProjectsEventArgs {
|
|
664
|
+
/**
|
|
665
|
+
* The list of Python projects that were added.
|
|
666
|
+
*/
|
|
667
|
+
added: PythonProject[];
|
|
668
|
+
/**
|
|
669
|
+
* The list of Python projects that were removed.
|
|
670
|
+
*/
|
|
671
|
+
removed: PythonProject[];
|
|
672
|
+
}
|
|
673
|
+
export type PackageManagementOptions = {
|
|
674
|
+
/**
|
|
675
|
+
* Upgrade the packages if they are already installed.
|
|
676
|
+
*/
|
|
677
|
+
upgrade?: boolean;
|
|
678
|
+
/**
|
|
679
|
+
* Show option to skip package installation or uninstallation.
|
|
680
|
+
*/
|
|
681
|
+
showSkipOption?: boolean;
|
|
682
|
+
/**
|
|
683
|
+
* The list of packages to install.
|
|
684
|
+
*/
|
|
685
|
+
install: string[];
|
|
686
|
+
/**
|
|
687
|
+
* The list of packages to uninstall.
|
|
688
|
+
*/
|
|
689
|
+
uninstall?: string[];
|
|
690
|
+
} | {
|
|
691
|
+
/**
|
|
692
|
+
* Upgrade the packages if they are already installed.
|
|
693
|
+
*/
|
|
694
|
+
upgrade?: boolean;
|
|
695
|
+
/**
|
|
696
|
+
* Show option to skip package installation or uninstallation.
|
|
697
|
+
*/
|
|
698
|
+
showSkipOption?: boolean;
|
|
699
|
+
/**
|
|
700
|
+
* The list of packages to install.
|
|
701
|
+
*/
|
|
702
|
+
install?: string[];
|
|
703
|
+
/**
|
|
704
|
+
* The list of packages to uninstall.
|
|
705
|
+
*/
|
|
706
|
+
uninstall: string[];
|
|
707
|
+
};
|
|
708
|
+
/**
|
|
709
|
+
* Options for creating a Python environment.
|
|
710
|
+
*/
|
|
711
|
+
export interface CreateEnvironmentOptions {
|
|
712
|
+
/**
|
|
713
|
+
* Provides some context about quick create based on user input.
|
|
714
|
+
* - if true, the environment should be created without any user input or prompts.
|
|
715
|
+
* - if false, the environment creation can show user input or prompts.
|
|
716
|
+
* This also means user explicitly skipped the quick create option.
|
|
717
|
+
* - if undefined, the environment creation can show user input or prompts.
|
|
718
|
+
* You can show quick create option to the user if you support it.
|
|
719
|
+
*/
|
|
720
|
+
quickCreate?: boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Packages to install in addition to the automatically picked packages as a part of creating environment.
|
|
723
|
+
*/
|
|
724
|
+
additionalPackages?: string[];
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Object representing the process started using run in background API.
|
|
728
|
+
*/
|
|
729
|
+
export interface PythonProcess {
|
|
730
|
+
/**
|
|
731
|
+
* The process ID of the Python process.
|
|
732
|
+
*/
|
|
733
|
+
readonly pid?: number;
|
|
734
|
+
/**
|
|
735
|
+
* The standard input of the Python process.
|
|
736
|
+
*/
|
|
737
|
+
readonly stdin: NodeJS.WritableStream;
|
|
738
|
+
/**
|
|
739
|
+
* The standard output of the Python process.
|
|
740
|
+
*/
|
|
741
|
+
readonly stdout: NodeJS.ReadableStream;
|
|
742
|
+
/**
|
|
743
|
+
* The standard error of the Python process.
|
|
744
|
+
*/
|
|
745
|
+
readonly stderr: NodeJS.ReadableStream;
|
|
746
|
+
/**
|
|
747
|
+
* Kills the Python process.
|
|
748
|
+
*/
|
|
749
|
+
kill(): void;
|
|
750
|
+
/**
|
|
751
|
+
* Event that is fired when the Python process exits.
|
|
752
|
+
*/
|
|
753
|
+
onExit(listener: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
754
|
+
}
|
|
755
|
+
export interface PythonEnvironmentManagerRegistrationApi {
|
|
756
|
+
/**
|
|
757
|
+
* Register an environment manager implementation.
|
|
758
|
+
*
|
|
759
|
+
* @param manager Environment Manager implementation to register.
|
|
760
|
+
* @param options Optional registration options.
|
|
761
|
+
* @param options.extensionId The extension ID of the calling extension. This is used as a fallback when
|
|
762
|
+
* automatic extension detection fails, such as during F5 debugging where the extension's file path
|
|
763
|
+
* does not contain its marketplace ID. If automatic detection succeeds, this value is ignored.
|
|
764
|
+
* @returns A disposable that can be used to unregister the environment manager.
|
|
765
|
+
* @see {@link EnvironmentManager}
|
|
766
|
+
*/
|
|
767
|
+
registerEnvironmentManager(manager: EnvironmentManager, options?: {
|
|
768
|
+
extensionId?: string;
|
|
769
|
+
}): Disposable;
|
|
770
|
+
}
|
|
771
|
+
export interface PythonEnvironmentItemApi {
|
|
772
|
+
/**
|
|
773
|
+
* Create a Python environment item from the provided environment info. This item is used to interact
|
|
774
|
+
* with the environment.
|
|
775
|
+
*
|
|
776
|
+
* @param info Some details about the environment like name, version, etc. needed to interact with the environment.
|
|
777
|
+
* @param manager The environment manager to associate with the environment.
|
|
778
|
+
* @returns The Python environment.
|
|
779
|
+
*/
|
|
780
|
+
createPythonEnvironmentItem(info: PythonEnvironmentInfo, manager: EnvironmentManager): PythonEnvironment;
|
|
781
|
+
}
|
|
782
|
+
export interface PythonEnvironmentManagementApi {
|
|
783
|
+
/**
|
|
784
|
+
* Create a Python environment using environment manager associated with the scope.
|
|
785
|
+
*
|
|
786
|
+
* @param scope Where the environment is to be created.
|
|
787
|
+
* @param options Optional parameters for creating the Python environment.
|
|
788
|
+
* @returns The Python environment created. `undefined` if not created.
|
|
789
|
+
*/
|
|
790
|
+
createEnvironment(scope: CreateEnvironmentScope, options?: CreateEnvironmentOptions): Promise<PythonEnvironment | undefined>;
|
|
791
|
+
/**
|
|
792
|
+
* Remove a Python environment.
|
|
793
|
+
*
|
|
794
|
+
* @param environment The Python environment to remove.
|
|
795
|
+
* @returns A promise that resolves when the environment has been removed.
|
|
796
|
+
*/
|
|
797
|
+
removeEnvironment(environment: PythonEnvironment): Promise<void>;
|
|
798
|
+
}
|
|
799
|
+
export interface PythonEnvironmentsApi {
|
|
800
|
+
/**
|
|
801
|
+
* Initiates a refresh of Python environments within the specified scope.
|
|
802
|
+
* @param scope - The scope within which to search for environments.
|
|
803
|
+
* @returns A promise that resolves when the search is complete.
|
|
804
|
+
*/
|
|
805
|
+
refreshEnvironments(scope: RefreshEnvironmentsScope): Promise<void>;
|
|
806
|
+
/**
|
|
807
|
+
* Retrieves a list of Python environments within the specified scope.
|
|
808
|
+
* @param scope - The scope within which to retrieve environments.
|
|
809
|
+
* @returns A promise that resolves to an array of Python environments.
|
|
810
|
+
*/
|
|
811
|
+
getEnvironments(scope: GetEnvironmentsScope): Promise<PythonEnvironment[]>;
|
|
812
|
+
/**
|
|
813
|
+
* Event that is fired when the list of Python environments changes.
|
|
814
|
+
* @see {@link DidChangeEnvironmentsEventArgs}
|
|
815
|
+
*/
|
|
816
|
+
onDidChangeEnvironments: Event<DidChangeEnvironmentsEventArgs>;
|
|
817
|
+
/**
|
|
818
|
+
* This method is used to get the details missing from a PythonEnvironment. Like
|
|
819
|
+
* {@link PythonEnvironment.execInfo} and other details.
|
|
820
|
+
*
|
|
821
|
+
* @param context : The PythonEnvironment or Uri for which details are required.
|
|
822
|
+
*/
|
|
823
|
+
resolveEnvironment(context: ResolveEnvironmentContext): Promise<PythonEnvironment | undefined>;
|
|
824
|
+
}
|
|
825
|
+
export interface PythonProjectEnvironmentApi {
|
|
826
|
+
/**
|
|
827
|
+
* Sets the current Python environment within the specified scope.
|
|
828
|
+
* @param scope - The scope within which to set the environment.
|
|
829
|
+
* @param environment - The Python environment to set. If undefined, the environment is unset.
|
|
830
|
+
*/
|
|
831
|
+
setEnvironment(scope: SetEnvironmentScope, environment?: PythonEnvironment): Promise<void>;
|
|
832
|
+
/**
|
|
833
|
+
* Retrieves the current Python environment within the specified scope.
|
|
834
|
+
* @param scope - The scope within which to retrieve the environment.
|
|
835
|
+
* @returns A promise that resolves to the current Python environment, or undefined if none is set.
|
|
836
|
+
*/
|
|
837
|
+
getEnvironment(scope: GetEnvironmentScope): Promise<PythonEnvironment | undefined>;
|
|
838
|
+
/**
|
|
839
|
+
* Event that is fired when the selected Python environment changes for Project, Folder or File.
|
|
840
|
+
* @see {@link DidChangeEnvironmentEventArgs}
|
|
841
|
+
*/
|
|
842
|
+
onDidChangeEnvironment: Event<DidChangeEnvironmentEventArgs>;
|
|
843
|
+
}
|
|
844
|
+
export interface PythonEnvironmentManagerApi extends PythonEnvironmentManagerRegistrationApi, PythonEnvironmentItemApi, PythonEnvironmentManagementApi, PythonEnvironmentsApi, PythonProjectEnvironmentApi {
|
|
845
|
+
}
|
|
846
|
+
export interface PythonPackageManagerRegistrationApi {
|
|
847
|
+
/**
|
|
848
|
+
* Register a package manager implementation.
|
|
849
|
+
*
|
|
850
|
+
* @param manager Package Manager implementation to register.
|
|
851
|
+
* @param options Optional registration options.
|
|
852
|
+
* @param options.extensionId The extension ID of the calling extension. This is used as a fallback when
|
|
853
|
+
* automatic extension detection fails, such as during F5 debugging where the extension's file path
|
|
854
|
+
* does not contain its marketplace ID. If automatic detection succeeds, this value is ignored.
|
|
855
|
+
* @returns A disposable that can be used to unregister the package manager.
|
|
856
|
+
* @see {@link PackageManager}
|
|
857
|
+
*/
|
|
858
|
+
registerPackageManager(manager: PackageManager, options?: {
|
|
859
|
+
extensionId?: string;
|
|
860
|
+
}): Disposable;
|
|
861
|
+
}
|
|
862
|
+
export interface PythonPackageGetterApi {
|
|
863
|
+
/**
|
|
864
|
+
* Refresh the list of packages in a Python Environment.
|
|
865
|
+
*
|
|
866
|
+
* @param environment The Python Environment for which the list of packages is to be refreshed.
|
|
867
|
+
* @returns A promise that resolves when the list of packages has been refreshed.
|
|
868
|
+
*/
|
|
869
|
+
refreshPackages(environment: PythonEnvironment): Promise<void>;
|
|
870
|
+
/**
|
|
871
|
+
* Get the list of packages in a Python Environment.
|
|
872
|
+
*
|
|
873
|
+
* @param environment The Python Environment for which the list of packages is required.
|
|
874
|
+
* @returns The list of packages in the Python Environment.
|
|
875
|
+
*/
|
|
876
|
+
getPackages(environment: PythonEnvironment): Promise<Package[] | undefined>;
|
|
877
|
+
/**
|
|
878
|
+
* Event raised when the list of packages in a Python Environment changes.
|
|
879
|
+
* @see {@link DidChangePackagesEventArgs}
|
|
880
|
+
*/
|
|
881
|
+
onDidChangePackages: Event<DidChangePackagesEventArgs>;
|
|
882
|
+
}
|
|
883
|
+
export interface PythonPackageItemApi {
|
|
884
|
+
/**
|
|
885
|
+
* Create a package item from the provided package info.
|
|
886
|
+
*
|
|
887
|
+
* @param info The package info.
|
|
888
|
+
* @param environment The Python Environment in which the package is installed.
|
|
889
|
+
* @param manager The package manager that installed the package.
|
|
890
|
+
* @returns The package item.
|
|
891
|
+
*/
|
|
892
|
+
createPackageItem(info: PackageInfo, environment: PythonEnvironment, manager: PackageManager): Package;
|
|
893
|
+
}
|
|
894
|
+
export interface PythonPackageManagementApi {
|
|
895
|
+
/**
|
|
896
|
+
* Install/Uninstall packages into a Python Environment.
|
|
897
|
+
*
|
|
898
|
+
* @param environment The Python Environment into which packages are to be installed.
|
|
899
|
+
* @param packages The packages to install.
|
|
900
|
+
* @param options Options for installing packages.
|
|
901
|
+
*/
|
|
902
|
+
managePackages(environment: PythonEnvironment, options: PackageManagementOptions): Promise<void>;
|
|
903
|
+
}
|
|
904
|
+
export interface PythonPackageManagerApi extends PythonPackageManagerRegistrationApi, PythonPackageGetterApi, PythonPackageManagementApi, PythonPackageItemApi {
|
|
905
|
+
}
|
|
906
|
+
export interface PythonProjectCreationApi {
|
|
907
|
+
/**
|
|
908
|
+
* Register a Python project creator.
|
|
909
|
+
*
|
|
910
|
+
* @param creator The project creator to register.
|
|
911
|
+
* @returns A disposable that can be used to unregister the project creator.
|
|
912
|
+
* @see {@link PythonProjectCreator}
|
|
913
|
+
*/
|
|
914
|
+
registerPythonProjectCreator(creator: PythonProjectCreator): Disposable;
|
|
915
|
+
}
|
|
916
|
+
export interface PythonProjectGetterApi {
|
|
917
|
+
/**
|
|
918
|
+
* Get all python projects.
|
|
919
|
+
*/
|
|
920
|
+
getPythonProjects(): readonly PythonProject[];
|
|
921
|
+
/**
|
|
922
|
+
* Get the python project for a given URI.
|
|
923
|
+
*
|
|
924
|
+
* @param uri The URI of the project
|
|
925
|
+
* @returns The project or `undefined` if not found.
|
|
926
|
+
*/
|
|
927
|
+
getPythonProject(uri: Uri): PythonProject | undefined;
|
|
928
|
+
}
|
|
929
|
+
export interface PythonProjectModifyApi {
|
|
930
|
+
/**
|
|
931
|
+
* Add a python project or projects to the list of projects.
|
|
932
|
+
*
|
|
933
|
+
* @param projects The project or projects to add.
|
|
934
|
+
*/
|
|
935
|
+
addPythonProject(projects: PythonProject | PythonProject[]): void;
|
|
936
|
+
/**
|
|
937
|
+
* Remove a python project from the list of projects.
|
|
938
|
+
*
|
|
939
|
+
* @param project The project to remove.
|
|
940
|
+
*/
|
|
941
|
+
removePythonProject(project: PythonProject): void;
|
|
942
|
+
/**
|
|
943
|
+
* Event raised when python projects are added or removed.
|
|
944
|
+
* @see {@link DidChangePythonProjectsEventArgs}
|
|
945
|
+
*/
|
|
946
|
+
onDidChangePythonProjects: Event<DidChangePythonProjectsEventArgs>;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* The API for interacting with Python projects. A project in python is any folder or file that is a contained
|
|
950
|
+
* in some manner. For example, a PEP-723 compliant file can be treated as a project. A folder with a `pyproject.toml`,
|
|
951
|
+
* or just python files can be treated as a project. All this allows you to do is set a python environment for that project.
|
|
952
|
+
*
|
|
953
|
+
* By default all `vscode.workspace.workspaceFolders` are treated as projects.
|
|
954
|
+
*/
|
|
955
|
+
export interface PythonProjectApi extends PythonProjectCreationApi, PythonProjectGetterApi, PythonProjectModifyApi {
|
|
956
|
+
}
|
|
957
|
+
export interface PythonTerminalCreateOptions extends TerminalOptions {
|
|
958
|
+
/**
|
|
959
|
+
* Whether to disable activation on create.
|
|
960
|
+
*/
|
|
961
|
+
disableActivation?: boolean;
|
|
962
|
+
}
|
|
963
|
+
export interface PythonTerminalCreateApi {
|
|
964
|
+
/**
|
|
965
|
+
* Creates a terminal and activates any (activatable) environment for the terminal.
|
|
966
|
+
*
|
|
967
|
+
* @param environment The Python environment to activate.
|
|
968
|
+
* @param options Options for creating the terminal.
|
|
969
|
+
*
|
|
970
|
+
* Note: Non-activatable environments have no effect on the terminal.
|
|
971
|
+
*/
|
|
972
|
+
createTerminal(environment: PythonEnvironment, options: PythonTerminalCreateOptions): Promise<Terminal>;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Options for running a Python script or module in a terminal.
|
|
976
|
+
*
|
|
977
|
+
* Example:
|
|
978
|
+
* * Running Script: `python myscript.py --arg1`
|
|
979
|
+
* ```typescript
|
|
980
|
+
* {
|
|
981
|
+
* args: ["myscript.py", "--arg1"]
|
|
982
|
+
* }
|
|
983
|
+
* ```
|
|
984
|
+
* * Running a module: `python -m my_module --arg1`
|
|
985
|
+
* ```typescript
|
|
986
|
+
* {
|
|
987
|
+
* args: ["-m", "my_module", "--arg1"]
|
|
988
|
+
* }
|
|
989
|
+
* ```
|
|
990
|
+
*/
|
|
991
|
+
export interface PythonTerminalExecutionOptions {
|
|
992
|
+
/**
|
|
993
|
+
* Current working directory for the terminal. This in only used to create the terminal.
|
|
994
|
+
*/
|
|
995
|
+
cwd: string | Uri;
|
|
996
|
+
/**
|
|
997
|
+
* Arguments to pass to the python executable.
|
|
998
|
+
*/
|
|
999
|
+
args?: string[];
|
|
1000
|
+
/**
|
|
1001
|
+
* Set `true` to show the terminal.
|
|
1002
|
+
*/
|
|
1003
|
+
show?: boolean;
|
|
1004
|
+
}
|
|
1005
|
+
export interface PythonTerminalRunApi {
|
|
1006
|
+
/**
|
|
1007
|
+
* Runs a Python script or module in a terminal. This API will create a terminal if one is not available to use.
|
|
1008
|
+
* If a terminal is available, it will be used to run the script or module.
|
|
1009
|
+
*
|
|
1010
|
+
* Note:
|
|
1011
|
+
* - If you restart VS Code, this will create a new terminal, this is a limitation of VS Code.
|
|
1012
|
+
* - If you close the terminal, this will create a new terminal.
|
|
1013
|
+
* - In cases of multi-root/project scenario, it will create a separate terminal for each project.
|
|
1014
|
+
*/
|
|
1015
|
+
runInTerminal(environment: PythonEnvironment, options: PythonTerminalExecutionOptions): Promise<Terminal>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Runs a Python script or module in a dedicated terminal. This API will create a terminal if one is not available to use.
|
|
1018
|
+
* If a terminal is available, it will be used to run the script or module. This terminal will be dedicated to the script,
|
|
1019
|
+
* and selected based on the `terminalKey`.
|
|
1020
|
+
*
|
|
1021
|
+
* @param terminalKey A unique key to identify the terminal. For scripts you can use the Uri of the script file.
|
|
1022
|
+
*/
|
|
1023
|
+
runInDedicatedTerminal(terminalKey: Uri | string, environment: PythonEnvironment, options: PythonTerminalExecutionOptions): Promise<Terminal>;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Options for running a Python task.
|
|
1027
|
+
*
|
|
1028
|
+
* Example:
|
|
1029
|
+
* * Running Script: `python myscript.py --arg1`
|
|
1030
|
+
* ```typescript
|
|
1031
|
+
* {
|
|
1032
|
+
* args: ["myscript.py", "--arg1"]
|
|
1033
|
+
* }
|
|
1034
|
+
* ```
|
|
1035
|
+
* * Running a module: `python -m my_module --arg1`
|
|
1036
|
+
* ```typescript
|
|
1037
|
+
* {
|
|
1038
|
+
* args: ["-m", "my_module", "--arg1"]
|
|
1039
|
+
* }
|
|
1040
|
+
* ```
|
|
1041
|
+
*/
|
|
1042
|
+
export interface PythonTaskExecutionOptions {
|
|
1043
|
+
/**
|
|
1044
|
+
* Name of the task to run.
|
|
1045
|
+
*/
|
|
1046
|
+
name: string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Arguments to pass to the python executable.
|
|
1049
|
+
*/
|
|
1050
|
+
args: string[];
|
|
1051
|
+
/**
|
|
1052
|
+
* The Python project to use for the task.
|
|
1053
|
+
*/
|
|
1054
|
+
project?: PythonProject;
|
|
1055
|
+
/**
|
|
1056
|
+
* Current working directory for the task. Default is the project directory for the script being run.
|
|
1057
|
+
*/
|
|
1058
|
+
cwd?: string;
|
|
1059
|
+
/**
|
|
1060
|
+
* Environment variables to set for the task.
|
|
1061
|
+
*/
|
|
1062
|
+
env?: {
|
|
1063
|
+
[key: string]: string;
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
export interface PythonTaskRunApi {
|
|
1067
|
+
/**
|
|
1068
|
+
* Run a Python script or module as a task.
|
|
1069
|
+
*
|
|
1070
|
+
*/
|
|
1071
|
+
runAsTask(environment: PythonEnvironment, options: PythonTaskExecutionOptions): Promise<TaskExecution>;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Options for running a Python script or module in the background.
|
|
1075
|
+
*/
|
|
1076
|
+
export interface PythonBackgroundRunOptions {
|
|
1077
|
+
/**
|
|
1078
|
+
* The Python environment to use for running the script or module.
|
|
1079
|
+
*/
|
|
1080
|
+
args: string[];
|
|
1081
|
+
/**
|
|
1082
|
+
* Current working directory for the script or module. Default is the project directory for the script being run.
|
|
1083
|
+
*/
|
|
1084
|
+
cwd?: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Environment variables to set for the script or module.
|
|
1087
|
+
*/
|
|
1088
|
+
env?: {
|
|
1089
|
+
[key: string]: string | undefined;
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
export interface PythonBackgroundRunApi {
|
|
1093
|
+
/**
|
|
1094
|
+
* Run a Python script or module in the background. This API will create a new process to run the script or module.
|
|
1095
|
+
*/
|
|
1096
|
+
runInBackground(environment: PythonEnvironment, options: PythonBackgroundRunOptions): Promise<PythonProcess>;
|
|
1097
|
+
}
|
|
1098
|
+
export interface PythonExecutionApi extends PythonTerminalCreateApi, PythonTerminalRunApi, PythonTaskRunApi, PythonBackgroundRunApi {
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Event arguments for when the monitored `.env` files or any other sources change.
|
|
1102
|
+
*/
|
|
1103
|
+
export interface DidChangeEnvironmentVariablesEventArgs {
|
|
1104
|
+
/**
|
|
1105
|
+
* The URI of the file that changed. No `Uri` means a non-file source of environment variables changed.
|
|
1106
|
+
*/
|
|
1107
|
+
uri?: Uri;
|
|
1108
|
+
/**
|
|
1109
|
+
* The type of change that occurred.
|
|
1110
|
+
*/
|
|
1111
|
+
changeType: FileChangeType;
|
|
1112
|
+
}
|
|
1113
|
+
export interface PythonEnvironmentVariablesApi {
|
|
1114
|
+
/**
|
|
1115
|
+
* Get environment variables for a workspace. This picks up `.env` file from the root of the
|
|
1116
|
+
* workspace.
|
|
1117
|
+
*
|
|
1118
|
+
* Order of overrides:
|
|
1119
|
+
* 1. `baseEnvVar` if given or `process.env`
|
|
1120
|
+
* 2. `.env` file from the "python.envFile" setting in the workspace.
|
|
1121
|
+
* 3. `.env` file at the root of the python project.
|
|
1122
|
+
* 4. `overrides` in the order provided.
|
|
1123
|
+
*
|
|
1124
|
+
* @param uri The URI of the project, workspace or a file in a for which environment variables are required.If not provided,
|
|
1125
|
+
* it fetches the environment variables for the global scope.
|
|
1126
|
+
* @param overrides Additional environment variables to override the defaults.
|
|
1127
|
+
* @param baseEnvVar The base environment variables that should be used as a starting point.
|
|
1128
|
+
*/
|
|
1129
|
+
getEnvironmentVariables(uri: Uri | undefined, overrides?: ({
|
|
1130
|
+
[key: string]: string | undefined;
|
|
1131
|
+
} | Uri)[], baseEnvVar?: {
|
|
1132
|
+
[key: string]: string | undefined;
|
|
1133
|
+
}): Promise<{
|
|
1134
|
+
[key: string]: string | undefined;
|
|
1135
|
+
}>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Event raised when `.env` file changes or any other monitored source of env variable changes.
|
|
1138
|
+
*/
|
|
1139
|
+
onDidChangeEnvironmentVariables: Event<DidChangeEnvironmentVariablesEventArgs>;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* The API for interacting with Python environments, package managers, and projects.
|
|
1143
|
+
*/
|
|
1144
|
+
export interface PythonEnvironmentApi extends PythonEnvironmentManagerApi, PythonPackageManagerApi, PythonProjectApi, PythonExecutionApi, PythonEnvironmentVariablesApi {
|
|
1145
|
+
}
|
|
1146
|
+
export declare const EXTENSION_ID = "ms-python.vscode-python-envs";
|
|
1147
|
+
export declare namespace PythonEnvironments {
|
|
1148
|
+
/**
|
|
1149
|
+
* Returns the API exposed by the Python Environments extension in VS Code.
|
|
1150
|
+
*/
|
|
1151
|
+
function api(): Promise<PythonEnvironmentApi>;
|
|
1152
|
+
}
|
package/out/main.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.PythonEnvironments = exports.EXTENSION_ID = exports.PackageChangeKind = exports.EnvironmentChangeKind = void 0;
|
|
6
|
+
const vscode_1 = require("vscode");
|
|
7
|
+
/**
|
|
8
|
+
* Enum representing the kinds of environment changes.
|
|
9
|
+
*/
|
|
10
|
+
var EnvironmentChangeKind;
|
|
11
|
+
(function (EnvironmentChangeKind) {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that an environment was added.
|
|
14
|
+
*/
|
|
15
|
+
EnvironmentChangeKind["add"] = "add";
|
|
16
|
+
/**
|
|
17
|
+
* Indicates that an environment was removed.
|
|
18
|
+
*/
|
|
19
|
+
EnvironmentChangeKind["remove"] = "remove";
|
|
20
|
+
})(EnvironmentChangeKind || (exports.EnvironmentChangeKind = EnvironmentChangeKind = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Enum representing the kinds of package changes.
|
|
23
|
+
*/
|
|
24
|
+
var PackageChangeKind;
|
|
25
|
+
(function (PackageChangeKind) {
|
|
26
|
+
/**
|
|
27
|
+
* Indicates that a package was added.
|
|
28
|
+
*/
|
|
29
|
+
PackageChangeKind["add"] = "add";
|
|
30
|
+
/**
|
|
31
|
+
* Indicates that a package was removed.
|
|
32
|
+
*/
|
|
33
|
+
PackageChangeKind["remove"] = "remove";
|
|
34
|
+
})(PackageChangeKind || (exports.PackageChangeKind = PackageChangeKind = {}));
|
|
35
|
+
exports.EXTENSION_ID = 'ms-python.vscode-python-envs';
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
37
|
+
var PythonEnvironments;
|
|
38
|
+
(function (PythonEnvironments) {
|
|
39
|
+
/**
|
|
40
|
+
* Returns the API exposed by the Python Environments extension in VS Code.
|
|
41
|
+
*/
|
|
42
|
+
async function api() {
|
|
43
|
+
const extension = vscode_1.extensions.getExtension(exports.EXTENSION_ID);
|
|
44
|
+
if (extension === undefined) {
|
|
45
|
+
throw new Error(`Python Environments extension is not installed or is disabled`);
|
|
46
|
+
}
|
|
47
|
+
if (!extension.isActive) {
|
|
48
|
+
await extension.activate();
|
|
49
|
+
}
|
|
50
|
+
const pythonEnvsApi = extension.exports;
|
|
51
|
+
return pythonEnvsApi;
|
|
52
|
+
}
|
|
53
|
+
PythonEnvironments.api = api;
|
|
54
|
+
})(PythonEnvironments || (exports.PythonEnvironments = PythonEnvironments = {}));
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vscode/python-environments",
|
|
3
|
+
"description": "An API facade for the Python Environments extension in VS Code",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Microsoft Corporation"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"Python",
|
|
10
|
+
"VSCode",
|
|
11
|
+
"API",
|
|
12
|
+
"Environments"
|
|
13
|
+
],
|
|
14
|
+
"main": "./out/main.js",
|
|
15
|
+
"types": "./out/main.d.ts",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22.21.1",
|
|
18
|
+
"vscode": "^1.110.0"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"homepage": "https://github.com/microsoft/vscode-python-environments/tree/main/api",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/microsoft/vscode-python-environments"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/microsoft/vscode-python-environments/issues"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node -e \"process.exitCode = 1\"",
|
|
31
|
+
"prepack": "npm run all:publish",
|
|
32
|
+
"all:publish": "git clean -xfd . && npm install && npm run compile",
|
|
33
|
+
"compile": "tsc -b ./tsconfig.json",
|
|
34
|
+
"clean": "node -e \"const fs = require('fs'); fs.rmSync('./out', { recursive: true, force: true });\""
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.0.0",
|
|
38
|
+
"@types/vscode": "^1.99.0",
|
|
39
|
+
"typescript": "^5.1.3"
|
|
40
|
+
}
|
|
41
|
+
}
|