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

@@ -174,7 +174,7 @@ const RESTART_JUPYTER_NOTEBOOK_SESSIONS = 'notebook.action.restartJupyterNoteboo
CommandsRegistry.registerCommand({
id: RESTART_JUPYTER_NOTEBOOK_SESSIONS,
handler: async (accessor: ServicesAccessor) => {
handler: async (accessor: ServicesAccessor, restartJupyterServer: boolean = true) => {
const editorService: IEditorService = accessor.get(IEditorService);
const editors: readonly IEditorInput[] = editorService.editors;
let jupyterServerRestarted: boolean = false;
@@ -184,7 +184,7 @@ CommandsRegistry.registerCommand({
let model: INotebookModel = editor.notebookModel;
if (model.providerId === 'jupyter' && model.clientSession.isReady) {
// Jupyter server needs to be restarted so that the correct Python installation is used
if (!jupyterServerRestarted) {
if (!jupyterServerRestarted && restartJupyterServer) {
let jupyterNotebookManager: INotebookManager = model.notebookManagers.find(x => x.providerId === 'jupyter');
// Shutdown all current Jupyter sessions before stopping the server
await jupyterNotebookManager.sessionManager.shutdownAll();
@@ -204,6 +204,29 @@ CommandsRegistry.registerCommand({
}
});
const STOP_JUPYTER_NOTEBOOK_SESSIONS = 'notebook.action.stopJupyterNotebookSessions';
CommandsRegistry.registerCommand({
id: STOP_JUPYTER_NOTEBOOK_SESSIONS,
handler: async (accessor: ServicesAccessor) => {
const editorService: IEditorService = accessor.get(IEditorService);
const editors: readonly IEditorInput[] = editorService.editors;
for (let editor of editors) {
if (editor instanceof NotebookInput) {
let model: INotebookModel = editor.notebookModel;
if (model?.providerId === 'jupyter') {
let jupyterNotebookManager: INotebookManager = model.notebookManagers.find(x => x.providerId === 'jupyter');
await jupyterNotebookManager.sessionManager.shutdownAll();
jupyterNotebookManager.sessionManager.dispose();
await jupyterNotebookManager.serverManager.stopServer();
return;
}
}
}
}
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: TOGGLE_TAB_FOCUS_COMMAND_ID,