From e6e6085d0dbe7ab035f2f5398a9e2acfa5327504 Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Thu, 14 Sep 2023 13:29:32 -0700 Subject: [PATCH] pin ipykernel to v5.5.5 (#24429) --- .../src/jupyter/jupyterServerInstallation.ts | 14 ++++++++++---- .../src/test/python/jupyterInstallation.test.ts | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index ba0e5ce8c10b..080596f3f602 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -89,6 +89,12 @@ export const requiredNotebookPkg: PythonPkgDetails = { installExactVersion: true }; +export const requiredIpykernelPkg: PythonPkgDetails = { + name: 'ipykernel', + version: '5.5.5', + installExactVersion: true +}; + export const requiredPowershellPkg: PythonPkgDetails = { name: 'powershell-kernel', version: '0.1.4' @@ -149,11 +155,11 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { this._kernelSetupCache = new Map(); this._requiredKernelPackages = new Map(); - this._requiredKernelPackages.set(constants.ipykernelDisplayName, [requiredJupyterPkg, requiredNotebookPkg]); - this._requiredKernelPackages.set(constants.python3DisplayName, [requiredJupyterPkg, requiredNotebookPkg]); - this._requiredKernelPackages.set(constants.powershellDisplayName, [requiredJupyterPkg, requiredPowershellPkg, requiredNotebookPkg]); + this._requiredKernelPackages.set(constants.ipykernelDisplayName, [requiredJupyterPkg, requiredNotebookPkg, requiredIpykernelPkg]); + this._requiredKernelPackages.set(constants.python3DisplayName, [requiredJupyterPkg, requiredNotebookPkg, requiredIpykernelPkg]); + this._requiredKernelPackages.set(constants.powershellDisplayName, [requiredJupyterPkg, requiredPowershellPkg, requiredNotebookPkg, requiredIpykernelPkg]); - let allPackages = [requiredJupyterPkg, requiredNotebookPkg, requiredPowershellPkg]; + let allPackages = [requiredJupyterPkg, requiredNotebookPkg, requiredIpykernelPkg, requiredPowershellPkg]; this._requiredKernelPackages.set(constants.allKernelsName, allPackages); this._requiredPackagesSet = new Set(); diff --git a/extensions/notebook/src/test/python/jupyterInstallation.test.ts b/extensions/notebook/src/test/python/jupyterInstallation.test.ts index 04f34f60de6e..8d5f8d339ccd 100644 --- a/extensions/notebook/src/test/python/jupyterInstallation.test.ts +++ b/extensions/notebook/src/test/python/jupyterInstallation.test.ts @@ -11,7 +11,7 @@ import * as uuid from 'uuid'; import * as fs from 'fs-extra'; import * as request from 'request'; import * as utils from '../../common/utils'; -import { requiredJupyterPkg, JupyterServerInstallation, requiredPowershellPkg, PythonInstallSettings, PythonPkgDetails, requiredNotebookPkg } from '../../jupyter/jupyterServerInstallation'; +import { requiredJupyterPkg, JupyterServerInstallation, requiredPowershellPkg, PythonInstallSettings, PythonPkgDetails, requiredNotebookPkg, requiredIpykernelPkg } from '../../jupyter/jupyterServerInstallation'; import { powershellDisplayName, python3DisplayName, winPlatform } from '../../common/constants'; describe('Jupyter Server Installation', function () { @@ -226,12 +226,12 @@ describe('Jupyter Server Installation', function () { it('Get required packages test - Python 3 kernel', async function () { let packages = installation.getRequiredPackagesForKernel(python3DisplayName); - should(packages).be.deepEqual([requiredJupyterPkg, requiredNotebookPkg]); + should(packages).be.deepEqual([requiredJupyterPkg, requiredNotebookPkg, requiredIpykernelPkg]); }); it('Get required packages test - Powershell kernel', async function () { let packages = installation.getRequiredPackagesForKernel(powershellDisplayName); - should(packages).be.deepEqual([requiredJupyterPkg, requiredPowershellPkg, requiredNotebookPkg]); + should(packages).be.deepEqual([requiredJupyterPkg, requiredPowershellPkg, requiredNotebookPkg, requiredIpykernelPkg]); }); it('Install python test - Run install while Python is already running', async function () {