@@ -143,6 +143,33 @@ export interface PythonEnvironmentId {
143
143
managerId : string ;
144
144
}
145
145
146
+ /**
147
+ * Display information for an environment group.
148
+ */
149
+ export interface EnvironmentGroupInfo {
150
+ /**
151
+ * The name of the environment group. This is used as an identifier for the group.
152
+ *
153
+ * Note: The first instance of the group with the given name will be used in the UI.
154
+ */
155
+ readonly name : string ;
156
+
157
+ /**
158
+ * The description of the environment group.
159
+ */
160
+ readonly description ?: string ;
161
+
162
+ /**
163
+ * The tooltip for the environment group, which can be a string or a Markdown string.
164
+ */
165
+ readonly tooltip ?: string | MarkdownString ;
166
+
167
+ /**
168
+ * The icon path for the environment group, which can be a string, Uri, or an object with light and dark theme paths.
169
+ */
170
+ readonly iconPath ?: IconPath ;
171
+ }
172
+
146
173
/**
147
174
* Interface representing information about a Python environment.
148
175
*/
@@ -202,6 +229,11 @@ export interface PythonEnvironmentInfo {
202
229
* This is required by extension like Jupyter, Pylance, and other extensions to provide better experience with python.
203
230
*/
204
231
readonly sysPrefix : string ;
232
+
233
+ /**
234
+ * Optional `group` for this environment. This is used to group environments in the Environment Manager UI.
235
+ */
236
+ readonly group ?: string | EnvironmentGroupInfo ;
205
237
}
206
238
207
239
/**
@@ -218,7 +250,7 @@ export interface PythonEnvironment extends PythonEnvironmentInfo {
218
250
* Type representing the scope for setting a Python environment.
219
251
* Can be undefined or a URI.
220
252
*/
221
- export type SetEnvironmentScope = undefined | Uri ;
253
+ export type SetEnvironmentScope = undefined | Uri | Uri [ ] ;
222
254
223
255
/**
224
256
* Type representing the scope for getting a Python environment.
@@ -316,7 +348,9 @@ export interface EnvironmentManager {
316
348
readonly displayName ?: string ;
317
349
318
350
/**
319
- * The preferred package manager ID for the environment manager.
351
+ * The preferred package manager ID for the environment manager. This is a combination
352
+ * of publisher id, extension id, and {@link EnvironmentManager.name package manager name}.
353
+ * `<publisher-id>.<extension-id>:<package-manager-name>`
320
354
*
321
355
* @example
322
356
* 'ms-python.python:pip'
@@ -563,15 +597,15 @@ export interface PackageManager {
563
597
* @param packages - The packages to install.
564
598
* @returns A promise that resolves when the installation is complete.
565
599
*/
566
- install ( environment : PythonEnvironment , packages : string [ ] , options : PackageInstallOptions ) : Promise < void > ;
600
+ install ( environment : PythonEnvironment , packages ? : string [ ] , options ? : PackageInstallOptions ) : Promise < void > ;
567
601
568
602
/**
569
603
* Uninstalls packages from the specified Python environment.
570
604
* @param environment - The Python environment from which to uninstall packages.
571
605
* @param packages - The packages to uninstall, which can be an array of packages or strings.
572
606
* @returns A promise that resolves when the uninstall is complete.
573
607
*/
574
- uninstall ( environment : PythonEnvironment , packages : Package [ ] | string [ ] ) : Promise < void > ;
608
+ uninstall ( environment : PythonEnvironment , packages ? : Package [ ] | string [ ] ) : Promise < void > ;
575
609
576
610
/**
577
611
* Refreshes the package list for the specified Python environment.
@@ -587,17 +621,6 @@ export interface PackageManager {
587
621
*/
588
622
getPackages ( environment : PythonEnvironment ) : Promise < Package [ ] | undefined > ;
589
623
590
- /**
591
- * Get a list of installable items for a Python project.
592
- *
593
- * @param environment The Python environment for which to get installable items.
594
- *
595
- * Note: An environment can be used by multiple projects, so the installable items returned.
596
- * should be for the environment. If you want to do it for a particular project, then you should
597
- * ask user to select a project, and filter the installable items based on the project.
598
- */
599
- getInstallable ?( environment : PythonEnvironment ) : Promise < Installable [ ] > ;
600
-
601
624
/**
602
625
* Event that is fired when packages change.
603
626
*/
@@ -717,45 +740,6 @@ export interface PackageInstallOptions {
717
740
upgrade ?: boolean ;
718
741
}
719
742
720
- export interface Installable {
721
- /**
722
- * The display name of the package, requirements, pyproject.toml or any other project file.
723
- */
724
- readonly displayName : string ;
725
-
726
- /**
727
- * Arguments passed to the package manager to install the package.
728
- *
729
- * @example
730
- * ['debugpy==1.8.7'] for `pip install debugpy==1.8.7`.
731
- * ['--pre', 'debugpy'] for `pip install --pre debugpy`.
732
- * ['-r', 'requirements.txt'] for `pip install -r requirements.txt`.
733
- */
734
- readonly args : string [ ] ;
735
-
736
- /**
737
- * Installable group name, this will be used to group installable items in the UI.
738
- *
739
- * @example
740
- * `Requirements` for any requirements file.
741
- * `Packages` for any package.
742
- */
743
- readonly group ?: string ;
744
-
745
- /**
746
- * Description about the installable item. This can also be path to the requirements,
747
- * version of the package, or any other project file path.
748
- */
749
- readonly description ?: string ;
750
-
751
- /**
752
- * External Uri to the package on pypi or docs.
753
- * @example
754
- * https://pypi.org/project/debugpy/ for `debugpy`.
755
- */
756
- readonly uri ?: Uri ;
757
- }
758
-
759
743
export interface PythonProcess {
760
744
/**
761
745
* The process ID of the Python process.
0 commit comments