Skip to content
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

VS Code support & fallback project for similar future issues #95

Merged
merged 6 commits into from
Sep 6, 2023

Conversation

paxtonfitzpatrick
Copy link
Member

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's site-packages directory if the path to the current notebook and/or the user's $HOME directory contains a space.

@paxtonfitzpatrick paxtonfitzpatrick merged commit 095d6f7 into ContextLab:main Sep 6, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_notebook_path doesn't work when running with VSCode
1 participant