@@ -575,20 +575,12 @@ export interface PackageManager {
575575 log ?: LogOutputChannel ;
576576
577577 /**
578- * Installs packages in the specified Python environment.
578+ * Installs/Uninstall packages in the specified Python environment.
579579 * @param environment - The Python environment in which to install packages.
580580 * @param packages - The packages to install.
581581 * @returns A promise that resolves when the installation is complete.
582582 */
583- install ( environment : PythonEnvironment , packages ?: string [ ] , options ?: PackageInstallOptions ) : Promise < void > ;
584-
585- /**
586- * Uninstalls packages from the specified Python environment.
587- * @param environment - The Python environment from which to uninstall packages.
588- * @param packages - The packages to uninstall, which can be an array of packages or strings.
589- * @returns A promise that resolves when the uninstall is complete.
590- */
591- uninstall ( environment : PythonEnvironment , packages ?: Package [ ] | string [ ] ) : Promise < void > ;
583+ manage ( environment : PythonEnvironment , options : PackageManagementOptions ) : Promise < void > ;
592584
593585 /**
594586 * Refreshes the package list for the specified Python environment.
@@ -713,20 +705,47 @@ export interface DidChangePythonProjectsEventArgs {
713705 removed : PythonProject [ ] ;
714706}
715707
716- /**
717- * Options for package installation.
718- */
719- export interface PackageInstallOptions {
720- /**
721- * Upgrade the packages if it is already installed.
722- */
723- upgrade ?: boolean ;
708+ export type PackageManagementOptions =
709+ | {
710+ /**
711+ * Upgrade the packages if it is already installed.
712+ */
713+ upgrade ?: boolean ;
724714
725- /**
726- * Show option to skip package installation
727- */
728- showSkipOption ?: boolean ;
729- }
715+ /**
716+ * Show option to skip package installation
717+ */
718+ showSkipOption ?: boolean ;
719+ /**
720+ * The list of packages to install.
721+ */
722+ install : string [ ] ;
723+
724+ /**
725+ * The list of packages to uninstall.
726+ */
727+ uninstall ?: string [ ] ;
728+ }
729+ | {
730+ /**
731+ * Upgrade the packages if it is already installed.
732+ */
733+ upgrade ?: boolean ;
734+
735+ /**
736+ * Show option to skip package installation
737+ */
738+ showSkipOption ?: boolean ;
739+ /**
740+ * The list of packages to install.
741+ */
742+ install ?: string [ ] ;
743+
744+ /**
745+ * The list of packages to uninstall.
746+ */
747+ uninstall : string [ ] ;
748+ } ;
730749
731750export interface PythonProcess {
732751 /**
@@ -909,21 +928,13 @@ export interface PythonPackageItemApi {
909928
910929export interface PythonPackageManagementApi {
911930 /**
912- * Install packages into a Python Environment.
931+ * Install/Uninstall packages into a Python Environment.
913932 *
914933 * @param environment The Python Environment into which packages are to be installed.
915934 * @param packages The packages to install.
916935 * @param options Options for installing packages.
917936 */
918- installPackages ( environment : PythonEnvironment , packages : string [ ] , options ?: PackageInstallOptions ) : Promise < void > ;
919-
920- /**
921- * Uninstall packages from a Python Environment.
922- *
923- * @param environment The Python Environment from which packages are to be uninstalled.
924- * @param packages The packages to uninstall.
925- */
926- uninstallPackages ( environment : PythonEnvironment , packages : PackageInfo [ ] | string [ ] ) : Promise < void > ;
937+ managePackages ( environment : PythonEnvironment , options : PackageManagementOptions ) : Promise < void > ;
927938}
928939
929940export interface PythonPackageManagerApi
0 commit comments