jupyter / jupyter/notebook

Improvement on server and notebook extension mechanism

Open
#1,706 6 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

There are many issues with the current mechanism with server and notebook extensions, which caused a lot of pain.

One of the main issues is with package management since extension enabling consists in modifying a configuration file, which is not a thing package managers do well - and we would like switch to a configuration mechanism where each extension would simply add a file into a directory to be picked up by the application. The _conf.d_ approach. But here, I would like to keep this aspect of the problem aside to tackle other issues with the current mechanism which I think are causing a lot of confusion too.

I am proposing the following changes in the mechanism
- `sys-prefix` install should be the default instead of system for both enabling and installing. People are confused when enabling/installing an nbextension requires different privileges from the pip install. Doing anything else than `--sys-prefix` should be a conscious decision. It is also important to note that `--user` is global to all the python installs that the user may use. (Hence `--user` is almost always evil).
- When installing an extension, the `--override` option should be `True` by default. Otherwise people don't know that they may have an older version of the js installed.
- Uninstalling an extension should also remove the line corresponding to the extension in the notebook.json configuration file (which is a bit different from disabling it as we see in the following).
- A major change that I want to put in place is that if an extension is loaded because it is enabled in e.g. `sys-prefix`, the assets should only looked for in the `sys-prefix` data directory. If it is loaded because enabled in the `user` configuration directory, it should only load the assets in the `user` data directory etc...
- At the moment, disabling an extension with `--user` (i.e. setting it to `False` in the user nbconfig) will cause the extension to not be enabled even if it is enabled e.g. in sys-prefix because the user configuration has the priority - which is really silly. This problem will go when I fix the previous one.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing server and notebook extension install, enable, disable, and uninstall commands, including their --sys-prefix, --user, and --override handling. Inspect how notebook.json and the user, system, and sys-prefix data directories are selected. Done means the proposed precedence, asset lookup, default options, and configuration cleanup behavior are implemented and covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
cli, developer-experience, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.