Merge pull request #3977 from minrk/unpin-nbclassic

unpin nbclassic
This commit is contained in:
Min RK
2022-07-14 21:16:54 -07:00
committed by GitHub
3 changed files with 16 additions and 5 deletions

View File

@@ -12,8 +12,7 @@ mock
# nbclassic provides the '/tree/' handler, which we use in tests # nbclassic provides the '/tree/' handler, which we use in tests
# it is a transitive dependency via jupyterlab, # it is a transitive dependency via jupyterlab,
# but depend on it directly # but depend on it directly
# 0.4 introduces some installation/loading problems (check again after 0.4.3) nbclassic
nbclassic<0.4
pre-commit pre-commit
pytest>=3.3 pytest>=3.3
pytest-asyncio; python_version < "3.7" pytest-asyncio; python_version < "3.7"

View File

@@ -754,7 +754,7 @@ class SingleUserNotebookAppMixin(Configurable):
if env_name in settings: if env_name in settings:
# when running with jupyter-server, classic notebook (nbclassic server extension or notebook v7) # when running with jupyter-server, classic notebook (nbclassic server extension or notebook v7)
# gets its own jinja env, which needs the same patch # gets its own jinja env, which needs the same patch
jinja_envs.append(settings['notebook_jinja2_env']) jinja_envs.append(settings[env_name])
# patch jinja env loading to get modified template, only for base page.html # patch jinja env loading to get modified template, only for base page.html
def get_page(name): def get_page(name):

View File

@@ -195,10 +195,22 @@ def test_singleuser_app_class(JUPYTERHUB_SINGLEUSER_APP):
import jupyter_server # noqa import jupyter_server # noqa
except ImportError: except ImportError:
have_server = False have_server = False
expect_error = "jupyter_server" in JUPYTERHUB_SINGLEUSER_APP
else: else:
have_server = True have_server = True
expect_error = False try:
import notebook.notebookapp # noqa
except ImportError:
have_notebook = False
else:
have_notebook = True
if JUPYTERHUB_SINGLEUSER_APP.startswith("notebook."):
expect_error = not have_notebook
elif JUPYTERHUB_SINGLEUSER_APP.startswith("jupyter_server."):
expect_error = not have_server
else:
# not specified, will try both
expect_error = not (have_server or have_notebook)
if expect_error: if expect_error:
ctx = pytest.raises(CalledProcessError) ctx = pytest.raises(CalledProcessError)