mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 15:03:02 +00:00
support classic notebook server in test extension
This commit is contained in:
@@ -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
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user