Skip to content

Commit

Permalink
Fix server extension configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Dec 11, 2022
1 parent beea4b7 commit c5a2724
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions jupyter-config/nbconfig/jupyterlab_rise.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"NotebookApp": {
"nbserver_extensions": {
"jupyterlab_rise": true
}
}
}
7 changes: 7 additions & 0 deletions jupyter-config/server_config/jupyterlab_rise.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ServerApp": {
"jpserver_extensions": {
"jupyterlab_rise": true
}
}
}
4 changes: 3 additions & 1 deletion jupyterlab_rise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .app import RiseApp
from .serverextension import load_jupyter_server_extension
from .serverextension import _load_jupyter_server_extension
from ._version import __version__


Expand All @@ -13,3 +13,5 @@ def _jupyter_labextension_paths():
def _jupyter_server_extension_points():
return [{"module": "jupyterlab_rise", "app": RiseApp}]


load_jupyter_server_extension = _load_jupyter_server_extension
5 changes: 4 additions & 1 deletion jupyterlab_rise/serverextension.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from .app import RiseApp


def load_jupyter_server_extension(serverapp):
def _load_jupyter_server_extension(serverapp):
serverapp.log.info("_load_jp_sever_ext")
extension = RiseApp()
extension.serverapp = serverapp
extension.load_config_file()
extension.update_config(serverapp.config)
extension.parse_command_line(serverapp.extra_args)
extension.initialize()

serverapp.log.info(serverapp.handlers)
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ exclude = [".github", "binder"]
[tool.hatch.build.targets.wheel.shared-data]
"jupyterlab_rise/labextension" = "share/jupyter/labextensions/jupyterlab-rise"
"install.json" = "share/jupyter/labextensions/jupyterlab-rise/install.json"
"jupyter-config/server_config" = "etc/jupyter/jupyter_server_config.d"
"jupyter-config/nbconfig" = "etc/jupyter/jupyter_notebook_config.d"

[tool.hatch.build.hooks.version]
path = "jupyterlab_rise/_version.py"
Expand Down

0 comments on commit c5a2724

Please sign in to comment.