forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Install jupyter if its not found #6421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
919677c
fixed issue 5682, promt user to install jupyter if
951c71f
moved the jupyter installation to codewatcher
67fc6c4
Merge branch 'master' into davidkutu/install_jupyter
3ad1645
changed the error handler to be its own
0ad27e7
merged conflicts
fa67564
removed serviceContainer from the data science
aa437f1
added jupyter to the productService map
5ef1551
added jupyter to a function in the
5e02817
added the data science productType
6291348
excluded jupyter installation from a test
fe4b08c
removed jupyter from product installer
f7bd04e
added jupyter back to product installer
8c954a7
added a productPath test for dataScience
df37758
excluded jupyter from checking if its installed
0674861
Added DataScienceProductPathService to 3 tests
9d02f24
added done(to two tests)
a284cc5
added a binding of IDataScienceErrorHandler
ae9a56d
added IInstallationChannelManager binding
83833ef
added jupyter as an exception to
0dd1e98
added jupyter as an exception to the
963e12c
localized a new string from productInstaller.ts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| The extension will now prompt to auto install jupyter in case its not found. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| import { inject, injectable } from 'inversify'; | ||
| import { IApplicationShell } from '../../common/application/types'; | ||
| import { IInstallationChannelManager } from '../../common/installer/types'; | ||
| import { ILogger, Product } from '../../common/types'; | ||
| import * as localize from '../../common/utils/localize'; | ||
| import { noop } from '../../common/utils/misc'; | ||
| import { JupyterInstallError } from '../jupyter/jupyterInstallError'; | ||
| import { JupyterSelfCertsError } from '../jupyter/jupyterSelfCertsError'; | ||
| import { IDataScienceErrorHandler } from '../types'; | ||
|
|
||
| @injectable() | ||
| export class DataScienceErrorHandler implements IDataScienceErrorHandler { | ||
| constructor(@inject(IApplicationShell) private applicationShell: IApplicationShell, | ||
| @inject(ILogger) private logger: ILogger, | ||
| @inject(IInstallationChannelManager) protected channels: IInstallationChannelManager) { | ||
| } | ||
|
|
||
| public handleError(err: Error) { | ||
| if (err instanceof JupyterInstallError) { | ||
| this.applicationShell.showInformationMessage( | ||
| localize.DataScience.jupyterNotSupported(), | ||
| localize.DataScience.jupyterInstall(), | ||
| localize.DataScience.notebookCheckForImportNo()) | ||
| .then(response => { | ||
| if (response === localize.DataScience.jupyterInstall()) { | ||
| return this.channels.getInstallationChannel(Product.jupyter); | ||
| } else { | ||
| const jupyterError = err as JupyterInstallError; | ||
|
|
||
| // This is a special error that shows a link to open for more help | ||
| this.applicationShell.showErrorMessage(jupyterError.message, jupyterError.actionTitle).then(v => { | ||
| // User clicked on the link, open it. | ||
| if (v === jupyterError.actionTitle) { | ||
| this.applicationShell.openUrl(jupyterError.action); | ||
| } | ||
| }); | ||
| } | ||
| }).then(installer => { | ||
| if (installer) { | ||
| installer.installModule('jupyter') | ||
| .catch(e => this.applicationShell.showErrorMessage(e.message, localize.DataScience.pythonInteractiveHelpLink())); | ||
| } | ||
| }); | ||
| } else if (err instanceof JupyterSelfCertsError) { | ||
| // Don't show the message for self cert errors | ||
| noop(); | ||
| } else if (err.message) { | ||
| this.applicationShell.showErrorMessage(err.message); | ||
| } else { | ||
| this.applicationShell.showErrorMessage(err.toString()); | ||
| } | ||
| this.logger.logError(err); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.