mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Skip prompting for package upgrade if a python install is already in progress. (#7717)
This commit is contained in:
@@ -34,6 +34,7 @@ const msgInstallPkgFinish = localize('msgInstallPkgFinish', "Notebook dependenci
|
|||||||
const msgPythonRunningError = localize('msgPythonRunningError', "Cannot overwrite an existing Python installation while python is running. Please close any active notebooks before proceeding.");
|
const msgPythonRunningError = localize('msgPythonRunningError', "Cannot overwrite an existing Python installation while python is running. Please close any active notebooks before proceeding.");
|
||||||
const msgPendingInstallError = localize('msgPendingInstallError', "Another Python installation is currently in progress.");
|
const msgPendingInstallError = localize('msgPendingInstallError', "Another Python installation is currently in progress.");
|
||||||
const msgSkipPythonInstall = localize('msgSkipPythonInstall', "Python already exists at the specific location. Skipping install.");
|
const msgSkipPythonInstall = localize('msgSkipPythonInstall', "Python already exists at the specific location. Skipping install.");
|
||||||
|
const msgSkippedPackageUpgrade = localize('msgSkippedPackageUpgrade', "Skipping notebook package upgrade since another Python install is currently in progress.");
|
||||||
function msgDependenciesInstallationFailed(errorMessage: string): string { return localize('msgDependenciesInstallationFailed', "Installing Notebook dependencies failed with error: {0}", errorMessage); }
|
function msgDependenciesInstallationFailed(errorMessage: string): string { return localize('msgDependenciesInstallationFailed', "Installing Notebook dependencies failed with error: {0}", errorMessage); }
|
||||||
function msgDownloadPython(platform: string, pythonDownloadUrl: string): string { return localize('msgDownloadPython', "Downloading local python for platform: {0} to {1}", platform, pythonDownloadUrl); }
|
function msgDownloadPython(platform: string, pythonDownloadUrl: string): string { return localize('msgDownloadPython', "Downloading local python for platform: {0} to {1}", platform, pythonDownloadUrl); }
|
||||||
|
|
||||||
@@ -388,8 +389,18 @@ export class JupyterServerInstallation {
|
|||||||
/**
|
/**
|
||||||
* Prompts user to upgrade certain python packages if they're below the minimum expected version.
|
* Prompts user to upgrade certain python packages if they're below the minimum expected version.
|
||||||
*/
|
*/
|
||||||
public promptForPackageUpgrade(): Promise<void> {
|
public async promptForPackageUpgrade(): Promise<void> {
|
||||||
return this.upgradePythonPackages(true, false);
|
if (this._installInProgress) {
|
||||||
|
this.apiWrapper.showInfoMessage(msgSkippedPackageUpgrade);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._installInProgress = true;
|
||||||
|
try {
|
||||||
|
await this.upgradePythonPackages(true, false);
|
||||||
|
} finally {
|
||||||
|
this._installInProgress = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async upgradePythonPackages(promptForUpgrade: boolean, forceInstall: boolean): Promise<void> {
|
private async upgradePythonPackages(promptForUpgrade: boolean, forceInstall: boolean): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user