mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +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
|
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
|
from tornado import web
|
||||||
|
|
||||||
|
|
||||||
@@ -54,3 +62,8 @@ def _load_jupyter_server_extension(serverapp):
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
serverapp.web_app.add_handlers('.*$', handlers)
|
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]
|
[project.optional-dependencies]
|
||||||
# note: updating test dependencies here
|
# note: updating test dependencies here
|
||||||
# may require updating files in ci/oldest-dependencies/
|
# may require matching updates in ci/oldest-dependencies/
|
||||||
test = [
|
test = [
|
||||||
"beautifulsoup4[html5lib]",
|
"beautifulsoup4[html5lib]",
|
||||||
"coverage",
|
"coverage",
|
||||||
|
Reference in New Issue
Block a user