mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Improve Configure Python wizard experience for unfamiliar kernel names. (#17272)
This commit is contained in:
@@ -42,6 +42,7 @@ export const localhostName = 'localhost';
|
||||
export const localhostTitle = localize('managePackages.localhost', "localhost");
|
||||
export const PackageNotFoundError = localize('managePackages.packageNotFound', "Could not find the specified package");
|
||||
|
||||
export const ipykernelDisplayName = 'Python 3 (ipykernel)';
|
||||
export const python3DisplayName = 'Python 3';
|
||||
export const pysparkDisplayName = 'PySpark';
|
||||
export const sparkScalaDisplayName = 'Spark | Scala';
|
||||
|
||||
@@ -27,7 +27,7 @@ export class ConfigurePathPage extends BasePage {
|
||||
public async initialize(): Promise<boolean> {
|
||||
let wizardDescription: string;
|
||||
if (this.model.kernelName) {
|
||||
wizardDescription = localize('configurePython.descriptionWithKernel', "The {0} kernel requires a Python runtime to be configured and dependencies to be installed.", this.model.kernelName);
|
||||
wizardDescription = localize('configurePython.descriptionWithKernel', "The '{0}' kernel requires a Python runtime to be configured and dependencies to be installed.", this.model.kernelName);
|
||||
} else {
|
||||
wizardDescription = localize('configurePython.descriptionWithoutKernel', "Notebook kernels require a Python runtime to be configured and dependencies to be installed.");
|
||||
}
|
||||
|
||||
@@ -128,6 +128,13 @@ export class ConfigurePythonWizard {
|
||||
await this._wizard.close();
|
||||
}
|
||||
|
||||
public showInfoMessage(errorMsg: string) {
|
||||
this._wizard.message = <azdata.window.DialogMessage>{
|
||||
text: errorMsg,
|
||||
level: azdata.window.MessageLevel.Information
|
||||
};
|
||||
}
|
||||
|
||||
public showErrorMessage(errorMsg: string) {
|
||||
this._wizard.message = <azdata.window.DialogMessage>{
|
||||
text: errorMsg,
|
||||
|
||||
@@ -158,9 +158,9 @@ export class PickPackagesPage extends BasePage {
|
||||
this.requiredPackagesTable.data = requiredPkgVersions.map(pkg => [pkg.name, pkg.existingVersion ?? '-', pkg.requiredVersion]);
|
||||
this.model.packagesToInstall = requiredPackages;
|
||||
} else {
|
||||
this.instance.showErrorMessage(localize('msgUnsupportedKernel', "Could not retrieve packages for kernel {0}", kernelName));
|
||||
this.instance.showInfoMessage(localize('msgNoRequirementsForKernel', "No packages are required by default for the kernel '{0}'", kernelName));
|
||||
this.requiredPackagesTable.data = [['-', '-', '-']];
|
||||
this.model.packagesToInstall = undefined;
|
||||
this.model.packagesToInstall = [];
|
||||
}
|
||||
} finally {
|
||||
this.instance.wizard.doneButton.enabled = true;
|
||||
|
||||
@@ -154,6 +154,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
this._kernelSetupCache = new Map<string, boolean>();
|
||||
this._requiredKernelPackages = new Map<string, PythonPkgDetails[]>();
|
||||
|
||||
this._requiredKernelPackages.set(constants.ipykernelDisplayName, [requiredJupyterPkg]);
|
||||
this._requiredKernelPackages.set(constants.python3DisplayName, [requiredJupyterPkg]);
|
||||
this._requiredKernelPackages.set(constants.powershellDisplayName, [requiredJupyterPkg, requiredPowershellPkg]);
|
||||
this._requiredKernelPackages.set(constants.pysparkDisplayName, requiredSparkPackages);
|
||||
|
||||
Reference in New Issue
Block a user