No way to set Juypter Server URI programmatically
See original GitHub issueEnvironment data
- VS Code version: 1.63.2
- Jupyter Extension version (available under the Extensions sidebar): v2021.11.1001550889
- Python Extension version (available under the Extensions sidebar): v2021.12.1559732655
- OS (Windows | Mac | Linux distro) and version: Ubuntu 20.04
- Python and/or Anaconda version: 3.6.8
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Jupyter server running: Local | Remote | N/A; Remote
Expected behaviour
There exist an option to set the Jupyter Server URI programmatically from another extension/shared config/etc.
Previously I believe this was supported via a config option in settings.json
like :
"python.dataScience.jupyterServerURI": "http://localhost:8000/jupyter/"
With that option I could modify the workspace settings thus setting the URI without using the selector.
Any option to set the URI without user interaction would be greatly appreciated. Whether it be a command that can be executed and passed args, or a config option that is respected from setting.json
Actual behaviour
As far as I am aware of, nothing like this exists currently.
Even the command "jupyter.selectjupyteruri"
does not allow the passing of an uri. Rather it pulls up the selector you pass to it.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Try and find a way to set the URI without the user interface.
In my particular use case, I just need to be able to set the URI to a remote jupyter server from the context of a VSCode extension. In doing so, any notebook opened would already be configured to use the remote server without user interaction.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top GitHub Comments
Yes it would be bad if context.secret was accessible elsewhere. Your quickest workaround may be to just implement having ‘jupyter.selectJupyterUri’ take an argument and submit a PR.
I mean it’s probably possible to change the value to something hardcoded, save off the DB with the context keys, then copy that DB overtop of the one on the running machine, but that’d only work if the URI was constant.
Thanks for the suggestion. We stopped exposing the URI as a setting because of the potential for people to accidentally checkin in their server token.
But seems reasonable to allow ‘jupyter.selectjupyteruri’ to allow a URI to use.