From 269827417380aa28525885695e175c5ea67d517b Mon Sep 17 00:00:00 2001 From: Letian Wang Date: Sat, 1 Feb 2020 15:13:12 +1100 Subject: [PATCH 1/2] upgrade jupyterlab to 1.2.6 --- integration-tests/test_extensions.py | 3 ++- tljh/installer.py | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/test_extensions.py b/integration-tests/test_extensions.py index e351a09..e071279 100644 --- a/integration-tests/test_extensions.py +++ b/integration-tests/test_extensions.py @@ -13,7 +13,7 @@ def test_serverextensions(): ], stderr=subprocess.PIPE) extensions = [ - 'jupyterlab 0.35.4', + 'jupyterlab 1.2.6', 'nbgitpuller 0.6.1', 'nteract_on_jupyter 2.0.7', 'nbresuse ' @@ -51,3 +51,4 @@ def test_labextensions(): """ # Currently we only install jupyterhub assert os.path.exists('/opt/tljh/user/bin/jupyter-labhub') + \ No newline at end of file diff --git a/tljh/installer.py b/tljh/installer.py index 0e8b2ac..e533a82 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -170,14 +170,13 @@ def ensure_jupyterlab_extensions(): Install the JupyterLab extensions we want. """ extensions = [ - '@jupyterlab/hub-extension', - '@jupyter-widgets/jupyterlab-manager' + '@jupyter-widgets/jupyterlab-manager@1.1' # for jupyterlab 1.2.x ] utils.run_subprocess([ os.path.join(USER_ENV_PREFIX, 'bin/jupyter'), 'labextension', 'install' - ] + extensions) + ] + extensions + ['--minimize=False']) # webpack minimization might cause flaky test build def ensure_jupyterhub_package(prefix): @@ -263,7 +262,7 @@ def ensure_user_environment(user_requirements_txt_file): 'jupyterhub==1.0.0', 'notebook==5.7.8', # Install additional notebook frontends! - 'jupyterlab==0.35.4', + 'jupyterlab==1.2.6', 'nteract-on-jupyter==2.0.7', # nbgitpuller for easily pulling in Git repositories 'nbgitpuller==0.6.1', From 66e983624e11ab2f59cd4595284d29c96e866f3e Mon Sep 17 00:00:00 2001 From: Letian Wang Date: Sat, 1 Feb 2020 17:16:14 +1100 Subject: [PATCH 2/2] Update jupyterlab build methods --- tljh/installer.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tljh/installer.py b/tljh/installer.py index e533a82..b64390d 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -172,11 +172,26 @@ def ensure_jupyterlab_extensions(): extensions = [ '@jupyter-widgets/jupyterlab-manager@1.1' # for jupyterlab 1.2.x ] + install_options = [ + '--no-build' # do not build extension at install time. Will build later + ] utils.run_subprocess([ os.path.join(USER_ENV_PREFIX, 'bin/jupyter'), 'labextension', 'install' - ] + extensions + ['--minimize=False']) # webpack minimization might cause flaky test build + ] + extensions + install_options) + + # Build all the lab extensions in one go using jupyter lab build command + build_options = [ + '--minimize=False', + '--dev-build=False' + ] + + utils.run_subprocess([ + os.path.join(USER_ENV_PREFIX, 'bin/jupyter'), + 'lab', + 'build' + ] + build_options) def ensure_jupyterhub_package(prefix):