From 3c02eff29d12b02547afc34e59d4aaae908cc765 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Fri, 8 Jan 2021 15:30:18 -0800 Subject: [PATCH] Move open_browser to the top level configs of classes. This follows on changes to Jupyter Server and ExtensionApp which moves open_browser to the ExtensionApp config. See https://github.com/jupyter-server/jupyter_server/pull/375 Fixes #9579 --- examples/example_check.py | 3 ++- jupyterlab/browser_check.py | 3 ++- jupyterlab/labapp.py | 5 ----- jupyterlab/labhubapp.py | 1 - jupyterlab/tests/test_app.py | 4 ---- setup.py | 2 +- 6 files changed, 5 insertions(+), 13 deletions(-) diff --git a/examples/example_check.py b/examples/example_check.py index 490fc37b4e14..539b05f577c8 100644 --- a/examples/example_check.py +++ b/examples/example_check.py @@ -42,8 +42,9 @@ class App(mod.ExampleApp): JS console errors, JS errors, and Python logged errors. """ name = __name__ + open_browser = False + serverapp_config = { - "open_browser": False, "base_url": "/foo/", "root_dir": osp.abspath(example_dir) } diff --git a/jupyterlab/browser_check.py b/jupyterlab/browser_check.py index 97a0d3decc53..3c58edde5e20 100644 --- a/jupyterlab/browser_check.py +++ b/jupyterlab/browser_check.py @@ -175,8 +175,9 @@ class BrowserApp(LabApp): JS console errors, JS errors, and Python logged errors. """ name = __name__ + open_browser = False + serverapp_config = { - "open_browser": False, "base_url": "/foo/" } ip = '127.0.0.1' diff --git a/jupyterlab/labapp.py b/jupyterlab/labapp.py index 6092ce77a22d..7a5d43308490 100644 --- a/jupyterlab/labapp.py +++ b/jupyterlab/labapp.py @@ -546,11 +546,6 @@ class LabApp(NBClassicConfigShimMixin, LabServerApp): expose_app_in_browser = Bool(False, config=True, help="Whether to expose the global app instance to browser via window.jupyterlab") - # By default, open a browser for JupyterLab - serverapp_config = { - "open_browser": True - } - @default('app_dir') def _default_app_dir(self): app_dir = get_app_dir() diff --git a/jupyterlab/labhubapp.py b/jupyterlab/labhubapp.py index 6417fa7feec5..b5ed43f8efcf 100644 --- a/jupyterlab/labhubapp.py +++ b/jupyterlab/labhubapp.py @@ -519,7 +519,6 @@ class OverrideSingleUserNotebookApp(SingleUserNotebookApp): # Disable the default jupyterlab extension and enable ourself serverapp_config = { - "open_browser": True, "jpserver_extensions": { "jupyterlab": False, "jupyterlab.labhubapp": True } } diff --git a/jupyterlab/tests/test_app.py b/jupyterlab/tests/test_app.py index b341d9bf5add..5eb801ee5d77 100644 --- a/jupyterlab/tests/test_app.py +++ b/jupyterlab/tests/test_app.py @@ -256,10 +256,6 @@ class JestApp(ProcessTestApp): test_config = Dict(dict(foo='bar')) - serverapp_config = { - "open_browser": False - } - @deprecated(removed_version=4) def get_command(self): """Get the command to run""" diff --git a/setup.py b/setup.py index cf61c4bd2595..51c326065ccd 100644 --- a/setup.py +++ b/setup.py @@ -147,7 +147,7 @@ def run(self): 'tornado>=6.1.0', 'jupyter_core', 'jupyterlab_server~=2.0', - 'jupyter_server~=1.1', + 'jupyter_server~=1.2', 'nbclassic~=0.2', 'jinja2>=2.10' ]