@vscode/python-environments 1.3.0 → 1.4.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/CHANGELOG.md +6 -0
- package/README.md +17 -0
- package/out/cjs/main.cjs +23 -72
- package/out/cjs/publicErrors.js +55 -0
- package/out/cjs/types.js +33 -0
- package/out/esm/main.mjs +8 -69
- package/out/esm/package.json +1 -0
- package/out/esm/publicErrors.js +50 -0
- package/out/esm/types.js +30 -0
- package/out/types/main.d.ts +10 -0
- package/out/types/publicErrors.d.ts +31 -0
- package/out/{cjs/main.d.ts → types/types.d.ts} +16 -55
- package/package.json +10 -7
- package/out/esm/main.d.ts +0 -1316
package/out/esm/main.d.ts
DELETED
|
@@ -1,1316 +0,0 @@
|
|
|
1
|
-
import type { Pep440Version } from '@renovatebot/pep440';
|
|
2
|
-
import type { Disposable, Event, FileChangeType, LogOutputChannel, MarkdownString, RelativePattern, TaskExecution, Terminal, TerminalOptions, ThemeIcon, Uri } from 'vscode';
|
|
3
|
-
export type { Pep440Version } from '@renovatebot/pep440';
|
|
4
|
-
/**
|
|
5
|
-
* The path to an icon, or a theme-specific configuration of icons.
|
|
6
|
-
*/
|
|
7
|
-
export type IconPath = Uri | {
|
|
8
|
-
/**
|
|
9
|
-
* The icon path for the light theme.
|
|
10
|
-
*/
|
|
11
|
-
light: Uri;
|
|
12
|
-
/**
|
|
13
|
-
* The icon path for the dark theme.
|
|
14
|
-
*/
|
|
15
|
-
dark: Uri;
|
|
16
|
-
} | ThemeIcon;
|
|
17
|
-
/**
|
|
18
|
-
* Options for executing a Python executable.
|
|
19
|
-
*/
|
|
20
|
-
export interface PythonCommandRunConfiguration {
|
|
21
|
-
/**
|
|
22
|
-
* Path to the binary like `python.exe` or `python3` to execute. This should be an absolute path
|
|
23
|
-
* to an executable that can be spawned.
|
|
24
|
-
*/
|
|
25
|
-
executable: string;
|
|
26
|
-
/**
|
|
27
|
-
* Arguments to pass to the python executable. These arguments will be passed on all execute calls.
|
|
28
|
-
* This is intended for cases where you might want to do interpreter specific flags.
|
|
29
|
-
*/
|
|
30
|
-
args?: string[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Contains details on how to use a particular python environment
|
|
34
|
-
*
|
|
35
|
-
* Running In Terminal:
|
|
36
|
-
* 1. If {@link PythonEnvironmentExecutionInfo.activatedRun} is provided, then that will be used.
|
|
37
|
-
* 2. If {@link PythonEnvironmentExecutionInfo.activatedRun} is not provided, then:
|
|
38
|
-
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is known, then that will be used.
|
|
39
|
-
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is not known, then:
|
|
40
|
-
* - 'unknown' will be used if provided.
|
|
41
|
-
* - {@link PythonEnvironmentExecutionInfo.activation} will be used otherwise.
|
|
42
|
-
* - If {@link PythonEnvironmentExecutionInfo.shellActivation} is not provided, then {@link PythonEnvironmentExecutionInfo.activation} will be used.
|
|
43
|
-
* - If {@link PythonEnvironmentExecutionInfo.activation} is not provided, then {@link PythonEnvironmentExecutionInfo.run} will be used.
|
|
44
|
-
*
|
|
45
|
-
* Creating a Terminal:
|
|
46
|
-
* 1. If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is known, then that will be used.
|
|
47
|
-
* 2. If {@link PythonEnvironmentExecutionInfo.shellActivation} is provided and shell type is not known, then {@link PythonEnvironmentExecutionInfo.activation} will be used.
|
|
48
|
-
* 3. If {@link PythonEnvironmentExecutionInfo.shellActivation} is not provided, then:
|
|
49
|
-
* - 'unknown' will be used if provided.
|
|
50
|
-
* - {@link PythonEnvironmentExecutionInfo.activation} will be used otherwise.
|
|
51
|
-
* 4. If {@link PythonEnvironmentExecutionInfo.activation} is not provided, then {@link PythonEnvironmentExecutionInfo.run} will be used.
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
export interface PythonEnvironmentExecutionInfo {
|
|
55
|
-
/**
|
|
56
|
-
* Details on how to run the python executable.
|
|
57
|
-
*/
|
|
58
|
-
run: PythonCommandRunConfiguration;
|
|
59
|
-
/**
|
|
60
|
-
* Details on how to run the python executable after activating the environment.
|
|
61
|
-
* If set this will overrides the {@link PythonEnvironmentExecutionInfo.run} command.
|
|
62
|
-
*/
|
|
63
|
-
activatedRun?: PythonCommandRunConfiguration;
|
|
64
|
-
/**
|
|
65
|
-
* Details on how to activate an environment.
|
|
66
|
-
*/
|
|
67
|
-
activation?: PythonCommandRunConfiguration[];
|
|
68
|
-
/**
|
|
69
|
-
* Details on how to activate an environment using a shell specific command.
|
|
70
|
-
* If set this will override the {@link PythonEnvironmentExecutionInfo.activation}.
|
|
71
|
-
* 'unknown' is used if shell type is not known.
|
|
72
|
-
* If 'unknown' is not provided and shell type is not known then
|
|
73
|
-
* {@link PythonEnvironmentExecutionInfo.activation} if set.
|
|
74
|
-
*/
|
|
75
|
-
shellActivation?: Map<string, PythonCommandRunConfiguration[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Details on how to deactivate an environment.
|
|
78
|
-
*/
|
|
79
|
-
deactivation?: PythonCommandRunConfiguration[];
|
|
80
|
-
/**
|
|
81
|
-
* Details on how to deactivate an environment using a shell specific command.
|
|
82
|
-
* If set this will override the {@link PythonEnvironmentExecutionInfo.deactivation} property.
|
|
83
|
-
* 'unknown' is used if shell type is not known.
|
|
84
|
-
* If 'unknown' is not provided and shell type is not known then
|
|
85
|
-
* {@link PythonEnvironmentExecutionInfo.deactivation} if set.
|
|
86
|
-
*/
|
|
87
|
-
shellDeactivation?: Map<string, PythonCommandRunConfiguration[]>;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Interface representing the ID of a Python environment.
|
|
91
|
-
*/
|
|
92
|
-
export interface PythonEnvironmentId {
|
|
93
|
-
/**
|
|
94
|
-
* The unique identifier of the Python environment.
|
|
95
|
-
*/
|
|
96
|
-
id: string;
|
|
97
|
-
/**
|
|
98
|
-
* The ID of the manager responsible for the Python environment.
|
|
99
|
-
*/
|
|
100
|
-
managerId: string;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Display information for an environment group.
|
|
104
|
-
*/
|
|
105
|
-
export interface EnvironmentGroupInfo {
|
|
106
|
-
/**
|
|
107
|
-
* The name of the environment group. This is used as an identifier for the group.
|
|
108
|
-
*
|
|
109
|
-
* Note: The first instance of the group with the given name will be used in the UI.
|
|
110
|
-
*/
|
|
111
|
-
readonly name: string;
|
|
112
|
-
/**
|
|
113
|
-
* The description of the environment group.
|
|
114
|
-
*/
|
|
115
|
-
readonly description?: string;
|
|
116
|
-
/**
|
|
117
|
-
* The tooltip for the environment group, which can be a string or a Markdown string.
|
|
118
|
-
*/
|
|
119
|
-
readonly tooltip?: string | MarkdownString;
|
|
120
|
-
/**
|
|
121
|
-
* The icon path for the environment group, which can be a string, Uri, or an object with light and dark theme paths.
|
|
122
|
-
*/
|
|
123
|
-
readonly iconPath?: IconPath;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Interface representing information about a Python environment.
|
|
127
|
-
*/
|
|
128
|
-
export interface PythonEnvironmentInfo {
|
|
129
|
-
/**
|
|
130
|
-
* The name of the Python environment.
|
|
131
|
-
*/
|
|
132
|
-
readonly name: string;
|
|
133
|
-
/**
|
|
134
|
-
* The display name of the Python environment.
|
|
135
|
-
*/
|
|
136
|
-
readonly displayName: string;
|
|
137
|
-
/**
|
|
138
|
-
* The short display name of the Python environment.
|
|
139
|
-
*/
|
|
140
|
-
readonly shortDisplayName?: string;
|
|
141
|
-
/**
|
|
142
|
-
* The display path of the Python environment.
|
|
143
|
-
*/
|
|
144
|
-
readonly displayPath: string;
|
|
145
|
-
/**
|
|
146
|
-
* The version of the Python environment.
|
|
147
|
-
*/
|
|
148
|
-
readonly version: string;
|
|
149
|
-
/**
|
|
150
|
-
* Path to the python binary or environment folder.
|
|
151
|
-
*/
|
|
152
|
-
readonly environmentPath: Uri;
|
|
153
|
-
/**
|
|
154
|
-
* The description of the Python environment.
|
|
155
|
-
*/
|
|
156
|
-
readonly description?: string;
|
|
157
|
-
/**
|
|
158
|
-
* The tooltip for the Python environment, which can be a string or a Markdown string.
|
|
159
|
-
*/
|
|
160
|
-
readonly tooltip?: string | MarkdownString;
|
|
161
|
-
/**
|
|
162
|
-
* The icon path for the Python environment, which can be a string, Uri, or an object with light and dark theme paths.
|
|
163
|
-
*/
|
|
164
|
-
readonly iconPath?: IconPath;
|
|
165
|
-
/**
|
|
166
|
-
* Information on how to execute the Python environment. This is required for executing Python code in the environment.
|
|
167
|
-
*/
|
|
168
|
-
readonly execInfo: PythonEnvironmentExecutionInfo;
|
|
169
|
-
/**
|
|
170
|
-
* `sys.prefix` is the path to the base directory of the Python installation. Typically obtained by executing `sys.prefix` in the Python interpreter.
|
|
171
|
-
* This is required by extension like Jupyter, Pylance, and other extensions to provide better experience with python.
|
|
172
|
-
*/
|
|
173
|
-
readonly sysPrefix: string;
|
|
174
|
-
/**
|
|
175
|
-
* Optional `group` for this environment. This is used to group environments in the Environment Manager UI.
|
|
176
|
-
*/
|
|
177
|
-
readonly group?: string | EnvironmentGroupInfo;
|
|
178
|
-
/**
|
|
179
|
-
* Error message if the environment is broken or invalid.
|
|
180
|
-
* When set, indicates this environment has issues (e.g., broken symlinks, missing Python executable).
|
|
181
|
-
* The UI should display a warning indicator and show this message to help users diagnose and fix the issue.
|
|
182
|
-
*/
|
|
183
|
-
readonly error?: string;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Interface representing a Python environment.
|
|
187
|
-
*/
|
|
188
|
-
export interface PythonEnvironment extends PythonEnvironmentInfo {
|
|
189
|
-
/**
|
|
190
|
-
* The ID of the Python environment.
|
|
191
|
-
*/
|
|
192
|
-
readonly envId: PythonEnvironmentId;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Type representing the scope for setting a Python environment.
|
|
196
|
-
* Can be undefined or a URI.
|
|
197
|
-
*/
|
|
198
|
-
export type SetEnvironmentScope = undefined | Uri | Uri[];
|
|
199
|
-
/**
|
|
200
|
-
* Type representing the scope for getting a Python environment.
|
|
201
|
-
* Can be undefined or a URI.
|
|
202
|
-
*/
|
|
203
|
-
export type GetEnvironmentScope = undefined | Uri;
|
|
204
|
-
/**
|
|
205
|
-
* Type representing the scope for creating a Python environment.
|
|
206
|
-
* Can be a Python project or 'global'.
|
|
207
|
-
*/
|
|
208
|
-
export type CreateEnvironmentScope = Uri | Uri[] | 'global';
|
|
209
|
-
/**
|
|
210
|
-
* The scope for which environments are to be refreshed.
|
|
211
|
-
* - `undefined`: Search for environments globally and workspaces.
|
|
212
|
-
* - {@link Uri}: Environments in the workspace/folder or associated with the Uri.
|
|
213
|
-
*/
|
|
214
|
-
export type RefreshEnvironmentsScope = Uri | undefined;
|
|
215
|
-
/**
|
|
216
|
-
* The scope for which environments are required.
|
|
217
|
-
* - `"all"`: All environments.
|
|
218
|
-
* - `"global"`: Python installations that are usually a base for creating virtual environments.
|
|
219
|
-
* - {@link Uri}: Environments for the workspace/folder/file pointed to by the Uri.
|
|
220
|
-
*/
|
|
221
|
-
export type GetEnvironmentsScope = Uri | 'all' | 'global';
|
|
222
|
-
/**
|
|
223
|
-
* Event arguments for when the current Python environment changes.
|
|
224
|
-
*/
|
|
225
|
-
export type DidChangeEnvironmentEventArgs = {
|
|
226
|
-
/**
|
|
227
|
-
* The URI of the environment that changed.
|
|
228
|
-
*/
|
|
229
|
-
readonly uri: Uri | undefined;
|
|
230
|
-
/**
|
|
231
|
-
* The old Python environment before the change.
|
|
232
|
-
*/
|
|
233
|
-
readonly old: PythonEnvironment | undefined;
|
|
234
|
-
/**
|
|
235
|
-
* The new Python environment after the change.
|
|
236
|
-
*/
|
|
237
|
-
readonly new: PythonEnvironment | undefined;
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Enum representing the kinds of environment changes.
|
|
241
|
-
*/
|
|
242
|
-
export declare enum EnvironmentChangeKind {
|
|
243
|
-
/**
|
|
244
|
-
* Indicates that an environment was added.
|
|
245
|
-
*/
|
|
246
|
-
add = "add",
|
|
247
|
-
/**
|
|
248
|
-
* Indicates that an environment was removed.
|
|
249
|
-
*/
|
|
250
|
-
remove = "remove"
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Event arguments for when the list of Python environments changes.
|
|
254
|
-
*/
|
|
255
|
-
export type DidChangeEnvironmentsEventArgs = {
|
|
256
|
-
/**
|
|
257
|
-
* The kind of change that occurred (add or remove).
|
|
258
|
-
*/
|
|
259
|
-
kind: EnvironmentChangeKind;
|
|
260
|
-
/**
|
|
261
|
-
* The Python environment that was added or removed.
|
|
262
|
-
*/
|
|
263
|
-
environment: PythonEnvironment;
|
|
264
|
-
}[];
|
|
265
|
-
/**
|
|
266
|
-
* Type representing the context for resolving a Python environment.
|
|
267
|
-
*/
|
|
268
|
-
export type ResolveEnvironmentContext = Uri;
|
|
269
|
-
export interface QuickCreateConfig {
|
|
270
|
-
/**
|
|
271
|
-
* The description of the quick create step.
|
|
272
|
-
*/
|
|
273
|
-
readonly description: string;
|
|
274
|
-
/**
|
|
275
|
-
* The detail of the quick create step.
|
|
276
|
-
*/
|
|
277
|
-
readonly detail?: string;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Options controlling environment removal.
|
|
281
|
-
*/
|
|
282
|
-
export interface RemoveEnvironmentOptions {
|
|
283
|
-
/**
|
|
284
|
-
* When `true`, removes the environment without prompting for confirmation.
|
|
285
|
-
* Intended for automated or headless scenarios. Defaults to `false`.
|
|
286
|
-
*/
|
|
287
|
-
runHeadless?: boolean;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Interface representing an environment manager.
|
|
291
|
-
*
|
|
292
|
-
* @remarks
|
|
293
|
-
* Methods on this interface are invoked both by the Python Environments extension itself
|
|
294
|
-
* (in response to UI actions, startup, terminal activation, script execution, and so on)
|
|
295
|
-
* and directly by other extensions that consume the published API. Any "called when…"
|
|
296
|
-
* notes on individual methods list representative triggers only — they are not
|
|
297
|
-
* exhaustive, and the precise set of call sites may evolve over time. Implementations
|
|
298
|
-
* should focus on the documented contract rather than any specific caller.
|
|
299
|
-
*/
|
|
300
|
-
export interface EnvironmentManager {
|
|
301
|
-
/**
|
|
302
|
-
* The name of the environment manager. Allowed characters (a-z, A-Z, 0-9, -, _).
|
|
303
|
-
*/
|
|
304
|
-
readonly name: string;
|
|
305
|
-
/**
|
|
306
|
-
* The display name of the environment manager.
|
|
307
|
-
*/
|
|
308
|
-
readonly displayName?: string;
|
|
309
|
-
/**
|
|
310
|
-
* The preferred package manager ID for the environment manager. This is a combination
|
|
311
|
-
* of publisher id, extension id, and {@link EnvironmentManager.name package manager name}.
|
|
312
|
-
* `<publisher-id>.<extension-id>:<package-manager-name>`
|
|
313
|
-
*
|
|
314
|
-
* @example
|
|
315
|
-
* 'ms-python.python:pip'
|
|
316
|
-
*/
|
|
317
|
-
readonly preferredPackageManagerId: string;
|
|
318
|
-
/**
|
|
319
|
-
* The description of the environment manager.
|
|
320
|
-
*/
|
|
321
|
-
readonly description?: string;
|
|
322
|
-
/**
|
|
323
|
-
* The tooltip for the environment manager, which can be a string or a Markdown string.
|
|
324
|
-
*/
|
|
325
|
-
readonly tooltip?: string | MarkdownString | undefined;
|
|
326
|
-
/**
|
|
327
|
-
* The icon path for the environment manager, which can be a string, Uri, or an object with light and dark theme paths.
|
|
328
|
-
*/
|
|
329
|
-
readonly iconPath?: IconPath;
|
|
330
|
-
/**
|
|
331
|
-
* The log output channel for the environment manager.
|
|
332
|
-
*/
|
|
333
|
-
readonly log?: LogOutputChannel;
|
|
334
|
-
/**
|
|
335
|
-
* The quick create details for the environment manager. Having this method also enables the quick create feature
|
|
336
|
-
* for the environment manager. Should Implement {@link EnvironmentManager.create} to support quick create.
|
|
337
|
-
*/
|
|
338
|
-
quickCreateConfig?(): QuickCreateConfig | undefined;
|
|
339
|
-
/**
|
|
340
|
-
* 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`.
|
|
341
|
-
* @param scope - The scope within which to create the environment.
|
|
342
|
-
* @param options - Optional parameters for creating the Python environment.
|
|
343
|
-
* @returns A promise that resolves to the created Python environment, or undefined if creation failed.
|
|
344
|
-
*
|
|
345
|
-
* @remarks
|
|
346
|
-
* Invoked when an environment of this manager's type should be created for the given
|
|
347
|
-
* scope. Typical triggers include user-initiated environment-creation flows and
|
|
348
|
-
* programmatic creation via the API.
|
|
349
|
-
*/
|
|
350
|
-
create?(scope: CreateEnvironmentScope, options?: CreateEnvironmentOptions): Promise<PythonEnvironment | undefined>;
|
|
351
|
-
/**
|
|
352
|
-
* Removes the specified Python environment.
|
|
353
|
-
* @param environment - The Python environment to remove.
|
|
354
|
-
* @returns A promise that resolves when the environment is removed.
|
|
355
|
-
*
|
|
356
|
-
* @remarks
|
|
357
|
-
* Invoked to delete the given environment. Typical triggers include an explicit user
|
|
358
|
-
* action (such as a "Delete Environment" command) and programmatic removal via the API.
|
|
359
|
-
*/
|
|
360
|
-
remove?(environment: PythonEnvironment, options?: RemoveEnvironmentOptions): Promise<void>;
|
|
361
|
-
/**
|
|
362
|
-
* Refreshes the list of Python environments within the specified scope.
|
|
363
|
-
* @param scope - The scope within which to refresh environments.
|
|
364
|
-
* @returns A promise that resolves when the refresh is complete.
|
|
365
|
-
*
|
|
366
|
-
* @remarks
|
|
367
|
-
* Forces the manager to re-discover environments for the given scope. Typically
|
|
368
|
-
* triggered by an explicit user "refresh" action.
|
|
369
|
-
*/
|
|
370
|
-
refresh(scope: RefreshEnvironmentsScope): Promise<void>;
|
|
371
|
-
/**
|
|
372
|
-
* Retrieves a list of Python environments within the specified scope.
|
|
373
|
-
* @param scope - The scope within which to retrieve environments.
|
|
374
|
-
* @returns A promise that resolves to an array of Python environments.
|
|
375
|
-
*
|
|
376
|
-
* @remarks
|
|
377
|
-
* Returns the environments known to this manager for the given scope. Called
|
|
378
|
-
* frequently by UI surfaces (tree views, pickers) and by other consumers of the API.
|
|
379
|
-
*/
|
|
380
|
-
getEnvironments(scope: GetEnvironmentsScope): Promise<PythonEnvironment[]>;
|
|
381
|
-
/**
|
|
382
|
-
* Event that is fired when the list of Python environments changes.
|
|
383
|
-
*/
|
|
384
|
-
onDidChangeEnvironments?: Event<DidChangeEnvironmentsEventArgs>;
|
|
385
|
-
/**
|
|
386
|
-
* Sets the current Python environment within the specified scope.
|
|
387
|
-
* @param scope - The scope within which to set the environment.
|
|
388
|
-
* @param environment - The Python environment to set. If undefined, the environment is unset.
|
|
389
|
-
* @returns A promise that resolves when the environment is set.
|
|
390
|
-
*
|
|
391
|
-
* @remarks
|
|
392
|
-
* Invoked when the active environment for the given scope should change — for example
|
|
393
|
-
* after the user selects an environment in a picker, after a newly created environment
|
|
394
|
-
* is auto-selected, or programmatically via the API.
|
|
395
|
-
*
|
|
396
|
-
* Also invoked at extension startup to rehydrate the active environment from
|
|
397
|
-
* persisted state.
|
|
398
|
-
*/
|
|
399
|
-
set(scope: SetEnvironmentScope, environment?: PythonEnvironment): Promise<void>;
|
|
400
|
-
/**
|
|
401
|
-
* Retrieves the current Python environment within the specified scope.
|
|
402
|
-
* @param scope - The scope within which to retrieve the environment.
|
|
403
|
-
* @returns A promise that resolves to the current Python environment, or undefined if none is set.
|
|
404
|
-
*
|
|
405
|
-
* @remarks
|
|
406
|
-
* Returns the currently active environment for the given scope, or `undefined` if
|
|
407
|
-
* none is selected. Called very frequently — at startup, after {@link set}, when a
|
|
408
|
-
* terminal is opened, before running Python, by UI surfaces that display the active
|
|
409
|
-
* interpreter, and by other extensions consuming the API.
|
|
410
|
-
*/
|
|
411
|
-
get(scope: GetEnvironmentScope): Promise<PythonEnvironment | undefined>;
|
|
412
|
-
/**
|
|
413
|
-
* Event that is fired when the current Python environment changes.
|
|
414
|
-
*/
|
|
415
|
-
onDidChangeEnvironment?: Event<DidChangeEnvironmentEventArgs>;
|
|
416
|
-
/**
|
|
417
|
-
* Resolves the specified Python environment. The environment can be either a {@link PythonEnvironment} or a {@link Uri} context.
|
|
418
|
-
*
|
|
419
|
-
* This method is used to obtain a fully detailed {@link PythonEnvironment} object. The input can be:
|
|
420
|
-
* - A {@link PythonEnvironment} object, which might be missing key details such as {@link PythonEnvironment.execInfo}.
|
|
421
|
-
* - A {@link Uri} object, which typically represents either:
|
|
422
|
-
* - A folder that contains the Python environment.
|
|
423
|
-
* - The path to a Python executable.
|
|
424
|
-
*
|
|
425
|
-
* @param context - The context for resolving the environment, which can be a {@link PythonEnvironment} or a {@link Uri}.
|
|
426
|
-
* @returns A promise that resolves to the fully detailed {@link PythonEnvironment}, or `undefined` if the environment cannot be resolved.
|
|
427
|
-
*
|
|
428
|
-
* @remarks
|
|
429
|
-
* Called to turn a lightly-populated {@link PythonEnvironment} or a {@link Uri}
|
|
430
|
-
* pointing at an interpreter or environment folder into a fully-populated
|
|
431
|
-
* {@link PythonEnvironment} with complete {@link PythonEnvironment.execInfo}. Typical
|
|
432
|
-
* triggers include the user manually selecting an interpreter path, resolving
|
|
433
|
-
* `python.defaultInterpreterPath` at startup, and populating execution details before
|
|
434
|
-
* launching Python.
|
|
435
|
-
*/
|
|
436
|
-
resolve(context: ResolveEnvironmentContext): Promise<PythonEnvironment | undefined>;
|
|
437
|
-
/**
|
|
438
|
-
* Clears the environment manager's cache.
|
|
439
|
-
*
|
|
440
|
-
* @returns A promise that resolves when the cache is cleared.
|
|
441
|
-
*
|
|
442
|
-
* @remarks
|
|
443
|
-
* Drops any cached environment data held by the manager so that subsequent calls to
|
|
444
|
-
* {@link EnvironmentManager.getEnvironments} or {@link EnvironmentManager.get}
|
|
445
|
-
* re-discover state from disk. Typically triggered by an explicit user "clear cache"
|
|
446
|
-
* action.
|
|
447
|
-
*/
|
|
448
|
-
clearCache?(): Promise<void>;
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Interface representing a package ID.
|
|
452
|
-
*/
|
|
453
|
-
export interface PackageId {
|
|
454
|
-
/**
|
|
455
|
-
* The ID of the package.
|
|
456
|
-
*/
|
|
457
|
-
id: string;
|
|
458
|
-
/**
|
|
459
|
-
* The ID of the package manager.
|
|
460
|
-
*/
|
|
461
|
-
managerId: string;
|
|
462
|
-
/**
|
|
463
|
-
* The ID of the environment in which the package is installed.
|
|
464
|
-
*/
|
|
465
|
-
environmentId: string;
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Interface representing package information.
|
|
469
|
-
*/
|
|
470
|
-
export interface PackageInfo {
|
|
471
|
-
/**
|
|
472
|
-
* The name of the package.
|
|
473
|
-
*/
|
|
474
|
-
readonly name: string;
|
|
475
|
-
/**
|
|
476
|
-
* The display name of the package.
|
|
477
|
-
*/
|
|
478
|
-
readonly displayName: string;
|
|
479
|
-
/**
|
|
480
|
-
* The version of the package.
|
|
481
|
-
*/
|
|
482
|
-
readonly version?: string;
|
|
483
|
-
/**
|
|
484
|
-
* The description of the package.
|
|
485
|
-
*/
|
|
486
|
-
readonly description?: string;
|
|
487
|
-
/**
|
|
488
|
-
* The tooltip for the package, which can be a string or a Markdown string.
|
|
489
|
-
*/
|
|
490
|
-
readonly tooltip?: string | MarkdownString | undefined;
|
|
491
|
-
/**
|
|
492
|
-
* The icon path for the package, which can be a string, Uri, or an object with light and dark theme paths.
|
|
493
|
-
*/
|
|
494
|
-
readonly iconPath?: IconPath;
|
|
495
|
-
/**
|
|
496
|
-
* The URIs associated with the package.
|
|
497
|
-
*/
|
|
498
|
-
readonly uris?: readonly Uri[];
|
|
499
|
-
/**
|
|
500
|
-
* Whether the package is a transitive dependency.
|
|
501
|
-
*/
|
|
502
|
-
readonly isTransitive?: boolean;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Interface representing a package.
|
|
506
|
-
*/
|
|
507
|
-
export interface Package extends PackageInfo {
|
|
508
|
-
/**
|
|
509
|
-
* The ID of the package.
|
|
510
|
-
*/
|
|
511
|
-
readonly pkgId: PackageId;
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* Enum representing the kinds of package changes.
|
|
515
|
-
*/
|
|
516
|
-
export declare enum PackageChangeKind {
|
|
517
|
-
/**
|
|
518
|
-
* Indicates that a package was added.
|
|
519
|
-
*/
|
|
520
|
-
add = "add",
|
|
521
|
-
/**
|
|
522
|
-
* Indicates that a package was removed.
|
|
523
|
-
*/
|
|
524
|
-
remove = "remove"
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Event arguments for when packages change.
|
|
528
|
-
*/
|
|
529
|
-
export interface DidChangePackagesEventArgs {
|
|
530
|
-
/**
|
|
531
|
-
* The Python environment in which the packages changed.
|
|
532
|
-
*/
|
|
533
|
-
environment: PythonEnvironment;
|
|
534
|
-
/**
|
|
535
|
-
* The package manager responsible for the changes.
|
|
536
|
-
*/
|
|
537
|
-
manager: PackageManager;
|
|
538
|
-
/**
|
|
539
|
-
* The list of changes, each containing the kind of change and the package affected.
|
|
540
|
-
*/
|
|
541
|
-
changes: {
|
|
542
|
-
kind: PackageChangeKind;
|
|
543
|
-
pkg: Package;
|
|
544
|
-
}[];
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Interface representing a package manager.
|
|
548
|
-
*/
|
|
549
|
-
export interface PackageManager {
|
|
550
|
-
/**
|
|
551
|
-
* The name of the package manager. Allowed characters (a-z, A-Z, 0-9, -, _).
|
|
552
|
-
*/
|
|
553
|
-
name: string;
|
|
554
|
-
/**
|
|
555
|
-
* The display name of the package manager.
|
|
556
|
-
*/
|
|
557
|
-
displayName?: string;
|
|
558
|
-
/**
|
|
559
|
-
* The description of the package manager.
|
|
560
|
-
*/
|
|
561
|
-
description?: string;
|
|
562
|
-
/**
|
|
563
|
-
* The tooltip for the package manager, which can be a string or a Markdown string.
|
|
564
|
-
*/
|
|
565
|
-
tooltip?: string | MarkdownString | undefined;
|
|
566
|
-
/**
|
|
567
|
-
* The icon path for the package manager, which can be a string, Uri, or an object with light and dark theme paths.
|
|
568
|
-
*/
|
|
569
|
-
iconPath?: IconPath;
|
|
570
|
-
/**
|
|
571
|
-
* The log output channel for the package manager.
|
|
572
|
-
*/
|
|
573
|
-
log?: LogOutputChannel;
|
|
574
|
-
/**
|
|
575
|
-
* Installs/Uninstall packages in the specified Python environment.
|
|
576
|
-
* @param environment - The Python environment in which to install packages.
|
|
577
|
-
* @param options - Options for managing packages.
|
|
578
|
-
* @returns A promise that resolves when the installation is complete.
|
|
579
|
-
*/
|
|
580
|
-
manage(environment: PythonEnvironment, options: PackageManagementOptions): Promise<void>;
|
|
581
|
-
/**
|
|
582
|
-
* Refreshes the package list for the specified Python environment.
|
|
583
|
-
* @param environment - The Python environment for which to refresh the package list.
|
|
584
|
-
* @returns A promise that resolves when the refresh is complete.
|
|
585
|
-
*/
|
|
586
|
-
refresh(environment: PythonEnvironment): Promise<void>;
|
|
587
|
-
/**
|
|
588
|
-
* Retrieves the list of packages for the specified Python environment.
|
|
589
|
-
* @param environment - The Python environment for which to retrieve packages.
|
|
590
|
-
* @param options - Optional settings for package retrieval.
|
|
591
|
-
* @returns An array of packages, or undefined if the packages could not be retrieved.
|
|
592
|
-
*/
|
|
593
|
-
getPackages(environment: PythonEnvironment, options?: GetPackagesOptions): Promise<Package[] | undefined>;
|
|
594
|
-
/**
|
|
595
|
-
* Returns additional filesystem patterns to watch for package install/uninstall changes.
|
|
596
|
-
*
|
|
597
|
-
* These patterns are appended to the default site-packages metadata locations.
|
|
598
|
-
* Implement this for manager-specific locations (for example, conda-meta).
|
|
599
|
-
*
|
|
600
|
-
* @param environment - The Python environment whose package paths should be watched.
|
|
601
|
-
* @returns Relative patterns to watch for package changes.
|
|
602
|
-
*/
|
|
603
|
-
getPackageWatchTargets?(environment: PythonEnvironment): RelativePattern[];
|
|
604
|
-
/**
|
|
605
|
-
* Event that is fired when packages change.
|
|
606
|
-
*/
|
|
607
|
-
onDidChangePackages?: Event<DidChangePackagesEventArgs>;
|
|
608
|
-
/**
|
|
609
|
-
* Fetches the names of direct (non-transitive) packages for the specified Python environment.
|
|
610
|
-
*
|
|
611
|
-
* **Caveat:** Most package managers cannot track user install intent. For pip, this uses
|
|
612
|
-
* `pip list --not-required` which returns packages with no installed dependents (leaf packages),
|
|
613
|
-
* not necessarily packages the user explicitly installed. For example, if a user runs
|
|
614
|
-
* `pip install flask werkzeug`, werkzeug will still be reported as transitive because flask
|
|
615
|
-
* depends on it. This is a best-effort approximation.
|
|
616
|
-
*
|
|
617
|
-
* @param environment - The Python environment for which to fetch direct package names.
|
|
618
|
-
* @returns A promise that resolves to a set of package name strings, or undefined if not supported.
|
|
619
|
-
*/
|
|
620
|
-
getDirectPackageNames?(environment: PythonEnvironment): Promise<Set<string> | undefined>;
|
|
621
|
-
/**
|
|
622
|
-
* Clears the package manager's cache.
|
|
623
|
-
* @returns A promise that resolves when the cache is cleared.
|
|
624
|
-
*/
|
|
625
|
-
clearCache?(): Promise<void>;
|
|
626
|
-
/**
|
|
627
|
-
* Returns the version of the underlying package management tool (e.g., pip, uv, conda).
|
|
628
|
-
* @param environment - The Python environment context.
|
|
629
|
-
* @returns A promise that resolves to a {@link Pep440Version} object, or `undefined` if not available.
|
|
630
|
-
*/
|
|
631
|
-
getVersion?(environment: PythonEnvironment): Promise<Pep440Version | undefined>;
|
|
632
|
-
/**
|
|
633
|
-
* Retrieves the list of available versions for a given package, newest first.
|
|
634
|
-
*
|
|
635
|
-
* Implementations should:
|
|
636
|
-
* - resolve to an array of {@link Pep440Version} objects on success;
|
|
637
|
-
* - throw a {@link PackageVersionLookupNotSupportedError} when this manager cannot look up
|
|
638
|
-
* versions at all (an unsupported capability);
|
|
639
|
-
* - let operational failures (command, network, or malformed/unparseable output) propagate
|
|
640
|
-
* instead of swallowing them into `undefined`.
|
|
641
|
-
*
|
|
642
|
-
* Resolving to `undefined` is treated by callers as an unsupported capability, equivalent to
|
|
643
|
-
* throwing {@link PackageVersionLookupNotSupportedError}.
|
|
644
|
-
*
|
|
645
|
-
* @param environment - The Python environment context for the lookup.
|
|
646
|
-
* @param packageName - The name of the package to look up.
|
|
647
|
-
* @returns A promise that resolves to an array of {@link Pep440Version} objects (newest first).
|
|
648
|
-
* @throws {@link PackageVersionLookupNotSupportedError} when version lookup is unsupported.
|
|
649
|
-
*/
|
|
650
|
-
getPackageAvailableVersions?(environment: PythonEnvironment, packageName: string): Promise<Pep440Version[] | undefined>;
|
|
651
|
-
/**
|
|
652
|
-
* Formats a versioned install specification for this package manager.
|
|
653
|
-
*
|
|
654
|
-
* Different package managers use different syntax (e.g. pip uses `name==version`,
|
|
655
|
-
* conda uses `name=version`). Implement this method to return the correct format.
|
|
656
|
-
* When absent, callers should default to `name==version`.
|
|
657
|
-
*
|
|
658
|
-
* @param packageName - The name of the package.
|
|
659
|
-
* @param version - The version string.
|
|
660
|
-
* @returns The install specification string (e.g. `"requests==2.31.0"` or `"requests=2.31.0"`).
|
|
661
|
-
*/
|
|
662
|
-
formatInstallSpec?(packageName: string, version: string): string;
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* Interface representing a Python project.
|
|
666
|
-
*/
|
|
667
|
-
export interface PythonProject {
|
|
668
|
-
/**
|
|
669
|
-
* The name of the Python project.
|
|
670
|
-
*/
|
|
671
|
-
readonly name: string;
|
|
672
|
-
/**
|
|
673
|
-
* The URI of the Python project.
|
|
674
|
-
*/
|
|
675
|
-
readonly uri: Uri;
|
|
676
|
-
/**
|
|
677
|
-
* The description of the Python project.
|
|
678
|
-
*/
|
|
679
|
-
readonly description?: string;
|
|
680
|
-
/**
|
|
681
|
-
* The tooltip for the Python project, which can be a string or a Markdown string.
|
|
682
|
-
*/
|
|
683
|
-
readonly tooltip?: string | MarkdownString;
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* Options for creating a Python project.
|
|
687
|
-
*/
|
|
688
|
-
export interface PythonProjectCreatorOptions {
|
|
689
|
-
/**
|
|
690
|
-
* The name of the Python project.
|
|
691
|
-
*/
|
|
692
|
-
name: string;
|
|
693
|
-
/**
|
|
694
|
-
* Path provided as the root for the project.
|
|
695
|
-
*/
|
|
696
|
-
rootUri: Uri;
|
|
697
|
-
/**
|
|
698
|
-
* Boolean indicating whether the project should be created without any user input.
|
|
699
|
-
*/
|
|
700
|
-
quickCreate?: boolean;
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* Interface representing a creator for Python projects.
|
|
704
|
-
*/
|
|
705
|
-
export interface PythonProjectCreator {
|
|
706
|
-
/**
|
|
707
|
-
* The name of the Python project creator.
|
|
708
|
-
*/
|
|
709
|
-
readonly name: string;
|
|
710
|
-
/**
|
|
711
|
-
* The display name of the Python project creator.
|
|
712
|
-
*/
|
|
713
|
-
readonly displayName?: string;
|
|
714
|
-
/**
|
|
715
|
-
* The description of the Python project creator.
|
|
716
|
-
*/
|
|
717
|
-
readonly description?: string;
|
|
718
|
-
/**
|
|
719
|
-
* The tooltip for the Python project creator, which can be a string or a Markdown string.
|
|
720
|
-
*/
|
|
721
|
-
readonly tooltip?: string | MarkdownString;
|
|
722
|
-
/**
|
|
723
|
-
* Creates a new Python project(s) or, if files are not a project, returns Uri(s) to the created files.
|
|
724
|
-
* Anything that needs its own python environment constitutes a project.
|
|
725
|
-
* @param options Optional parameters for creating the Python project.
|
|
726
|
-
* @returns A promise that resolves to one of the following:
|
|
727
|
-
* - PythonProject or PythonProject[]: when a single or multiple projects are created.
|
|
728
|
-
* - Uri or Uri[]: when files are created that do not constitute a project.
|
|
729
|
-
* - undefined: if project creation fails.
|
|
730
|
-
*/
|
|
731
|
-
create(options?: PythonProjectCreatorOptions): Promise<PythonProject | PythonProject[] | Uri | Uri[] | undefined>;
|
|
732
|
-
/**
|
|
733
|
-
* A flag indicating whether the project creator supports quick create where no user input is required.
|
|
734
|
-
*/
|
|
735
|
-
readonly supportsQuickCreate?: boolean;
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Event arguments for when Python projects change.
|
|
739
|
-
*/
|
|
740
|
-
export interface DidChangePythonProjectsEventArgs {
|
|
741
|
-
/**
|
|
742
|
-
* The list of Python projects that were added.
|
|
743
|
-
*/
|
|
744
|
-
added: PythonProject[];
|
|
745
|
-
/**
|
|
746
|
-
* The list of Python projects that were removed.
|
|
747
|
-
*/
|
|
748
|
-
removed: PythonProject[];
|
|
749
|
-
}
|
|
750
|
-
/**
|
|
751
|
-
* Options for retrieving packages from a package manager.
|
|
752
|
-
*/
|
|
753
|
-
export interface GetPackagesOptions {
|
|
754
|
-
/**
|
|
755
|
-
* When `true`, bypasses the cache and fetches the latest packages from the underlying tool.
|
|
756
|
-
* Defaults to `false`.
|
|
757
|
-
*/
|
|
758
|
-
skipCache?: boolean;
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Options controlling user interaction during package management operations.
|
|
762
|
-
*/
|
|
763
|
-
export interface PackageManagementInteractionOptions {
|
|
764
|
-
/**
|
|
765
|
-
* When `true`, the package management operation runs without any user prompts or
|
|
766
|
-
* interaction and relies solely on the packages provided in the options. Any step
|
|
767
|
-
* that would normally require user input — such as selecting packages to install
|
|
768
|
-
* when none are specified — is skipped instead of prompting the user. Intended for
|
|
769
|
-
* automated or headless scenarios such as integration tests. Defaults to `false`.
|
|
770
|
-
*/
|
|
771
|
-
runHeadless?: boolean;
|
|
772
|
-
}
|
|
773
|
-
export type PackageManagementOptions = PackageManagementInteractionOptions & ({
|
|
774
|
-
/**
|
|
775
|
-
* Upgrade the packages if they are already installed.
|
|
776
|
-
*/
|
|
777
|
-
upgrade?: boolean;
|
|
778
|
-
/**
|
|
779
|
-
* Show option to skip package installation or uninstallation.
|
|
780
|
-
*/
|
|
781
|
-
showSkipOption?: boolean;
|
|
782
|
-
/**
|
|
783
|
-
* The list of packages to install.
|
|
784
|
-
*/
|
|
785
|
-
install: string[];
|
|
786
|
-
/**
|
|
787
|
-
* The list of packages to uninstall.
|
|
788
|
-
*/
|
|
789
|
-
uninstall?: string[];
|
|
790
|
-
} | {
|
|
791
|
-
/**
|
|
792
|
-
* Upgrade the packages if they are already installed.
|
|
793
|
-
*/
|
|
794
|
-
upgrade?: boolean;
|
|
795
|
-
/**
|
|
796
|
-
* Show option to skip package installation or uninstallation.
|
|
797
|
-
*/
|
|
798
|
-
showSkipOption?: boolean;
|
|
799
|
-
/**
|
|
800
|
-
* The list of packages to install.
|
|
801
|
-
*/
|
|
802
|
-
install?: string[];
|
|
803
|
-
/**
|
|
804
|
-
* The list of packages to uninstall.
|
|
805
|
-
*/
|
|
806
|
-
uninstall: string[];
|
|
807
|
-
});
|
|
808
|
-
/**
|
|
809
|
-
* Options for creating a Python environment.
|
|
810
|
-
*/
|
|
811
|
-
export interface CreateEnvironmentOptions {
|
|
812
|
-
/**
|
|
813
|
-
* Provides some context about quick create based on user input.
|
|
814
|
-
* - if true, the environment should be created without any user input or prompts.
|
|
815
|
-
* - if false, the environment creation can show user input or prompts.
|
|
816
|
-
* This also means user explicitly skipped the quick create option.
|
|
817
|
-
* - if undefined, the environment creation can show user input or prompts.
|
|
818
|
-
* You can show quick create option to the user if you support it.
|
|
819
|
-
*/
|
|
820
|
-
quickCreate?: boolean;
|
|
821
|
-
/**
|
|
822
|
-
* Packages to install in addition to the automatically picked packages as a part of creating environment.
|
|
823
|
-
*/
|
|
824
|
-
additionalPackages?: string[];
|
|
825
|
-
}
|
|
826
|
-
/**
|
|
827
|
-
* Object representing the process started using run in background API.
|
|
828
|
-
*/
|
|
829
|
-
export interface PythonProcess {
|
|
830
|
-
/**
|
|
831
|
-
* The process ID of the Python process.
|
|
832
|
-
*/
|
|
833
|
-
readonly pid?: number;
|
|
834
|
-
/**
|
|
835
|
-
* The standard input of the Python process.
|
|
836
|
-
*/
|
|
837
|
-
readonly stdin: NodeJS.WritableStream;
|
|
838
|
-
/**
|
|
839
|
-
* The standard output of the Python process.
|
|
840
|
-
*/
|
|
841
|
-
readonly stdout: NodeJS.ReadableStream;
|
|
842
|
-
/**
|
|
843
|
-
* The standard error of the Python process.
|
|
844
|
-
*/
|
|
845
|
-
readonly stderr: NodeJS.ReadableStream;
|
|
846
|
-
/**
|
|
847
|
-
* Kills the Python process.
|
|
848
|
-
*/
|
|
849
|
-
kill(): void;
|
|
850
|
-
/**
|
|
851
|
-
* Event that is fired when the Python process exits.
|
|
852
|
-
*/
|
|
853
|
-
onExit(listener: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
854
|
-
}
|
|
855
|
-
export interface PythonEnvironmentManagerRegistrationApi {
|
|
856
|
-
/**
|
|
857
|
-
* Register an environment manager implementation.
|
|
858
|
-
*
|
|
859
|
-
* @param manager Environment Manager implementation to register.
|
|
860
|
-
* @param options Optional registration options.
|
|
861
|
-
* @param options.extensionId The extension ID of the calling extension. When this is not specified,
|
|
862
|
-
* or when the specified extension cannot be found, the extension ID will be automatically detected.
|
|
863
|
-
* @returns A disposable that can be used to unregister the environment manager.
|
|
864
|
-
* @see {@link EnvironmentManager}
|
|
865
|
-
*/
|
|
866
|
-
registerEnvironmentManager(manager: EnvironmentManager, options?: {
|
|
867
|
-
extensionId?: string;
|
|
868
|
-
}): Disposable;
|
|
869
|
-
}
|
|
870
|
-
export interface PythonEnvironmentItemApi {
|
|
871
|
-
/**
|
|
872
|
-
* Create a Python environment item from the provided environment info. This item is used to interact
|
|
873
|
-
* with the environment.
|
|
874
|
-
*
|
|
875
|
-
* @param info Some details about the environment like name, version, etc. needed to interact with the environment.
|
|
876
|
-
* @param manager The environment manager to associate with the environment.
|
|
877
|
-
* @returns The Python environment.
|
|
878
|
-
*/
|
|
879
|
-
createPythonEnvironmentItem(info: PythonEnvironmentInfo, manager: EnvironmentManager): PythonEnvironment;
|
|
880
|
-
}
|
|
881
|
-
export interface PythonEnvironmentManagementApi {
|
|
882
|
-
/**
|
|
883
|
-
* Create a Python environment using environment manager associated with the scope.
|
|
884
|
-
*
|
|
885
|
-
* @param scope Where the environment is to be created.
|
|
886
|
-
* @param options Optional parameters for creating the Python environment.
|
|
887
|
-
* @returns The Python environment created. `undefined` if not created.
|
|
888
|
-
*/
|
|
889
|
-
createEnvironment(scope: CreateEnvironmentScope, options?: CreateEnvironmentOptions): Promise<PythonEnvironment | undefined>;
|
|
890
|
-
/**
|
|
891
|
-
* Remove a Python environment.
|
|
892
|
-
*
|
|
893
|
-
* @param environment The Python environment to remove.
|
|
894
|
-
* @param options Optional parameters controlling environment removal.
|
|
895
|
-
* @returns A promise that resolves when the environment has been removed.
|
|
896
|
-
*/
|
|
897
|
-
removeEnvironment(environment: PythonEnvironment, options?: RemoveEnvironmentOptions): Promise<void>;
|
|
898
|
-
}
|
|
899
|
-
export interface PythonEnvironmentsApi {
|
|
900
|
-
/**
|
|
901
|
-
* Initiates a refresh of Python environments within the specified scope.
|
|
902
|
-
* @param scope - The scope within which to search for environments.
|
|
903
|
-
* @returns A promise that resolves when the search is complete.
|
|
904
|
-
*/
|
|
905
|
-
refreshEnvironments(scope: RefreshEnvironmentsScope): Promise<void>;
|
|
906
|
-
/**
|
|
907
|
-
* Retrieves a list of Python environments within the specified scope.
|
|
908
|
-
* @param scope - The scope within which to retrieve environments.
|
|
909
|
-
* @returns A promise that resolves to an array of Python environments.
|
|
910
|
-
*/
|
|
911
|
-
getEnvironments(scope: GetEnvironmentsScope): Promise<PythonEnvironment[]>;
|
|
912
|
-
/**
|
|
913
|
-
* Event that is fired when the list of Python environments changes.
|
|
914
|
-
* @see {@link DidChangeEnvironmentsEventArgs}
|
|
915
|
-
*/
|
|
916
|
-
onDidChangeEnvironments: Event<DidChangeEnvironmentsEventArgs>;
|
|
917
|
-
/**
|
|
918
|
-
* This method is used to get the details missing from a PythonEnvironment. Like
|
|
919
|
-
* {@link PythonEnvironment.execInfo} and other details.
|
|
920
|
-
*
|
|
921
|
-
* @param context : The PythonEnvironment or Uri for which details are required.
|
|
922
|
-
*/
|
|
923
|
-
resolveEnvironment(context: ResolveEnvironmentContext): Promise<PythonEnvironment | undefined>;
|
|
924
|
-
}
|
|
925
|
-
export interface PythonProjectEnvironmentApi {
|
|
926
|
-
/**
|
|
927
|
-
* Sets the current Python environment within the specified scope.
|
|
928
|
-
* @param scope - The scope within which to set the environment.
|
|
929
|
-
* @param environment - The Python environment to set. If undefined, the environment is unset.
|
|
930
|
-
*/
|
|
931
|
-
setEnvironment(scope: SetEnvironmentScope, environment?: PythonEnvironment): Promise<void>;
|
|
932
|
-
/**
|
|
933
|
-
* Retrieves the current Python environment within the specified scope.
|
|
934
|
-
* @param scope - The scope within which to retrieve the environment.
|
|
935
|
-
* @returns A promise that resolves to the current Python environment, or undefined if none is set.
|
|
936
|
-
*/
|
|
937
|
-
getEnvironment(scope: GetEnvironmentScope): Promise<PythonEnvironment | undefined>;
|
|
938
|
-
/**
|
|
939
|
-
* Event that is fired when the selected Python environment changes for Project, Folder or File.
|
|
940
|
-
* @see {@link DidChangeEnvironmentEventArgs}
|
|
941
|
-
*/
|
|
942
|
-
onDidChangeEnvironment: Event<DidChangeEnvironmentEventArgs>;
|
|
943
|
-
}
|
|
944
|
-
export interface PythonEnvironmentManagerApi extends PythonEnvironmentManagerRegistrationApi, PythonEnvironmentItemApi, PythonEnvironmentManagementApi, PythonEnvironmentsApi, PythonProjectEnvironmentApi {
|
|
945
|
-
}
|
|
946
|
-
export interface PythonPackageManagerRegistrationApi {
|
|
947
|
-
/**
|
|
948
|
-
* Register a package manager implementation.
|
|
949
|
-
*
|
|
950
|
-
* @param manager Package Manager implementation to register.
|
|
951
|
-
* @param options Optional registration options.
|
|
952
|
-
* @param options.extensionId The extension ID of the calling extension. When this is not specified,
|
|
953
|
-
* or when the specified extension cannot be found, the extension ID will be automatically detected.
|
|
954
|
-
* @returns A disposable that can be used to unregister the package manager.
|
|
955
|
-
* @see {@link PackageManager}
|
|
956
|
-
*/
|
|
957
|
-
registerPackageManager(manager: PackageManager, options?: {
|
|
958
|
-
extensionId?: string;
|
|
959
|
-
}): Disposable;
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* Error thrown when a package manager cannot list available package versions.
|
|
963
|
-
*
|
|
964
|
-
* This distinguishes an *unsupported capability* from an *operational failure* (such as a
|
|
965
|
-
* failed command, a network error, or malformed/unparseable output). Consumers of
|
|
966
|
-
* {@link PythonPackageGetterApi.getPackageAvailableVersions} should treat this specific error
|
|
967
|
-
* as a signal to fall back to manual version entry, while letting any other error propagate.
|
|
968
|
-
*
|
|
969
|
-
* The {@link code} property carries a stable, string-literal discriminator so the error can be
|
|
970
|
-
* recognized reliably across extension bundle boundaries, where `instanceof` may fail because
|
|
971
|
-
* each bundle can load its own copy of this class. Prefer {@link isPackageVersionLookupNotSupportedError}
|
|
972
|
-
* over a bare `instanceof` check for that reason.
|
|
973
|
-
*/
|
|
974
|
-
export declare class PackageVersionLookupNotSupportedError extends Error {
|
|
975
|
-
/**
|
|
976
|
-
* Stable discriminator identifying this error type across bundle boundaries.
|
|
977
|
-
*/
|
|
978
|
-
readonly code = "PackageVersionLookupNotSupported";
|
|
979
|
-
constructor(message?: string);
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Type guard reporting whether an error represents unsupported package version lookup.
|
|
983
|
-
*
|
|
984
|
-
* Uses the stable {@link PackageVersionLookupNotSupportedError.code} discriminator, so it returns
|
|
985
|
-
* `true` even when the error crossed an extension bundle boundary and `instanceof` would fail.
|
|
986
|
-
*
|
|
987
|
-
* @param error The value to test.
|
|
988
|
-
* @returns `true` if `error` is a {@link PackageVersionLookupNotSupportedError} (or a structurally
|
|
989
|
-
* equivalent error carrying the same `code`).
|
|
990
|
-
*/
|
|
991
|
-
export declare function isPackageVersionLookupNotSupportedError(error: unknown): error is PackageVersionLookupNotSupportedError;
|
|
992
|
-
/**
|
|
993
|
-
* Controls how package version lookup failures are reported.
|
|
994
|
-
*/
|
|
995
|
-
export interface GetPackageAvailableVersionsOptions {
|
|
996
|
-
/**
|
|
997
|
-
* Determines whether lookup failures preserve the legacy `undefined` result or reject.
|
|
998
|
-
*
|
|
999
|
-
* - `legacy` resolves to `undefined` for unsupported lookups and operational failures.
|
|
1000
|
-
* This remains the default for backward compatibility, but may be removed in a future
|
|
1001
|
-
* major API version.
|
|
1002
|
-
* - `throw` rejects with {@link PackageVersionLookupNotSupportedError} for unsupported
|
|
1003
|
-
* lookups and propagates operational failures unchanged.
|
|
1004
|
-
*/
|
|
1005
|
-
errorMode?: 'legacy' | 'throw';
|
|
1006
|
-
}
|
|
1007
|
-
export interface PythonPackageGetterApi {
|
|
1008
|
-
/**
|
|
1009
|
-
* Refresh the list of packages in a Python Environment.
|
|
1010
|
-
*
|
|
1011
|
-
* @param environment The Python Environment for which the list of packages is to be refreshed.
|
|
1012
|
-
* @returns A promise that resolves when the list of packages has been refreshed.
|
|
1013
|
-
*/
|
|
1014
|
-
refreshPackages(environment: PythonEnvironment): Promise<void>;
|
|
1015
|
-
/**
|
|
1016
|
-
* Get the list of packages in a Python Environment.
|
|
1017
|
-
*
|
|
1018
|
-
* @param environment The Python Environment for which the list of packages is required.
|
|
1019
|
-
* @param options Optional settings for package retrieval.
|
|
1020
|
-
* @returns The list of packages in the Python Environment.
|
|
1021
|
-
*/
|
|
1022
|
-
getPackages(environment: PythonEnvironment, options?: GetPackagesOptions): Promise<Package[] | undefined>;
|
|
1023
|
-
/**
|
|
1024
|
-
* Get the list of available versions for a package, newest first.
|
|
1025
|
-
*
|
|
1026
|
-
* By default, this preserves the legacy behavior of resolving to `undefined` for unsupported
|
|
1027
|
-
* lookups and operational failures. Pass `{ errorMode: 'throw' }` to distinguish unsupported
|
|
1028
|
-
* capabilities from operational failures: unsupported lookups reject with
|
|
1029
|
-
* {@link PackageVersionLookupNotSupportedError}, while other failures propagate unchanged.
|
|
1030
|
-
*
|
|
1031
|
-
* @param environment The Python Environment context for the lookup.
|
|
1032
|
-
* @param packageName The name of the package to look up.
|
|
1033
|
-
* @param options Controls how lookup failures are reported.
|
|
1034
|
-
* @returns A promise that resolves to an array of {@link Pep440Version} objects (newest first),
|
|
1035
|
-
* or `undefined` in legacy mode when lookup is unsupported or fails.
|
|
1036
|
-
*/
|
|
1037
|
-
getPackageAvailableVersions(environment: PythonEnvironment, packageName: string, options: GetPackageAvailableVersionsOptions & {
|
|
1038
|
-
errorMode: 'throw';
|
|
1039
|
-
}): Promise<Pep440Version[]>;
|
|
1040
|
-
getPackageAvailableVersions(environment: PythonEnvironment, packageName: string, options?: GetPackageAvailableVersionsOptions): Promise<Pep440Version[] | undefined>;
|
|
1041
|
-
/**
|
|
1042
|
-
* Event raised when the list of packages in a Python Environment changes.
|
|
1043
|
-
* @see {@link DidChangePackagesEventArgs}
|
|
1044
|
-
*/
|
|
1045
|
-
onDidChangePackages: Event<DidChangePackagesEventArgs>;
|
|
1046
|
-
}
|
|
1047
|
-
export interface PythonPackageItemApi {
|
|
1048
|
-
/**
|
|
1049
|
-
* Create a package item from the provided package info.
|
|
1050
|
-
*
|
|
1051
|
-
* @param info The package info.
|
|
1052
|
-
* @param environment The Python Environment in which the package is installed.
|
|
1053
|
-
* @param manager The package manager that installed the package.
|
|
1054
|
-
* @returns The package item.
|
|
1055
|
-
*/
|
|
1056
|
-
createPackageItem(info: PackageInfo, environment: PythonEnvironment, manager: PackageManager): Package;
|
|
1057
|
-
}
|
|
1058
|
-
export interface PythonPackageManagementApi {
|
|
1059
|
-
/**
|
|
1060
|
-
* Install/Uninstall packages into a Python Environment.
|
|
1061
|
-
*
|
|
1062
|
-
* @param environment The Python Environment into which packages are to be installed.
|
|
1063
|
-
* @param packages The packages to install.
|
|
1064
|
-
* @param options Options for installing packages.
|
|
1065
|
-
*/
|
|
1066
|
-
managePackages(environment: PythonEnvironment, options: PackageManagementOptions): Promise<void>;
|
|
1067
|
-
}
|
|
1068
|
-
export interface PythonPackageManagerApi extends PythonPackageManagerRegistrationApi, PythonPackageGetterApi, PythonPackageManagementApi, PythonPackageItemApi {
|
|
1069
|
-
}
|
|
1070
|
-
export interface PythonProjectCreationApi {
|
|
1071
|
-
/**
|
|
1072
|
-
* Register a Python project creator.
|
|
1073
|
-
*
|
|
1074
|
-
* @param creator The project creator to register.
|
|
1075
|
-
* @returns A disposable that can be used to unregister the project creator.
|
|
1076
|
-
* @see {@link PythonProjectCreator}
|
|
1077
|
-
*/
|
|
1078
|
-
registerPythonProjectCreator(creator: PythonProjectCreator): Disposable;
|
|
1079
|
-
}
|
|
1080
|
-
export interface PythonProjectGetterApi {
|
|
1081
|
-
/**
|
|
1082
|
-
* Get all python projects.
|
|
1083
|
-
*/
|
|
1084
|
-
getPythonProjects(): readonly PythonProject[];
|
|
1085
|
-
/**
|
|
1086
|
-
* Get the python project for a given URI.
|
|
1087
|
-
*
|
|
1088
|
-
* @param uri The URI of the project
|
|
1089
|
-
* @returns The project or `undefined` if not found.
|
|
1090
|
-
*/
|
|
1091
|
-
getPythonProject(uri: Uri): PythonProject | undefined;
|
|
1092
|
-
}
|
|
1093
|
-
export interface PythonProjectModifyApi {
|
|
1094
|
-
/**
|
|
1095
|
-
* Add a python project or projects to the list of projects.
|
|
1096
|
-
*
|
|
1097
|
-
* @param projects The project or projects to add.
|
|
1098
|
-
*/
|
|
1099
|
-
addPythonProject(projects: PythonProject | PythonProject[]): void;
|
|
1100
|
-
/**
|
|
1101
|
-
* Remove a python project from the list of projects.
|
|
1102
|
-
*
|
|
1103
|
-
* @param project The project to remove.
|
|
1104
|
-
*/
|
|
1105
|
-
removePythonProject(project: PythonProject): void;
|
|
1106
|
-
/**
|
|
1107
|
-
* Event raised when python projects are added or removed.
|
|
1108
|
-
* @see {@link DidChangePythonProjectsEventArgs}
|
|
1109
|
-
*/
|
|
1110
|
-
onDidChangePythonProjects: Event<DidChangePythonProjectsEventArgs>;
|
|
1111
|
-
}
|
|
1112
|
-
/**
|
|
1113
|
-
* The API for interacting with Python projects. A project in python is any folder or file that is a contained
|
|
1114
|
-
* in some manner. For example, a PEP-723 compliant file can be treated as a project. A folder with a `pyproject.toml`,
|
|
1115
|
-
* or just python files can be treated as a project. All this allows you to do is set a python environment for that project.
|
|
1116
|
-
*
|
|
1117
|
-
* By default all `vscode.workspace.workspaceFolders` are treated as projects.
|
|
1118
|
-
*/
|
|
1119
|
-
export interface PythonProjectApi extends PythonProjectCreationApi, PythonProjectGetterApi, PythonProjectModifyApi {
|
|
1120
|
-
}
|
|
1121
|
-
export interface PythonTerminalCreateOptions extends TerminalOptions {
|
|
1122
|
-
/**
|
|
1123
|
-
* Whether to disable activation on create.
|
|
1124
|
-
*/
|
|
1125
|
-
disableActivation?: boolean;
|
|
1126
|
-
}
|
|
1127
|
-
export interface PythonTerminalCreateApi {
|
|
1128
|
-
/**
|
|
1129
|
-
* Creates a terminal and activates any (activatable) environment for the terminal.
|
|
1130
|
-
*
|
|
1131
|
-
* @param environment The Python environment to activate.
|
|
1132
|
-
* @param options Options for creating the terminal.
|
|
1133
|
-
*
|
|
1134
|
-
* Note: Non-activatable environments have no effect on the terminal.
|
|
1135
|
-
*/
|
|
1136
|
-
createTerminal(environment: PythonEnvironment, options: PythonTerminalCreateOptions): Promise<Terminal>;
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Options for running a Python script or module in a terminal.
|
|
1140
|
-
*
|
|
1141
|
-
* Example:
|
|
1142
|
-
* * Running Script: `python myscript.py --arg1`
|
|
1143
|
-
* ```typescript
|
|
1144
|
-
* {
|
|
1145
|
-
* args: ["myscript.py", "--arg1"]
|
|
1146
|
-
* }
|
|
1147
|
-
* ```
|
|
1148
|
-
* * Running a module: `python -m my_module --arg1`
|
|
1149
|
-
* ```typescript
|
|
1150
|
-
* {
|
|
1151
|
-
* args: ["-m", "my_module", "--arg1"]
|
|
1152
|
-
* }
|
|
1153
|
-
* ```
|
|
1154
|
-
*/
|
|
1155
|
-
export interface PythonTerminalExecutionOptions {
|
|
1156
|
-
/**
|
|
1157
|
-
* Current working directory for the terminal. This in only used to create the terminal.
|
|
1158
|
-
*/
|
|
1159
|
-
cwd: string | Uri;
|
|
1160
|
-
/**
|
|
1161
|
-
* Arguments to pass to the python executable.
|
|
1162
|
-
*/
|
|
1163
|
-
args?: string[];
|
|
1164
|
-
/**
|
|
1165
|
-
* Set `true` to show the terminal.
|
|
1166
|
-
*/
|
|
1167
|
-
show?: boolean;
|
|
1168
|
-
}
|
|
1169
|
-
export interface PythonTerminalRunApi {
|
|
1170
|
-
/**
|
|
1171
|
-
* Runs a Python script or module in a terminal. This API will create a terminal if one is not available to use.
|
|
1172
|
-
* If a terminal is available, it will be used to run the script or module.
|
|
1173
|
-
*
|
|
1174
|
-
* Note:
|
|
1175
|
-
* - If you restart VS Code, this will create a new terminal, this is a limitation of VS Code.
|
|
1176
|
-
* - If you close the terminal, this will create a new terminal.
|
|
1177
|
-
* - In cases of multi-root/project scenario, it will create a separate terminal for each project.
|
|
1178
|
-
*/
|
|
1179
|
-
runInTerminal(environment: PythonEnvironment, options: PythonTerminalExecutionOptions): Promise<Terminal>;
|
|
1180
|
-
/**
|
|
1181
|
-
* Runs a Python script or module in a dedicated terminal. This API will create a terminal if one is not available to use.
|
|
1182
|
-
* If a terminal is available, it will be used to run the script or module. This terminal will be dedicated to the script,
|
|
1183
|
-
* and selected based on the `terminalKey`.
|
|
1184
|
-
*
|
|
1185
|
-
* @param terminalKey A unique key to identify the terminal. For scripts you can use the Uri of the script file.
|
|
1186
|
-
*/
|
|
1187
|
-
runInDedicatedTerminal(terminalKey: Uri | string, environment: PythonEnvironment, options: PythonTerminalExecutionOptions): Promise<Terminal>;
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* Options for running a Python task.
|
|
1191
|
-
*
|
|
1192
|
-
* Example:
|
|
1193
|
-
* * Running Script: `python myscript.py --arg1`
|
|
1194
|
-
* ```typescript
|
|
1195
|
-
* {
|
|
1196
|
-
* args: ["myscript.py", "--arg1"]
|
|
1197
|
-
* }
|
|
1198
|
-
* ```
|
|
1199
|
-
* * Running a module: `python -m my_module --arg1`
|
|
1200
|
-
* ```typescript
|
|
1201
|
-
* {
|
|
1202
|
-
* args: ["-m", "my_module", "--arg1"]
|
|
1203
|
-
* }
|
|
1204
|
-
* ```
|
|
1205
|
-
*/
|
|
1206
|
-
export interface PythonTaskExecutionOptions {
|
|
1207
|
-
/**
|
|
1208
|
-
* Name of the task to run.
|
|
1209
|
-
*/
|
|
1210
|
-
name: string;
|
|
1211
|
-
/**
|
|
1212
|
-
* Arguments to pass to the python executable.
|
|
1213
|
-
*/
|
|
1214
|
-
args: string[];
|
|
1215
|
-
/**
|
|
1216
|
-
* The Python project to use for the task.
|
|
1217
|
-
*/
|
|
1218
|
-
project?: PythonProject;
|
|
1219
|
-
/**
|
|
1220
|
-
* Current working directory for the task. Default is the project directory for the script being run.
|
|
1221
|
-
*/
|
|
1222
|
-
cwd?: string;
|
|
1223
|
-
/**
|
|
1224
|
-
* Environment variables to set for the task.
|
|
1225
|
-
*/
|
|
1226
|
-
env?: {
|
|
1227
|
-
[key: string]: string;
|
|
1228
|
-
};
|
|
1229
|
-
}
|
|
1230
|
-
export interface PythonTaskRunApi {
|
|
1231
|
-
/**
|
|
1232
|
-
* Run a Python script or module as a task.
|
|
1233
|
-
*
|
|
1234
|
-
*/
|
|
1235
|
-
runAsTask(environment: PythonEnvironment, options: PythonTaskExecutionOptions): Promise<TaskExecution>;
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
* Options for running a Python script or module in the background.
|
|
1239
|
-
*/
|
|
1240
|
-
export interface PythonBackgroundRunOptions {
|
|
1241
|
-
/**
|
|
1242
|
-
* The Python environment to use for running the script or module.
|
|
1243
|
-
*/
|
|
1244
|
-
args: string[];
|
|
1245
|
-
/**
|
|
1246
|
-
* Current working directory for the script or module. Default is the project directory for the script being run.
|
|
1247
|
-
*/
|
|
1248
|
-
cwd?: string;
|
|
1249
|
-
/**
|
|
1250
|
-
* Environment variables to set for the script or module.
|
|
1251
|
-
*/
|
|
1252
|
-
env?: {
|
|
1253
|
-
[key: string]: string | undefined;
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1256
|
-
export interface PythonBackgroundRunApi {
|
|
1257
|
-
/**
|
|
1258
|
-
* Run a Python script or module in the background. This API will create a new process to run the script or module.
|
|
1259
|
-
*/
|
|
1260
|
-
runInBackground(environment: PythonEnvironment, options: PythonBackgroundRunOptions): Promise<PythonProcess>;
|
|
1261
|
-
}
|
|
1262
|
-
export interface PythonExecutionApi extends PythonTerminalCreateApi, PythonTerminalRunApi, PythonTaskRunApi, PythonBackgroundRunApi {
|
|
1263
|
-
}
|
|
1264
|
-
/**
|
|
1265
|
-
* Event arguments for when the monitored `.env` files or any other sources change.
|
|
1266
|
-
*/
|
|
1267
|
-
export interface DidChangeEnvironmentVariablesEventArgs {
|
|
1268
|
-
/**
|
|
1269
|
-
* The URI of the file that changed. No `Uri` means a non-file source of environment variables changed.
|
|
1270
|
-
*/
|
|
1271
|
-
uri?: Uri;
|
|
1272
|
-
/**
|
|
1273
|
-
* The type of change that occurred.
|
|
1274
|
-
*/
|
|
1275
|
-
changeType: FileChangeType;
|
|
1276
|
-
}
|
|
1277
|
-
export interface PythonEnvironmentVariablesApi {
|
|
1278
|
-
/**
|
|
1279
|
-
* Get environment variables for a workspace. This picks up `.env` file from the root of the
|
|
1280
|
-
* workspace.
|
|
1281
|
-
*
|
|
1282
|
-
* Order of overrides:
|
|
1283
|
-
* 1. `baseEnvVar` if given or `process.env`
|
|
1284
|
-
* 2. `.env` file from the "python.envFile" setting in the workspace.
|
|
1285
|
-
* 3. `.env` file at the root of the python project.
|
|
1286
|
-
* 4. `overrides` in the order provided.
|
|
1287
|
-
*
|
|
1288
|
-
* @param uri The URI of the project, workspace or a file in a for which environment variables are required.If not provided,
|
|
1289
|
-
* it fetches the environment variables for the global scope.
|
|
1290
|
-
* @param overrides Additional environment variables to override the defaults.
|
|
1291
|
-
* @param baseEnvVar The base environment variables that should be used as a starting point.
|
|
1292
|
-
*/
|
|
1293
|
-
getEnvironmentVariables(uri: Uri | undefined, overrides?: ({
|
|
1294
|
-
[key: string]: string | undefined;
|
|
1295
|
-
} | Uri)[], baseEnvVar?: {
|
|
1296
|
-
[key: string]: string | undefined;
|
|
1297
|
-
}): Promise<{
|
|
1298
|
-
[key: string]: string | undefined;
|
|
1299
|
-
}>;
|
|
1300
|
-
/**
|
|
1301
|
-
* Event raised when `.env` file changes or any other monitored source of env variable changes.
|
|
1302
|
-
*/
|
|
1303
|
-
onDidChangeEnvironmentVariables: Event<DidChangeEnvironmentVariablesEventArgs>;
|
|
1304
|
-
}
|
|
1305
|
-
/**
|
|
1306
|
-
* The API for interacting with Python environments, package managers, and projects.
|
|
1307
|
-
*/
|
|
1308
|
-
export interface PythonEnvironmentApi extends PythonEnvironmentManagerApi, PythonPackageManagerApi, PythonProjectApi, PythonExecutionApi, PythonEnvironmentVariablesApi {
|
|
1309
|
-
}
|
|
1310
|
-
export declare const EXTENSION_ID = "ms-python.vscode-python-envs";
|
|
1311
|
-
export declare namespace PythonEnvironments {
|
|
1312
|
-
/**
|
|
1313
|
-
* Returns the API exposed by the Python Environments extension in VS Code.
|
|
1314
|
-
*/
|
|
1315
|
-
function api(): Promise<PythonEnvironmentApi>;
|
|
1316
|
-
}
|