-
-
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
New extension manager #12866
New extension manager #12866
Conversation
Thanks for making a pull request to jupyterlab! |
7a5349d
to
368b8a4
Compare
CI failure requires jupyterlab/lumino#321 to be reviewed, merged and published. But as this brings lots of changes reviews are welcomed. |
@fcollonval this looks really cool. Thanks for all of the hard work! Thinking about the |
I mimic what was done in the pull-requests extension - dropping the configuration for now. But yes there is surely high value of adding configurable capability. |
I don't believe so - both implementations leverage a metaclass (which probably could be chained, but it's messy). If you want to keep this PR constrained, given that it doesn't add a configuration mechanism it's probably OK to hold off! :) |
Looks like jupyterlab/lumino#321 has now been merged. Since it is on |
bd35520
to
4d98d98
Compare
bot please update documentation snapshots |
The pagination looks good, thanks! I think we should merge and iterate once tests pass, this PR is awkward to review given the number of commits and comments. |
bot please update documentation snapshots |
49c96f3
to
4e4e7e0
Compare
Merging as CI is green (remain failure is not related) |
References
Related to #11336
Code changes
The extension manager is fully on the backend
jupyterlab.extension_manager_v1
that must implement a callback receiving optionallyAppOptions
,ExtensionsOption
(in dictionary format) andLabApp
and returning andExtensionManager
. Two default implementations are provided:readonly = jupyterlab.extensions:get_readonly_manager
pypi = jupyterlab.extensions:get_pypi_manager
ExtensionManager
but third-party may override it.ExtensionManager
(but could be overridden)ExtensionManager
inherits fromtraitlets.config.LoggingConfigurable
to be configurable. It receives the config fromLabApp
by passing it asparent
of the configurable.-
metadata
: Returns extension manager metadata that will be saved inPageConfig['extension_manager']
to tune the extension manager panel-
name
: Name of the extension manager-
can_install
: whether the extension manager can (un-)install extensions-
install_path
: Extensions installation path; e.g. Python virtual environment-
get_latest_version
: Get the latest version of an extension-
list_packages
: List packages for a given query-
install
: Install a package-
uninstall
: Uninstall a packagestatus
(ok, warning, error), optionalmessage
and a list of follow-ups restart actions (server, kernels, frontend).The frontend
SidePanel
widget withAccordionPanel
for UI homogeneityPyPI manager
install.json
file. If it is missing, it normalized the npm package name. But there is no guarantee that it will be the pip package name => some packages may fail to get uninstall.jupyterlab.discovery
metadata in package.json are used. They may not be accurate.Read-only manager:
User-facing changes
By default they can installed or uninstalled pre-built extensions via pip.
The two default managers:
Backwards-incompatible changes
Break the api as most features are now in the backend.