Skip to content

Improvement on server and notebook extension mechanismΒ #1706

@SylvainCorlay

Description

@SylvainCorlay

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions