VS Code support & fallback project for similar future issues #95
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.
Fixes #94. Adds full support for running Davos-enhanced notebooks through VS Code, plus "fallback" support for any potential IDEs/applications that would cause failures for similar reasons.
VS Code's Jupyter extension doesn't start a normal Jupyter server when connecting to a kernel to run a notebook (see microsoft/vscode-jupyter#8889), so our method of getting the notebook's path (to set the default project name) via the Jupyter API wasn't working. This PR implements a VS Code-specific fix for the issue, plus a new feature to handle similar situations in other environments: if the notebook's name and/or absolute path can't be identified programmatically for any reason, Davos will now issue a warning and fall back to using a generic Project (
"davos-fallback"
). This way, smuggled packages are still isolated from the user's main environment and the notebook should run as expected.This PR also fixes another issue I caught in the mean time:
davos.project.freeze()
will no longer fail to find the project environment'ssite-packages
directory if the path to the current notebook and/or the user's $HOME directory contains a space.