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

@@ -13,10 +13,10 @@ export const extensionOutputChannelName = 'Notebooks';
export const notebookCommandNew = 'notebook.command.new';
// JUPYTER CONFIG //////////////////////////////////////////////////////////
export const pythonBundleVersion = '0.0.1';
export const pythonVersion = '3.6.6';
export const pythonVersion = '3.8.10';
export const pythonPathConfigKey = 'pythonPath';
export const existingPythonConfigKey = 'useExistingPython';
export const dontPromptPythonUpdate = 'dontPromptPythonUpdate';
export const notebookConfigKey = 'notebook';
export const trustedBooksConfigKey = 'trustedBooks';
export const pinnedBooksConfigKey = 'pinnedNotebooks';
@@ -76,9 +76,9 @@ export enum NavigationProviders {
export const unsavedBooksContextKey = 'unsavedBooks';
export const showPinnedBooksContextKey = 'showPinnedbooks';
export const pythonWindowsInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2110625';
export const pythonMacInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2128152';
export const pythonLinuxInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2110524';
export const pythonWindowsInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2163338';
export const pythonMacInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2163337';
export const pythonLinuxInstallUrl = 'https://go.microsoft.com/fwlink/?linkid=2163336';
export const notebookLanguages = ['notebook', 'ipynb'];

View File

@@ -19,17 +19,9 @@ export class NotebookUtils {
constructor() { }
public async newNotebook(connectionProfile?: azdata.IConnectionProfile): Promise<azdata.nb.NotebookEditor> {
public async newNotebook(options?: azdata.nb.NotebookShowOptions): Promise<azdata.nb.NotebookEditor> {
const title = this.findNextUntitledEditorName();
const untitledUri = vscode.Uri.parse(`untitled:${title}`);
const options: azdata.nb.NotebookShowOptions = connectionProfile ? {
viewColumn: null,
preserveFocus: true,
preview: null,
providerId: null,
connectionProfile: connectionProfile,
defaultKernel: null
} : null;
return azdata.nb.showNotebookDocument(untitledUri, options);
}

View File

@@ -140,7 +140,7 @@ export function getOSPlatformId(): string {
* @param second Second version string to compare.
* @returns 1 if the first version is greater, -1 if it's less, and 0 otherwise.
*/
export function comparePackageVersions(first: string, second: string): number {
export function compareVersions(first: string, second: string): number {
let firstVersion = first.split('.');
let secondVersion = second.split('.');
@@ -179,7 +179,7 @@ export function comparePackageVersions(first: string, second: string): number {
export function sortPackageVersions(versions: string[], ascending: boolean = true): string[] {
return versions.sort((first, second) => {
let compareResult = comparePackageVersions(first, second);
let compareResult = compareVersions(first, second);
if (ascending) {
return compareResult;
} else {
@@ -230,7 +230,7 @@ export function isPackageSupported(pythonVersion: string, packageVersionConstrai
versionSpecifier = constraint.slice(0, splitIndex);
version = constraint.slice(splitIndex).trim();
}
let versionComparison = comparePackageVersions(pythonVersion, version);
let versionComparison = compareVersions(pythonVersion, version);
switch (versionSpecifier) {
case '>=':
supportedVersionFound = versionComparison !== -1;