don't show python upgrade prompt multiple times (#16080)

This commit is contained in:
Lucy Zhang
2021-07-15 06:50:46 -07:00
committed by GitHub
parent 351a55121d
commit 63d4cc0e80

View File

@@ -121,6 +121,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
private _oldPythonExecutable: string | undefined;
private _oldPythonInstallationPath: string | undefined;
private _oldUserInstalledPipPackages: PythonPkgDetails[] = [];
private _upgradePrompted: boolean = false;
private _installInProgress: boolean;
private _installCompletion: Deferred<void>;
@@ -506,7 +507,8 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
let isPythonInstalled = JupyterServerInstallation.isPythonInstalled();
// If the latest version of ADS-Python is not installed, then prompt the user to upgrade
if (isPythonInstalled && !this._usingExistingPython && utils.compareVersions(await this.getInstalledPythonVersion(this._pythonExecutable), constants.pythonVersion) < 0) {
if (!this._upgradePrompted && isPythonInstalled && !this._usingExistingPython && utils.compareVersions(await this.getInstalledPythonVersion(this._pythonExecutable), constants.pythonVersion) < 0) {
this._upgradePrompted = true;
this.promptUserForPythonUpgrade();
}