Skip to content
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

Add a flag as to whether to display the custom extension in extension manager #7256

Open
ggbhat opened this issue Sep 23, 2019 · 4 comments
Open

Comments

@ggbhat
Copy link
Contributor

ggbhat commented Sep 23, 2019

As developer wants to add flag in extension package metadata so that extension will not be visible in extension manager and that can not be uninstall/disable by user.

Suppose some customization is made to jupyter by adding custom extension for example adding custom theme,session handling then we should avoid user from uninstalling extension from manager but the same time he should be able to install contributed extensions.

Make use of core flag or add new flag to control display of extension in extension manager

@vidartf
Copy link
Member

vidartf commented Sep 23, 2019

There are two cases here:

  1. The general case of extensions that are installed by the user.
  2. The case where someone is creating a deployment of JupyterLab, and want to add an extension to the set of "core" extensions that uses cannot modify.

For 1., I think extensions should always be visible. As such, I don' think this flag/info should exist in the package metadata, but rather it should be in the lab configuration. This should be possible to implement, but isn't currently exposed via any CLI commands/options. The work on CoreConfig/AppOptions should at least have made this easier to achieve in the future.

One alternative for now:

  • Modify the package.json file in jupyterlab/staging in your python deployment, to include your extensions. Note that this will be overwritten on any update of jupyterlab, so it is a limited workaround.

@ggbhat
Copy link
Contributor Author

ggbhat commented Sep 23, 2019

@vidartf yes in case of 2, suppose jupyter lab is distributed as docker instance and some custom extensions are added but want to make it set of core extensions.
Can you explain how we can update jupyterlab/staging in case of docker environment.

@ggbhat
Copy link
Contributor Author

ggbhat commented Jan 22, 2020

@vidartf @jasongrout can anyone help me on this..

@vidartf
Copy link
Member

vidartf commented Jan 29, 2020

The most direct, but least "stable" (as it is not a part of an API) is to simply patch this file in your deployment: https://github.com/jupyterlab/jupyterlab/blob/master/jupyterlab/staging/package.json

A larger effort would be to build another Python app on top of the lab apps, that modifies the CoreConfig object as phoila does: https://github.com/vidartf/phoila/blob/master/phoila/commands.py

We probably want a story in the future to make this easier to do, but we are unfortunately not there yet. One way would probably be to ensure that the CoreConfig object on the various commands is configurable, and write a tutorial on how to configure that (via a python config file probably).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants