-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Enable labextension for user only #15574
Comments
|
After #14536, #16102 and #16251, there is no issue about populating the
These commands create/populate the Is it intended to prevent user from enabling an extension, if it has been disabled but unlocked at a higher level ? cc @krassowski @divyansshhh who worked on the PR above. |
Some more discussion about this #16101 (comment) |
EDIT
The description below may not be relevant anymore, but the issue is still there, since the extension cannot be enabled at user level only.
See #15574 (comment) for updated context on the issue.
Description
Labextensions can be enabled/disabled at several level: user, sys_prefix or system level.
The way it works in jupyterlab is to write a file if the extension is explicitly disabled.
To know if an extension is enabled or disabled when starting jupyterlab, I believe the page_config files are read in this order: user, sys_prefix and system. If a file is missing at one of this level, the extension is considered unset at this level, which means enabled by default except if a page_config file is found at another level.
Now, if we want to enable an extension only for some users, we should run the following commands:
jupyter labextension disable my_extension --level=sys_prefix
jupyter labextension enable my_extension --level=user
These commands will create an entry to disable the extension at sys_prefix level, but not at user level. Therefore the extension will be considered as disabled because there is no file at user level but one at sys_prefix level.
To make it work properly, we need to first disable the extension at user level (to create the entry), then enable it to modify the entry.
jupyter labextension disable my_extension --level=sys_prefix
jupyter labextension disable my_extension --level=user
jupyter labextension enable my_extension --level=user
Reproduce
The following commands will not enable the extension for the user:
jupyter labextension disable my_extension --level=sys_prefix
jupyter labextension enable my_extension --level=user
Expected behavior
To enable the extension at lower level.
Context
Issue reference jupyter/nbgrader#1515 (comment) and jupyter/nbgrader#1588 (comment)
Proposition
Change the following condition:
jupyterlab/jupyterlab/commands.py
Line 1110 in 0a5e152
to:
The text was updated successfully, but these errors were encountered: