Update Python install messages to differentiate between download completion and install completion. (#5114)

This commit is contained in:
Cory Rivera
2019-04-18 16:52:50 -07:00
committed by GitHub
parent f33b95ee82
commit 880e3e10da

View File

@@ -21,20 +21,20 @@ import { Deferred } from '../common/promise';
import { ConfigurePythonDialog } from '../dialog/configurePythonDialog'; import { ConfigurePythonDialog } from '../dialog/configurePythonDialog';
const localize = nls.loadMessageBundle(); const localize = nls.loadMessageBundle();
const msgPythonInstallationProgress = localize('msgPythonInstallationProgress', 'Python installation is in progress'); const msgInstallPkgProgress = localize('msgInstallPkgProgress', "Notebook dependencies installation is in progress");
const msgPythonInstallationComplete = localize('msgPythonInstallationComplete', 'Python installation is complete'); const msgPythonDownloadComplete = localize('msgPythonDownloadComplete', "Python download is complete");
const msgPythonDownloadError = localize('msgPythonDownloadError', 'Error while downloading python setup'); const msgPythonDownloadError = localize('msgPythonDownloadError', "Error while downloading python setup");
const msgPythonDownloadPending = localize('msgPythonDownloadPending', 'Downloading python package'); const msgPythonDownloadPending = localize('msgPythonDownloadPending', "Downloading python package");
const msgPythonUnpackPending = localize('msgPythonUnpackPending', 'Unpacking python package'); const msgPythonUnpackPending = localize('msgPythonUnpackPending', "Unpacking python package");
const msgPythonDirectoryError = localize('msgPythonDirectoryError', 'Error while creating python installation directory'); const msgPythonDirectoryError = localize('msgPythonDirectoryError', "Error while creating python installation directory");
const msgPythonUnpackError = localize('msgPythonUnpackError', 'Error while unpacking python bundle'); const msgPythonUnpackError = localize('msgPythonUnpackError', "Error while unpacking python bundle");
const msgTaskName = localize('msgTaskName', 'Installing Notebook dependencies'); const msgTaskName = localize('msgTaskName', "Installing Notebook dependencies");
const msgInstallPkgStart = localize('msgInstallPkgStart', 'Installing Notebook dependencies, see Tasks view for more information'); const msgInstallPkgStart = localize('msgInstallPkgStart', "Installing Notebook dependencies, see Tasks view for more information");
const msgInstallPkgFinish = localize('msgInstallPkgFinish', 'Notebook dependencies installation is complete'); const msgInstallPkgFinish = localize('msgInstallPkgFinish', "Notebook dependencies installation is complete");
const msgPythonRunningError = localize('msgPythonRunningError', 'Cannot overwrite existing Python installation while python is running.'); const msgPythonRunningError = localize('msgPythonRunningError', "Cannot overwrite existing Python installation while python is running.");
const msgPendingInstallError = localize('msgPendingInstallError', 'Another Python installation is currently in progress.'); const msgPendingInstallError = localize('msgPendingInstallError', "Another Python installation 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); }
export default class JupyterServerInstallation { export default class JupyterServerInstallation {
/** /**
@@ -73,15 +73,18 @@ export default class JupyterServerInstallation {
if (!fs.existsSync(this._pythonExecutable) || this._forceInstall) { if (!fs.existsSync(this._pythonExecutable) || this._forceInstall) {
window.showInformationMessage(msgInstallPkgStart); window.showInformationMessage(msgInstallPkgStart);
this.outputChannel.show(true); this.outputChannel.show(true);
this.outputChannel.appendLine(msgPythonInstallationProgress); this.outputChannel.appendLine(msgInstallPkgProgress);
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonInstallationProgress); backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgInstallPkgProgress);
await this.installPythonPackage(backgroundOperation); await this.installPythonPackage(backgroundOperation);
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonInstallationComplete); this.outputChannel.appendLine(msgPythonDownloadComplete);
this.outputChannel.appendLine(msgPythonInstallationComplete); backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonDownloadComplete);
// Install jupyter on Windows because local python is not bundled with jupyter unlike linux and MacOS. // Install jupyter on Windows because local python is not bundled with jupyter unlike linux and MacOS.
await this.installJupyterProsePackage(); await this.installJupyterProsePackage();
await this.installSparkMagic(); await this.installSparkMagic();
this.outputChannel.appendLine(msgInstallPkgFinish);
backgroundOperation.updateStatus(azdata.TaskStatus.Succeeded, msgInstallPkgFinish); backgroundOperation.updateStatus(azdata.TaskStatus.Succeeded, msgInstallPkgFinish);
window.showInformationMessage(msgInstallPkgFinish); window.showInformationMessage(msgInstallPkgFinish);
} }
@@ -314,9 +317,9 @@ export default class JupyterServerInstallation {
let requirements = path.join(this._pythonPackageDir, 'requirements.txt'); let requirements = path.join(this._pythonPackageDir, 'requirements.txt');
let installJupyterCommand = `"${this._pythonExecutable}" -m pip install --no-index -r "${requirements}" --find-links "${this._pythonPackageDir}" --no-warn-script-location`; let installJupyterCommand = `"${this._pythonExecutable}" -m pip install --no-index -r "${requirements}" --find-links "${this._pythonPackageDir}" --no-warn-script-location`;
this.outputChannel.show(true); this.outputChannel.show(true);
this.outputChannel.appendLine(localize('msgInstallStart', 'Installing required packages to run Notebooks...')); this.outputChannel.appendLine(localize('msgInstallStart', "Installing required packages to run Notebooks..."));
await utils.executeStreamedCommand(installJupyterCommand, this.outputChannel); await utils.executeStreamedCommand(installJupyterCommand, this.outputChannel);
this.outputChannel.appendLine(localize('msgJupyterInstallDone', '... Jupyter installation complete.')); this.outputChannel.appendLine(localize('msgJupyterInstallDone', "... Jupyter installation complete."));
} else { } else {
return Promise.resolve(); return Promise.resolve();
} }
@@ -327,7 +330,7 @@ export default class JupyterServerInstallation {
let sparkWheel = path.join(this._pythonPackageDir, `sparkmagic-${constants.sparkMagicVersion}-py3-none-any.whl`); let sparkWheel = path.join(this._pythonPackageDir, `sparkmagic-${constants.sparkMagicVersion}-py3-none-any.whl`);
let installSparkMagic = `"${this._pythonExecutable}" -m pip install --no-index "${sparkWheel}" --find-links "${this._pythonPackageDir}" --no-warn-script-location`; let installSparkMagic = `"${this._pythonExecutable}" -m pip install --no-index "${sparkWheel}" --find-links "${this._pythonPackageDir}" --no-warn-script-location`;
this.outputChannel.show(true); this.outputChannel.show(true);
this.outputChannel.appendLine(localize('msgInstallingSpark', 'Installing SparkMagic...')); this.outputChannel.appendLine(localize('msgInstallingSpark', "Installing SparkMagic..."));
await utils.executeStreamedCommand(installSparkMagic, this.outputChannel); await utils.executeStreamedCommand(installSparkMagic, this.outputChannel);
} else { } else {
return Promise.resolve(); return Promise.resolve();