Update Python to 3.8.8 (#15278)

* update python fwlinks and remove bundle ver

* start fixing path for users with python 36

* prompt user for python version upgrade

* update python path after removing 3.6

* prompt users to upgrade and show pkg warning

* make prompt async

* remove python bundle ver from ML extension

* shutdown python 3.6 before deleting

* check useExistingPython before update prompt

* add dont ask again option

* remove 3.6 after installing 3.8

fix merge conflict

* give option to remove python36

* list user installed pip packages in warning

* create notebook to install pip packages

* update getPythonExePath method and add comments

* clean up code

* add comments

* pr comments

* add comment

* remove option to keep python36

* shutdown active servers before removing python36

* fix error removing old python w/ path change

* update to 3.8.10

* restart sessions for mac/linux
This commit is contained in:
Lucy Zhang
2021-05-19 18:15:07 -04:00
committed by GitHub
parent 02770e21ee
commit 43e8fde775
14 changed files with 205 additions and 91 deletions

View File

@@ -6,12 +6,10 @@
import * as should from 'should';
import * as vscode from 'vscode';
import * as assert from 'assert';
import * as path from 'path';
import 'mocha';
import { JupyterController } from '../jupyter/jupyterController';
import { JupyterServerInstallation, PythonPkgDetails } from '../jupyter/jupyterServerInstallation';
import { pythonBundleVersion } from '../common/constants';
import { executeStreamedCommand, sortPackageVersions } from '../common/utils';
describe('Notebook Extension Python Installation', function () {
@@ -59,16 +57,15 @@ describe('Notebook Extension Python Installation', function () {
console.log('Uninstalling existing pip dependencies');
let install = jupyterController.jupyterInstallation;
let pythonExe = JupyterServerInstallation.getPythonExePath(pythonInstallDir, false);
let pythonExe = JupyterServerInstallation.getPythonExePath(pythonInstallDir);
let command = `"${pythonExe}" -m pip uninstall -y jupyter pandas sparkmagic`;
await executeStreamedCommand(command, { env: install.execOptions.env }, install.outputChannel);
console.log('Uninstalling existing pip dependencies is done');
console.log('Start Existing Python Installation');
let existingPythonPath = path.join(pythonInstallDir, pythonBundleVersion);
await install.startInstallProcess(false, { installPath: existingPythonPath, existingPython: true, packages: [] });
await install.startInstallProcess(false, { installPath: pythonInstallDir, existingPython: true, packages: [] });
should(JupyterServerInstallation.isPythonInstalled()).be.true();
should(JupyterServerInstallation.getPythonInstallPath()).be.equal(existingPythonPath);
should(JupyterServerInstallation.getPythonInstallPath()).be.equal(pythonInstallDir);
should(JupyterServerInstallation.getExistingPythonSetting()).be.true();
// Redo "new" install to restore original settings.