-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Improvement on server and notebook extension mechanism #1706
Comments
Copied from the original discussion at the ipywidgets repo:
Nice and thanks in advance!
I totally agree with you here...
Sound reasonable, in fact, in some conda-packaged nbextensions we are using --override by default.
I agree too, people forget about disabling and that could bring some problematic leftovers... people usually request installation and activation to be separated, but I believe in this case, one thing (uninstalltion) should cause the other (disabling) as well..
mmm... not sure about this in a composite scenario, I can see a scenario where sys-prefix installed extensions provides some "common" extensions (ie, provided by anaconda distro or a conda-forge set of extensions, etc) and user installed/enabled extensions that a user wrote and want to enable in all their notebook instances without installing the extension in every environment (maybe hundreds?).
That maybe should be warned? In the same scenario I described above, I can see a use case to disable one extension in all my envs without disabling it in every environment... |
From @SylvainCorlay
Now it is:
I agree. |
The installation of Jupyter kernels is analogous and suffers from some of the same problems. Whatever solution we come up with, we also need good complete examples. There should be minimal working packages for an example of a kernel and an example of an nbextension. See also a long discussion at jupyter/jupyter_core#61 and jupyter/jupyter_core#69 which was closed but not resolved. |
I propose we target this for 5.0, and I am willing to work on it. |
In the mean time, there is a minimal example of a kernel at https://github.com/jupyter/echo_kernel Unfortunately, I disagree with how things are done there. In my opinion, |
While testing sagemath/pari-jupyter#5 I found out again "the hard way" that this issue still exists...
Why does |
As install_nbextension seems to be buggy see (jupyter/notebook#1706). - Remove the call of install_nbextension - Use data_files instead with fixed path (old paths where wrongs)
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).--override
option should beTrue
by default. Otherwise people don't know that they may have an older version of the js installed.sys-prefix
, the assets should only looked for in thesys-prefix
data directory. If it is loaded because enabled in theuser
configuration directory, it should only load the assets in theuser
data directory etc...--user
(i.e. setting it toFalse
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.The text was updated successfully, but these errors were encountered: