support classic notebook server in test extension

This commit is contained in:
Min RK
2023-09-25 14:34:44 +02:00
parent f7b5d8e4c5
commit a1ec5bb09a
2 changed files with 15 additions and 2 deletions

View File

@@ -6,7 +6,15 @@ state we want to check about the server
import json
from jupyter_server.base.handlers import JupyterHandler
try:
from jupyter_server.base.handlers import JupyterHandler
except ImportError:
from notebook.base.handlers import IPythonHandler as JupyterHandler
is_notebook_classic = True
else:
is_notebook_classic = False
from tornado import web
@@ -54,3 +62,8 @@ def _load_jupyter_server_extension(serverapp):
)
]
serverapp.web_app.add_handlers('.*$', handlers)
# classic notebook (<7) name
if is_notebook_classic:
load_jupyter_server_extension = _load_jupyter_server_extension

View File

@@ -37,7 +37,7 @@ Tracker = "https://github.com/jupyterhub/jupyterhub/issues"
[project.optional-dependencies]
# note: updating test dependencies here
# may require updating files in ci/oldest-dependencies/
# may require matching updates in ci/oldest-dependencies/
test = [
"beautifulsoup4[html5lib]",
"coverage",