Update shim, notebook app name

This commit is contained in:
Jeremy Tuloup 2022-02-25 10:19:03 +01:00
parent 46afe5014e
commit e5fefbae07
6 changed files with 15 additions and 18 deletions

View File

@ -19,7 +19,7 @@ The `jlpm` command is JupyterLab's pinned version of [yarn](https://yarnpkg.com/
mamba create -n notebook -c conda-forge python nodejs -y
# activate the environment
conda activate notebook
mamba activate notebook
# Install package in development mode
pip install -e .

View File

@ -1,3 +1,4 @@
{
"LabApp": { "collaborative": true, "expose_app_in_browser": true }
"LabApp": { "collaborative": true, "expose_app_in_browser": true },
"JupyterNotebookApp": { "collaborative": true, "expose_app_in_browser": true }
}

View File

@ -2,20 +2,14 @@ from ._version import __version__
def _jupyter_server_extension_paths():
return [
{
'module': 'notebook'
}
]
return [{"module": "notebook"}]
def _jupyter_server_extension_points():
from .app import NotebookApp
return [{"module": "notebook", "app": NotebookApp}]
from .app import JupyterNotebookApp
return [{"module": "notebook", "app": JupyterNotebookApp}]
def _jupyter_labextension_paths():
return [{
'src': 'labextension',
'dest': '@jupyter-notebook/lab-extension'
}]
return [{"src": "labextension", "dest": "@jupyter-notebook/lab-extension"}]

View File

@ -13,6 +13,7 @@ from jupyterlab.commands import get_app_dir, get_user_settings_dir, get_workspac
from jupyterlab_server import LabServerApp
from jupyterlab_server.config import get_page_config, recursive_update, LabConfig
from jupyterlab_server.handlers import is_url, _camelCase
from notebook_shim.shim import NotebookConfigShimMixin
from tornado import web
from tornado.gen import maybe_future
from traitlets import Bool
@ -168,13 +169,13 @@ class NotebookHandler(NotebookBaseHandler):
aliases = dict(base_aliases)
class NotebookApp(LabServerApp):
class JupyterNotebookApp(NotebookConfigShimMixin, LabServerApp):
name = "notebook"
app_name = "Jupyter Notebook"
description = "Jupyter Notebook - A web-based notebook environment for interactive computing"
version = version
app_version = version
extension_url = "/tree"
extension_url = "/"
default_url = "/tree"
file_url_prefix = "/notebooks"
load_other_extensions = True
@ -237,7 +238,7 @@ class NotebookApp(LabServerApp):
super().initialize()
main = launch_new_instance = NotebookApp.launch_instance
main = launch_new_instance = JupyterNotebookApp.launch_instance
if __name__ == "__main__":
main()

View File

@ -4,7 +4,7 @@ module.exports = {
...baseConfig,
timeout: 240000,
use: {
appPath: '/'
appPath: ''
},
retries: 1
};

View File

@ -8,4 +8,5 @@ c.ServerApp.root_dir = mkdtemp(prefix="galata-test-")
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.disable_check_xsrf = True
c.NotebookApp.expose_app_in_browser = True
c.JupyterNotebookApp.expose_app_in_browser = True