Manage Package Dialog Refactor (#8473)

* Refactoring Manage Packages dialog so that other extensions can contribute to it by registering package mange providers for different location and package type
This commit is contained in:
Leila Lali
2019-12-05 10:26:50 -08:00
committed by GitHub
parent a898c46e74
commit 0d9353d99e
15 changed files with 1406 additions and 136 deletions

View File

@@ -38,7 +38,22 @@ function msgDependenciesInstallationFailed(errorMessage: string): string { retur
function msgDownloadPython(platform: string, pythonDownloadUrl: string): string { return localize('msgDownloadPython', "Downloading local python for platform: {0} to {1}", platform, pythonDownloadUrl); }
function msgPackageRetrievalFailed(errorMessage: string): string { return localize('msgPackageRetrievalFailed', "Encountered an error when trying to retrieve list of installed packages: {0}", errorMessage); }
export class JupyterServerInstallation {
export interface IJupyterServerInstallation {
installCondaPackages(packages: PythonPkgDetails[], useMinVersion: boolean): Promise<void>;
configurePackagePaths(): Promise<void>;
startInstallProcess(forceInstall: boolean, installSettings?: { installPath: string, existingPython: boolean }): Promise<void>;
getInstalledPipPackages(): Promise<PythonPkgDetails[]>;
getInstalledCondaPackages(): Promise<PythonPkgDetails[]>;
uninstallCondaPackages(packages: PythonPkgDetails[]): Promise<void>;
usingConda: boolean;
getCondaExePath(): string;
executeBufferedCommand(command: string): Promise<string>;
executeStreamedCommand(command: string): Promise<void>;
installPipPackages(packages: PythonPkgDetails[], useMinVersion: boolean): Promise<void>;
uninstallPipPackages(packages: PythonPkgDetails[]): Promise<void>;
pythonExecutable: string;
}
export class JupyterServerInstallation implements IJupyterServerInstallation {
public apiWrapper: ApiWrapper;
public extensionPath: string;
public pythonBinPath: string;
@@ -625,7 +640,7 @@ export class JupyterServerInstallation {
}
}
private async executeStreamedCommand(command: string): Promise<void> {
public async executeStreamedCommand(command: string): Promise<void> {
await utils.executeStreamedCommand(command, { env: this.execOptions.env }, this.outputChannel);
}