From 044e0e8f91ac351274be77e9fa94d91e227bf55c Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Mon, 8 Aug 2022 07:58:17 +0200 Subject: [PATCH] rename duplicate entrypoints --- ...upyter Extensions as Python Packages.ipynb | 34 +++++++------- docs/source/extending/bundler_extensions.rst | 10 ++--- docs/source/extending/frontend_extensions.rst | 4 +- nbclassic/bundler/bundlerextensions.py | 22 +++++----- nbclassic/nbextensions.py | 44 +++++++++---------- nbclassic/serverextensions.py | 20 ++++----- nbclassic/static/base/js/namespace.js | 2 +- setup.py | 6 +-- 8 files changed, 71 insertions(+), 71 deletions(-) diff --git a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb index c0dd7daae..3f26c1242 100644 --- a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb +++ b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb @@ -72,7 +72,7 @@ "\n", "A `pip` user that wants their configuration stored in their home directory would type the following command:\n", "```shell\n", - "jupyter serverextension enable --py helpful_package\n", + "jupyter nbclassic-serverextension enable --py helpful_package\n", "```\n", "\n", "Alternatively, a `virtualenv` or `conda` user can pass `--sys-prefix` which keeps their environment isolated and reproducible. For example:\n", @@ -80,7 +80,7 @@ "# Make sure that your virtualenv or conda environment is activated\n", "[source] activate my-environment\n", "\n", - "jupyter serverextension enable --py helpful_package --sys-prefix\n", + "jupyter nbclassic-serverextension enable --py helpful_package --sys-prefix\n", "```" ] }, @@ -97,7 +97,7 @@ "source": [ "If a package also has an nbextension with frontend assets that must be available (but not neccessarily enabled by default), install these assets with the following command:\n", "```shell\n", - "jupyter nbextension install --py helpful_package # or --sys-prefix if using virtualenv or conda\n", + "jupyter nbclassic-extension install --py helpful_package # or --sys-prefix if using virtualenv or conda\n", "```" ] }, @@ -108,7 +108,7 @@ "### Enable nbextension assets\n", "If a package has assets that should be loaded every time a Jupyter app (e.g. lab, notebook, dashboard, terminal) is loaded in the browser, the following command can be used to enable the nbextension:\n", "```shell\n", - "jupyter nbextension enable --py helpful_package # or --sys-prefix if using virtualenv or conda\n", + "jupyter nbclassic-extension enable --py helpful_package # or --sys-prefix if using virtualenv or conda\n", "```" ] }, @@ -120,9 +120,9 @@ "After running one or more extension installation steps, you can list what is presently known about nbextensions, server extensions, or bundler extensions. The following commands will list which extensions are available, whether they are enabled, and other extension details:\n", "\n", "```shell\n", - "jupyter nbextension list\n", - "jupyter serverextension list\n", - "jupyter bundlerextension list\n", + "jupyter nbclassic-extension list\n", + "jupyter nbclassic-serverextension list\n", + "jupyter nbclassic-bundlerextension list\n", "```" ] }, @@ -191,7 +191,7 @@ "### Install and enable the server extension\n", "Which a user can install with:\n", "```\n", - "jupyter serverextension enable --py my_module [--sys-prefix]\n", + "jupyter nbclassic-serverextension enable --py my_module [--sys-prefix]\n", "```" ] }, @@ -260,9 +260,9 @@ "\n", "The user can install and enable the extensions with the following set of commands:\n", "```\n", - "jupyter nbextension install --py my_fancy_module [--sys-prefix|--user]\n", - "jupyter nbextension enable --py my_fancy_module [--sys-prefix|--system]\n", - "jupyter serverextension enable --py my_fancy_module [--sys-prefix|--system]\n", + "jupyter nbclassic-extension install --py my_fancy_module [--sys-prefix|--user]\n", + "jupyter nbclassic-extension enable --py my_fancy_module [--sys-prefix|--system]\n", + "jupyter nbclassic-serverextension enable --py my_fancy_module [--sys-prefix|--system]\n", "```" ] }, @@ -337,15 +337,15 @@ " ...\n", " include_package_data=True,\n", " data_files=[\n", - " # like `jupyter nbextension install --sys-prefix`\n", + " # like `jupyter nbclassic-extension install --sys-prefix`\n", " (\"share/jupyter/nbextensions/my_fancy_module\", [\n", " \"my_fancy_module/static/index.js\",\n", " ]),\n", - " # like `jupyter nbextension enable --sys-prefix`\n", + " # like `jupyter nbclassic-extension enable --sys-prefix`\n", " (\"etc/jupyter/nbconfig/notebook.d\", [\n", " \"jupyter-config/nbconfig/notebook.d/my_fancy_module.json\"\n", " ]),\n", - " # like `jupyter serverextension enable --sys-prefix`\n", + " # like `jupyter nbclassic-serverextension enable --sys-prefix`\n", " (\"etc/jupyter/jupyter_notebook_config.d\", [\n", " \"jupyter-config/jupyter_notebook_config.d/my_fancy_module.json\"\n", " ])\n", @@ -375,9 +375,9 @@ "source": [ "As most package managers will only modify their environment, the eventual configuration will be as if the user had typed:\n", "```\n", - "jupyter nbextension install --py my_fancy_module --sys-prefix\n", - "jupyter nbextension enable --py my_fancy_module --sys-prefix\n", - "jupyter serverextension enable --py my_fancy_module --sys-prefix\n", + "jupyter nbclassic-extension install --py my_fancy_module --sys-prefix\n", + "jupyter nbclassic-extension enable --py my_fancy_module --sys-prefix\n", + "jupyter nbclassic-serverextension enable --py my_fancy_module --sys-prefix\n", "```\n", "\n", "If a user manually `disable`s an extension, that configuration will override the bundled package configuration." diff --git a/docs/source/extending/bundler_extensions.rst b/docs/source/extending/bundler_extensions.rst index 7e2dec305..02ca92fe4 100644 --- a/docs/source/extending/bundler_extensions.rst +++ b/docs/source/extending/bundler_extensions.rst @@ -125,7 +125,7 @@ following: .. code:: bash - jupyter bundlerextension enable --py mypackage.hello_bundler --sys-prefix + jupyter nbclassic-bundlerextension enable --py mypackage.hello_bundler --sys-prefix The above updates the notebook configuration file in the current conda/virtualenv environment (`--sys-prefix`) with the metadata returned by @@ -136,13 +136,13 @@ following: .. code:: bash - jupyter bundlerextension disable --py mypackage.hello_bundler --sys-prefix + jupyter nbclassic-bundlerextension disable --py mypackage.hello_bundler --sys-prefix For more help using the `bundlerextension` subcommand, run the following. .. code:: bash - jupyter bundlerextension --help + jupyter nbclassic-bundlerextension --help The output describes options for listing enabled bundlers, configuring bundlers for single users, configuring bundlers system-wide, etc. @@ -157,8 +157,8 @@ You can enable them to try them like so: .. code:: bash - jupyter bundlerextension enable --py notebook.bundler.zip_bundler --sys-prefix - jupyter bundlerextension enable --py notebook.bundler.tarball_bundler --sys-prefix + jupyter nbclassic-bundlerextension enable --py notebook.bundler.zip_bundler --sys-prefix + jupyter nbclassic-bundlerextension enable --py notebook.bundler.tarball_bundler --sys-prefix .. _bundler-details: diff --git a/docs/source/extending/frontend_extensions.rst b/docs/source/extending/frontend_extensions.rst index 1975d15ce..98ef8cc06 100644 --- a/docs/source/extending/frontend_extensions.rst +++ b/docs/source/extending/frontend_extensions.rst @@ -205,7 +205,7 @@ Installing and enabling extensions You can install your nbextension with the command:: - jupyter nbextension install path/to/my_extension/ [--user|--sys-prefix] + jupyter nbclassic-extension install path/to/my_extension/ [--user|--sys-prefix] The default installation is system-wide. You can use ``--user`` to do a per-user installation, or ``--sys-prefix`` to install to Python's prefix (e.g. @@ -219,7 +219,7 @@ rather than copying it, so there's no need to reinstall after changes. To use your extension, you'll also need to **enable** it, which tells the notebook interface to load it. You can do that with another command:: - jupyter nbextension enable my_extension/main [--sys-prefix][--section='common'] + jupyter nbclassic-extension enable my_extension/main [--sys-prefix][--section='common'] The argument refers to the Javascript module containing your ``load_ipython_extension`` function, which is ``my_extension/main.js`` in this diff --git a/nbclassic/bundler/bundlerextensions.py b/nbclassic/bundler/bundlerextensions.py index 5a5a82311..d6aeb5f63 100644 --- a/nbclassic/bundler/bundlerextensions.py +++ b/nbclassic/bundler/bundlerextensions.py @@ -171,7 +171,7 @@ def disable_bundler_python(module, user=True, sys_prefix=False, logger=None): class ToggleBundlerExtensionApp(BaseExtensionApp): """A base class for apps that enable/disable bundlerextensions""" - name = "jupyter bundlerextension enable/disable" + name = "jupyter nbclassic-bundlerextension enable/disable" version = __version__ description = "Enable/disable a bundlerextension in configuration." @@ -214,30 +214,30 @@ def start(self): class EnableBundlerExtensionApp(ToggleBundlerExtensionApp): """An App that enables bundlerextensions""" - name = "jupyter bundlerextension enable" + name = "jupyter nbclassic-bundlerextension enable" description = """ Enable a bundlerextension in frontend configuration. Usage - jupyter bundlerextension enable [--system|--sys-prefix] + jupyter nbclassic-bundlerextension enable [--system|--sys-prefix] """ _toggle_value = True class DisableBundlerExtensionApp(ToggleBundlerExtensionApp): """An App that disables bundlerextensions""" - name = "jupyter bundlerextension disable" + name = "jupyter nbclassic-bundlerextension disable" description = """ Disable a bundlerextension in frontend configuration. Usage - jupyter bundlerextension disable [--system|--sys-prefix] + jupyter nbclassic-bundlerextension disable [--system|--sys-prefix] """ _toggle_value = None class ListBundlerExtensionApp(BaseExtensionApp): """An App that lists and validates nbextensions""" - name = "jupyter nbextension list" + name = "jupyter nbclassic-extension list" version = __version__ description = "List all nbextensions known by the configuration system" @@ -276,14 +276,14 @@ def start(self): class BundlerExtensionApp(BaseExtensionApp): - """Base jupyter bundlerextension command entry point""" - name = "jupyter bundlerextension" + """Base jupyter nbclassic-bundlerextension command entry point""" + name = "jupyter nbclassic-bundlerextension" version = __version__ description = "Work with Jupyter bundler extensions" examples = """ -jupyter bundlerextension list # list all configured bundlers -jupyter bundlerextension enable --py # enable all bundlers in a Python package -jupyter bundlerextension disable --py # disable all bundlers in a Python package +jupyter nbclassic-bundlerextension list # list all configured bundlers +jupyter nbclassic-bundlerextension enable --py # enable all bundlers in a Python package +jupyter nbclassic-bundlerextension disable --py # disable all bundlers in a Python package """ subcommands = dict( diff --git a/nbclassic/nbextensions.py b/nbclassic/nbextensions.py index 3619f791e..4f6ee7638 100644 --- a/nbclassic/nbextensions.py +++ b/nbclassic/nbextensions.py @@ -632,9 +632,9 @@ class InstallNBExtensionApp(BaseExtensionApp): Usage - jupyter nbextension install path|url [--user|--sys-prefix] + jupyter nbclassic-extension install path|url [--user|--sys-prefix] - This copies a file or a folder into the Jupyter nbextensions directory. + This copies a file or a folder into the jupyter nbclassic-extensions directory. If a URL is given, it will be downloaded. If an archive is given, it will be extracted into nbextensions. If the requested files are already up to date, no action is taken @@ -642,7 +642,7 @@ class InstallNBExtensionApp(BaseExtensionApp): """ examples = """ - jupyter nbextension install /path/to/myextension + jupyter nbclassic-extension install /path/to/myextension """ aliases = aliases flags = flags @@ -687,7 +687,7 @@ def install_extensions(self): self.log.info( f"\nTo initialize this nbextension in the browser every time" f" the notebook (or other app) loads:\n\n" - f" jupyter nbextension enable {self.extra_args[0] if self.python else ''}" + f" jupyter nbclassic-extension enable {self.extra_args[0] if self.python else ''}" f"{' --user' if self.user else ''}" f"{' --py' if self.python else ''}" f"{' --sys-prefix' if self.sys_prefix else ''}\n" @@ -711,8 +711,8 @@ class UninstallNBExtensionApp(BaseExtensionApp): Usage - jupyter nbextension uninstall path/url path/url/entrypoint - jupyter nbextension uninstall --py pythonPackageName + jupyter nbclassic-extension uninstall path/url path/url/entrypoint + jupyter nbclassic-extension uninstall --py pythonPackageName This uninstalls an nbextension. By default, it uninstalls from the first directory on the search path where it finds the extension, but you can @@ -722,7 +722,7 @@ class UninstallNBExtensionApp(BaseExtensionApp): If you specify the --require option, the named extension will be disabled, e.g.:: - jupyter nbextension uninstall myext --require myext/main + jupyter nbclassic-extension uninstall myext --require myext/main If you use the --py or --python flag, the name should be a Python module. It will uninstall nbextensions listed in that module, but not the module @@ -730,8 +730,8 @@ class UninstallNBExtensionApp(BaseExtensionApp): """ examples = """ - jupyter nbextension uninstall dest/dir dest/dir/extensionjs - jupyter nbextension uninstall --py extensionPyPackage + jupyter nbclassic-extension uninstall dest/dir dest/dir/extensionjs + jupyter nbclassic-extension uninstall --py extensionPyPackage """ aliases = { @@ -821,7 +821,7 @@ def start(self): class ToggleNBExtensionApp(BaseExtensionApp): """A base class for apps that enable/disable extensions""" - name = "jupyter nbextension enable/disable" + name = "jupyter nbclassic-extension enable/disable" version = __version__ description = "Enable/disable an nbextension in configuration." @@ -886,31 +886,31 @@ def start(self): class EnableNBExtensionApp(ToggleNBExtensionApp): """An App that enables nbextensions""" - name = "jupyter nbextension enable" + name = "jupyter nbclassic-extension enable" description = """ Enable an nbextension in frontend configuration. Usage - jupyter nbextension enable [--system|--sys-prefix] + jupyter nbclassic-extension enable [--system|--sys-prefix] """ _toggle_value = True class DisableNBExtensionApp(ToggleNBExtensionApp): """An App that disables nbextensions""" - name = "jupyter nbextension disable" + name = "jupyter nbclassic-extension disable" description = """ Disable an nbextension in frontend configuration. Usage - jupyter nbextension disable [--system|--sys-prefix] + jupyter nbclassic-extension disable [--system|--sys-prefix] """ _toggle_value = None class ListNBExtensionsApp(BaseExtensionApp): """An App that lists and validates nbextensions""" - name = "jupyter nbextension list" + name = "jupyter nbclassic-extension list" version = __version__ description = "List all nbextensions known by the configuration system" @@ -945,16 +945,16 @@ def start(self): _examples = """ -jupyter nbextension list # list all configured nbextensions -jupyter nbextension install --py # install an nbextension from a Python package -jupyter nbextension enable --py # enable all nbextensions in a Python package -jupyter nbextension disable --py # disable all nbextensions in a Python package -jupyter nbextension uninstall --py # uninstall an nbextension in a Python package +jupyter nbclassic-extension list # list all configured nbextensions +jupyter nbclassic-extension install --py # install an nbextension from a Python package +jupyter nbclassic-extension enable --py # enable all nbextensions in a Python package +jupyter nbclassic-extension disable --py # disable all nbextensions in a Python package +jupyter nbclassic-extension uninstall --py # uninstall an nbextension in a Python package """ class NBExtensionApp(BaseExtensionApp): - """Base jupyter nbextension command entry point""" - name = "jupyter nbextension" + """Base jupyter nbclassic-extension command entry point""" + name = "jupyter nbclassic-extension" version = __version__ description = "Work with Jupyter notebook extensions" examples = _examples diff --git a/nbclassic/serverextensions.py b/nbclassic/serverextensions.py index 7a56a8fca..a4ad92411 100644 --- a/nbclassic/serverextensions.py +++ b/nbclassic/serverextensions.py @@ -157,7 +157,7 @@ def validate_serverextension(import_name, logger=None): class ToggleServerExtensionApp(BaseExtensionApp): """A base class for enabling/disabling extensions""" - name = "jupyter serverextension enable/disable" + name = "jupyter nbclassic-serverextension enable/disable" description = "Enable/disable a server extension using frontend configuration files." flags = flags @@ -212,31 +212,31 @@ def start(self): class EnableServerExtensionApp(ToggleServerExtensionApp): """An App that enables (and validates) Server Extensions""" - name = "jupyter serverextension enable" + name = "jupyter nbclassic-serverextension enable" description = """ Enable a serverextension in configuration. Usage - jupyter serverextension enable [--system|--sys-prefix] + jupyter nbclassic-serverextension enable [--system|--sys-prefix] """ _toggle_value = True class DisableServerExtensionApp(ToggleServerExtensionApp): """An App that disables Server Extensions""" - name = "jupyter serverextension disable" + name = "jupyter nbclassic-serverextension disable" description = """ Disable a serverextension in configuration. Usage - jupyter serverextension disable [--system|--sys-prefix] + jupyter nbclassic-serverextension disable [--system|--sys-prefix] """ _toggle_value = False class ListServerExtensionsApp(BaseExtensionApp): """An App that lists (and validates) Server Extensions""" - name = "jupyter serverextension list" + name = "jupyter nbclassic-serverextension list" version = __version__ description = "List all server extensions known by the configuration system" @@ -265,15 +265,15 @@ def start(self): _examples = """ -jupyter serverextension list # list all configured server extensions -jupyter serverextension enable --py # enable all server extensions in a Python package -jupyter serverextension disable --py # disable all server extensions in a Python package +jupyter nbclassic-serverextension list # list all configured server extensions +jupyter nbclassic-serverextension enable --py # enable all server extensions in a Python package +jupyter nbclassic-serverextension disable --py # disable all server extensions in a Python package """ class ServerExtensionApp(BaseExtensionApp): """Root level server extension app""" - name = "jupyter serverextension" + name = "jupyter nbclassic-serverextension" version = __version__ description = "Work with Jupyter server extensions" examples = _examples diff --git a/nbclassic/static/base/js/namespace.js b/nbclassic/static/base/js/namespace.js index 328537a04..7ee899278 100644 --- a/nbclassic/static/base/js/namespace.js +++ b/nbclassic/static/base/js/namespace.js @@ -73,7 +73,7 @@ define(function(){ // tree jglobal('SessionList','tree/js/sessionlist'); - Jupyter.version = "0.4.3"; + Jupyter.version = "0.5.0.dev0"; Jupyter._target = '_blank'; return Jupyter; diff --git a/setup.py b/setup.py index 35a365838..ff16590c9 100644 --- a/setup.py +++ b/setup.py @@ -133,9 +133,9 @@ entry_points = { 'console_scripts': [ 'jupyter-nbclassic = nbclassic.notebookapp:main', - 'jupyter-nbextension = nbclassic.nbextensions:main', - 'jupyter-serverextension = nbclassic.serverextensions:main', - 'jupyter-bundlerextension = nbclassic.bundler.bundlerextensions:main', + 'jupyter-nbclassic-extension = nbclassic.nbextensions:main', + 'jupyter-nbclassic-serverextension = nbclassic.serverextensions:main', + 'jupyter-nbclassic-bundlerextension = nbclassic.bundler.bundlerextensions:main', ] }, )