Add Python Interactive Window#3034
Conversation
…ienceChanges merge in changes from the old data science branch
Tie this into vscode:prepublish Have normal build still build react parts Have normal hygiene still work on react parts
…amUpdate Upstream update and CI test
…webview_support Adding building and hygiene support for react webview controls
…rtup (#2711) * Fixup naming inconsistencies * Add LanguageServerFolderService mock to other activationService tests.
* Dispatch on-type formatters to prevent them from overriding each other * Move providers out of dispatcher, write tests * Add news entry
* Remove reporting of ls version * Remove file
We adjust to changes in 4.4.0.
…ngs.json (#2750) * Prefix relative paths with './' * Ensure relative path is prefixed with ./
I'm seeing compiler errors that have slipped in over the last few weeks. This PR fixes them. All but one are skipped tests that resulted in "unreachable code" errors. The other one is an error about a missing argument.
Implement basic webview support. This should allow us to iterate on the datascience controls using react. This commit creates a history pane that just looks like the default "react" page but works inside of a webview panel. Additionally it still makes it possible to load the index.html into a browser for debugging the react code standalone.
Implements the ability to talk to a jupyter kernel and execute cells.
| "pidusage": "^1.2.0", | ||
| "prismjs": "^1.15.0", | ||
| "promisify-node": "^0.5.0", | ||
| "react-json-tree": "^0.11.0", |
There was a problem hiding this comment.
Please move all of the npm dependencies that are required by the React components into devDependencies
Why?
- None of the npm dependencies required by the react app need to be deployed with the extension.
- E.g. if
react-json-treeis only used in the react app, then there's no need to deploy this with the extension. - When you WebPack, it will pull all necessary dependencies and bundle into your app (so that solves dependencies for react. Else you'll have
reacct-json-treein bothnode_modulesas well as your react bundle.
| "semver": "^5.5.0", | ||
| "styled-jsx": "^3.1.0", | ||
| "sudo-prompt": "^8.2.0", | ||
| "temp": "^0.8.3", |
There was a problem hiding this comment.
Can't we use tmp instead of adding a new dependency?
There was a problem hiding this comment.
Actually I can just use the IFileSystem.createTemporaryFile instead.
| @@ -0,0 +1,52 @@ | |||
| class HelloWorldPlugin { | |||
There was a problem hiding this comment.
Please move these into build\datascience.
| // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. | ||
| // This link also includes instructions on opting out of this behavior. | ||
|
|
||
| const isLocalhost = Boolean( |
There was a problem hiding this comment.
do we need this?
everything is local, so i dont see the need for service worker
There was a problem hiding this comment.
Probably not anymore. The original intent was to be able to debug it using a server. But we haven't been doing that. I'll remove it.
There was a problem hiding this comment.
able to debug it using a server
What do you mean?
| "@nteract/transform-model-debug": "^3.2.3", | ||
| "@nteract/transform-plotly": "^3.2.3", | ||
| "@nteract/transforms": "^4.4.4", | ||
| "@types/prismjs": "^1.9.0", |
There was a problem hiding this comment.
@types/prismjs must go in devDependencies
| "dependencies": { | ||
| "@jupyterlab/services": "^3.1.4", | ||
| "@nteract/transform-dataresource": "^4.3.5", | ||
| "@nteract/transform-geojson": "^3.2.3", |
There was a problem hiding this comment.
Please see comment related to moving react dependencies into devDependencies (only if using in react alone).
| "tmp": "^0.0.29", | ||
| "tree-kill": "^1.2.0", | ||
| "typed-promisify": "^0.4.0", | ||
| "typed-react-markdown": "^0.1.0", |
There was a problem hiding this comment.
Please move type definitions into devDependencies.
DonJayamanne
left a comment
There was a problem hiding this comment.
I'm concerned about the test coverage.
We don't seem to have must tests for the new code
|
|
||
| // tslint:disable-next-line:no-function-expression | ||
| (function() { | ||
| const origRequire = Module.prototype.require; |
There was a problem hiding this comment.
Note: This gets applied globally (i.e. this applies to all tests), hence might as well move into a common area.
Similar to what we do today in src/test/vscode-mock.ts and gets initialized in src/test/unittests.ts as follows:
export function runTests(testOptions?: { grep?: string; timeout?: number }) {
vscodeMoscks.initialize();
`<CSS Mocks> initialize`| @@ -0,0 +1,165 @@ | |||
| // Copyright (c) Microsoft Corporation. All rights reserved. | |||
There was a problem hiding this comment.
As these tests can take upto a minute, please move these into history.test.tsx.
Or move into history.functional.test.tsx
& then create a new test runner for these tests, we need to ensure the *.unit.test.ts tests still run fast without spawning processes, etc.
All *.unit.test.ts tests are considered OS agnostic.
There was a problem hiding this comment.
These are OS agnostic but they don't require or use VS code. I guess I can create another test runner for now.
There was a problem hiding this comment.
Yeah not sure how long that will take though. If we want to ship this by Wednesday I'm not sure if I can get this done and the other stuff I have to do by then.
There was a problem hiding this comment.
These tests (when jupyter is present) take about 7 or 8 seconds.
There was a problem hiding this comment.
Does this spawn any process or require python?
I believe they do, hence the reason they could take a while.
There was a problem hiding this comment.
Yes they spawn jupyter using the python -m command.
…crosoft/vscode-python into dev/rchiodo/merge_datascience
|
What is history-react? Was all of that written from scratch or is this some external project that you are embedding? Is there any external project that is being embedded? |
That's just a directory of the code we've written. It's not somebody else's code. It's our UI. It's called history-react because we wanted it to be clear it was using reactjs. |
|
There are new dependencies though. You can see them in package.json. We embed a whole bunch of react controls to get the UI to work. |
|
@rchiodo "Embed" as in there are files you copied from somewhere else? |
brettcannon
left a comment
There was a problem hiding this comment.
Marking as "request changes" to make sure we don't accidentally merge while we work out 3rd-party project details.
|
Well sort of. Most of the code is just npm installed. There is one set of regex's I copied from prismjs python code. (MIT licensed). However prism is also npm installed so I think it should be captured in the oss governance stuff. |
|
Just to put it here in case we forget, the src\client\datascience\history-react\transforms.ts is essentially a copy of this file here: |
|
That's probably a good idea. Now I have a number for the news entry I added. I'll renumber it. |
Implements the Python Interactive window and associated commands to run python files as notebooks
Fix #2302
package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed)