Changes to use bundled python package (#12967)

* Set python path in kernel specs when running on SAW devices.

* Use tab spacer for kernel json.

* Update path to jupyter kernelspec.

* removing the kernelspec write

* Changed powershell kernel.json to use  appdata folder

* Addressed PR and added try catches around the code.

* removed redundant try catch

* removed redundant try catch

* removed another try catch

* removed space

Co-authored-by: Cory Rivera <corivera@microsoft.com>
This commit is contained in:
rajeshka
2020-10-19 18:20:48 -07:00
committed by GitHub
parent eb36a275a2
commit c4f649a849
4 changed files with 47 additions and 1 deletions

View File

@@ -174,12 +174,20 @@ export class PerFolderServerInstance implements IServerInstance {
}
private async copyKernelsToSystemJupyterDirs(): Promise<void> {
let kernelsExtensionSource = path.join(this.options.install.extensionPath, 'kernels');
let kernelsExtensionSource: string;
if (this.options.install.runningOnSaw) {
kernelsExtensionSource = path.join(this.options.install.extensionPath, 'saw-kernels');
} else {
kernelsExtensionSource = path.join(this.options.install.extensionPath, 'kernels');
}
this._systemJupyterDir = path.join(this.getSystemJupyterHomeDir(), 'kernels');
if (!(await utils.exists(this._systemJupyterDir))) {
await utils.mkDir(this._systemJupyterDir, this.options.install.outputChannel);
}
await fs.copy(kernelsExtensionSource, this._systemJupyterDir);
if (this.options.install.runningOnSaw) {
await this.options.install.updateKernelSpecPaths(this._systemJupyterDir);
}
}
private getSystemJupyterHomeDir(): string {