From f0237a9c858a23230128348ed791b72bbb2e4b3c Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Tue, 3 Nov 2020 12:50:11 -0800 Subject: [PATCH 01/18] Update to jupyterlab 3 rc6 Also includes major version update --- nbdime/_version.py | 2 +- package.json | 2 +- packages/labextension/package.json | 22 +++++++++++----------- packages/nbdime/package.json | 18 +++++++++--------- packages/webapp/package.json | 22 +++++++++++----------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/nbdime/_version.py b/nbdime/_version.py index 62c098b4..c8544971 100644 --- a/nbdime/_version.py +++ b/nbdime/_version.py @@ -1,2 +1,2 @@ -version_info = (2, 1, 1, 'dev') +version_info = (3, 0, 0, 'dev') __version__ = ".".join(map(str, version_info)) diff --git a/package.json b/package.json index 0614dc67..a1e6990d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "watch": "tsc --build --watch" }, "devDependencies": { - "@jupyterlab/buildutils": "^2.0.0", + "@jupyterlab/buildutils": "^3.0.0-rc.6", "lerna": "^3.14.1", "rimraf": "^2.6.3" } diff --git a/packages/labextension/package.json b/packages/labextension/package.json index dfebef1d..61a87be4 100644 --- a/packages/labextension/package.json +++ b/packages/labextension/package.json @@ -1,6 +1,6 @@ { "name": "nbdime-jupyterlab", - "version": "2.0.1", + "version": "3.0.0", "description": "A JupyterLab extension for showing Notebook diffs.", "keywords": [ "jupyter", @@ -38,22 +38,22 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/apputils": "^2.0.0", - "@jupyterlab/coreutils": "^4.0.0", - "@jupyterlab/nbformat": "^2.0.0", - "@jupyterlab/notebook": "^2.0.0", - "@jupyterlab/rendermime": "^2.0.0", - "@jupyterlab/services": "^5.0.0", - "@jupyterlab/settingregistry": "^2.0.0", + "@jupyterlab/apputils": "^3.0.0-rc.6", + "@jupyterlab/coreutils": "^5.0.0-rc.6", + "@jupyterlab/nbformat": "^3.0.0-rc.6", + "@jupyterlab/notebook": "^3.0.0-rc.6", + "@jupyterlab/rendermime": "^3.0.0-rc.6", + "@jupyterlab/services": "^6.0.0-rc.6", + "@jupyterlab/settingregistry": "^3.0.0-rc.6", "@lumino/algorithm": "^1.1.2", "@lumino/coreutils": "^1.3.0", "@lumino/disposable": "^1.1.2", "@lumino/widgets": "^1.6.0", - "nbdime": "^6.0.0" + "nbdime": "^7.0.0" }, "devDependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/docregistry": "^2.0.0", + "@jupyterlab/application": "^3.0.0-rc.6", + "@jupyterlab/docregistry": "^3.0.0-rc.6", "@lumino/commands": "^1.6.1", "mkdirp": "^0.5.1", "rimraf": "^2.6.3", diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index 88ee9038..9c1d52fd 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -1,6 +1,6 @@ { "name": "nbdime", - "version": "6.0.0", + "version": "7.0.0", "description": "Diff and merge of Jupyter Notebooks", "repository": { "type": "git", @@ -23,13 +23,13 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/codeeditor": "^2.0.0", - "@jupyterlab/codemirror": "^2.0.0", - "@jupyterlab/coreutils": "^4.0.0", - "@jupyterlab/nbformat": "^2.0.0", - "@jupyterlab/outputarea": "^2.0.0", - "@jupyterlab/rendermime": "^2.0.0", - "@jupyterlab/services": "^5.0.0", + "@jupyterlab/codeeditor": "^3.0.0-rc.6", + "@jupyterlab/codemirror": "^3.0.0-rc.6", + "@jupyterlab/coreutils": "^5.0.0-rc.6", + "@jupyterlab/nbformat": "^3.0.0-rc.6", + "@jupyterlab/outputarea": "^3.0.0-rc.6", + "@jupyterlab/rendermime": "^3.0.0-rc.6", + "@jupyterlab/services": "^6.0.0-rc.6", "@lumino/algorithm": "^1.1.2", "@lumino/coreutils": "^1.3.0", "@lumino/dragdrop": "^1.3.0", @@ -38,7 +38,7 @@ "json-stable-stringify": "^1.0.1" }, "devDependencies": { - "@jupyterlab/apputils": "^2.0.0", + "@jupyterlab/apputils": "^3.0.0-rc.6", "@lumino/messaging": "^1.2.2", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index c425b36f..e4b1fd16 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -13,21 +13,21 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.12.0", - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/apputils": "^2.0.0", - "@jupyterlab/cells": "^2.0.0", - "@jupyterlab/codemirror": "^2.0.0", - "@jupyterlab/coreutils": "^4.0.0", - "@jupyterlab/mathjax2": "^2.0.0", - "@jupyterlab/nbformat": "^2.0.0", - "@jupyterlab/notebook": "^2.0.0", - "@jupyterlab/rendermime": "^2.0.0", - "@jupyterlab/theme-light-extension": "^2.0.0", + "@jupyterlab/application": "^3.0.0-rc.6", + "@jupyterlab/apputils": "^3.0.0-rc.6", + "@jupyterlab/cells": "^3.0.0-rc.6", + "@jupyterlab/codemirror": "^3.0.0-rc.6", + "@jupyterlab/coreutils": "^5.0.0-rc.6", + "@jupyterlab/mathjax2": "^3.0.0-rc.6", + "@jupyterlab/nbformat": "^3.0.0-rc.6", + "@jupyterlab/notebook": "^3.0.0-rc.6", + "@jupyterlab/rendermime": "^3.0.0-rc.6", + "@jupyterlab/theme-light-extension": "^3.0.0-rc.6", "@lumino/dragdrop": "^1.3.0", "@lumino/widgets": "^1.6.0", "alertify.js": "^1.0.12", "file-saver": "^2.0.1", - "nbdime": "^6.0.0" + "nbdime": "^7.0.0" }, "devDependencies": { "@types/file-saver": "^2.0.0", From 622e68e503be55aa9e51db9b8d3620b647e03e1b Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Thu, 3 Dec 2020 15:02:29 -0800 Subject: [PATCH 02/18] update to rc11 --- package.json | 2 +- packages/labextension/package.json | 18 +++++++++--------- packages/nbdime/package.json | 16 ++++++++-------- packages/webapp/package.json | 20 ++++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index a1e6990d..e5fd75f0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "watch": "tsc --build --watch" }, "devDependencies": { - "@jupyterlab/buildutils": "^3.0.0-rc.6", + "@jupyterlab/buildutils": "^3.0.0-rc.11", "lerna": "^3.14.1", "rimraf": "^2.6.3" } diff --git a/packages/labextension/package.json b/packages/labextension/package.json index 61a87be4..bd1d35b6 100644 --- a/packages/labextension/package.json +++ b/packages/labextension/package.json @@ -38,13 +38,13 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/apputils": "^3.0.0-rc.6", - "@jupyterlab/coreutils": "^5.0.0-rc.6", - "@jupyterlab/nbformat": "^3.0.0-rc.6", - "@jupyterlab/notebook": "^3.0.0-rc.6", - "@jupyterlab/rendermime": "^3.0.0-rc.6", - "@jupyterlab/services": "^6.0.0-rc.6", - "@jupyterlab/settingregistry": "^3.0.0-rc.6", + "@jupyterlab/apputils": "^3.0.0-rc.11", + "@jupyterlab/coreutils": "^5.0.0-rc.11", + "@jupyterlab/nbformat": "^3.0.0-rc.11", + "@jupyterlab/notebook": "^3.0.0-rc.11", + "@jupyterlab/rendermime": "^3.0.0-rc.11", + "@jupyterlab/services": "^6.0.0-rc.11", + "@jupyterlab/settingregistry": "^3.0.0-rc.11", "@lumino/algorithm": "^1.1.2", "@lumino/coreutils": "^1.3.0", "@lumino/disposable": "^1.1.2", @@ -52,8 +52,8 @@ "nbdime": "^7.0.0" }, "devDependencies": { - "@jupyterlab/application": "^3.0.0-rc.6", - "@jupyterlab/docregistry": "^3.0.0-rc.6", + "@jupyterlab/application": "^3.0.0-rc.11", + "@jupyterlab/docregistry": "^3.0.0-rc.11", "@lumino/commands": "^1.6.1", "mkdirp": "^0.5.1", "rimraf": "^2.6.3", diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index 9c1d52fd..bb8e33b0 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -23,13 +23,13 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/codeeditor": "^3.0.0-rc.6", - "@jupyterlab/codemirror": "^3.0.0-rc.6", - "@jupyterlab/coreutils": "^5.0.0-rc.6", - "@jupyterlab/nbformat": "^3.0.0-rc.6", - "@jupyterlab/outputarea": "^3.0.0-rc.6", - "@jupyterlab/rendermime": "^3.0.0-rc.6", - "@jupyterlab/services": "^6.0.0-rc.6", + "@jupyterlab/codeeditor": "^3.0.0-rc.11", + "@jupyterlab/codemirror": "^3.0.0-rc.11", + "@jupyterlab/coreutils": "^5.0.0-rc.11", + "@jupyterlab/nbformat": "^3.0.0-rc.11", + "@jupyterlab/outputarea": "^3.0.0-rc.11", + "@jupyterlab/rendermime": "^3.0.0-rc.11", + "@jupyterlab/services": "^6.0.0-rc.11", "@lumino/algorithm": "^1.1.2", "@lumino/coreutils": "^1.3.0", "@lumino/dragdrop": "^1.3.0", @@ -38,7 +38,7 @@ "json-stable-stringify": "^1.0.1" }, "devDependencies": { - "@jupyterlab/apputils": "^3.0.0-rc.6", + "@jupyterlab/apputils": "^3.0.0-rc.11", "@lumino/messaging": "^1.2.2", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index e4b1fd16..c059c294 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -13,16 +13,16 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.12.0", - "@jupyterlab/application": "^3.0.0-rc.6", - "@jupyterlab/apputils": "^3.0.0-rc.6", - "@jupyterlab/cells": "^3.0.0-rc.6", - "@jupyterlab/codemirror": "^3.0.0-rc.6", - "@jupyterlab/coreutils": "^5.0.0-rc.6", - "@jupyterlab/mathjax2": "^3.0.0-rc.6", - "@jupyterlab/nbformat": "^3.0.0-rc.6", - "@jupyterlab/notebook": "^3.0.0-rc.6", - "@jupyterlab/rendermime": "^3.0.0-rc.6", - "@jupyterlab/theme-light-extension": "^3.0.0-rc.6", + "@jupyterlab/application": "^3.0.0-rc.11", + "@jupyterlab/apputils": "^3.0.0-rc.11", + "@jupyterlab/cells": "^3.0.0-rc.11", + "@jupyterlab/codemirror": "^3.0.0-rc.11", + "@jupyterlab/coreutils": "^5.0.0-rc.11", + "@jupyterlab/mathjax2": "^3.0.0-rc.11", + "@jupyterlab/nbformat": "^3.0.0-rc.11", + "@jupyterlab/notebook": "^3.0.0-rc.11", + "@jupyterlab/rendermime": "^3.0.0-rc.11", + "@jupyterlab/theme-light-extension": "^3.0.0-rc.11", "@lumino/dragdrop": "^1.3.0", "@lumino/widgets": "^1.6.0", "alertify.js": "^1.0.12", From 1c701c1e872002897ef07e17abfbe3723cb4dee6 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Tue, 8 Dec 2020 18:15:11 -0800 Subject: [PATCH 03/18] update to jupyter_server and update lumino version --- jupyter-config/jupyter_notebook_config.d/nbdime.json | 7 ------- jupyter-config/jupyter_server_config.d/nbdime.json | 7 +++++++ nbdime/__init__.py | 6 +++--- nbdime/_version.py | 2 +- nbdime/webapp/nb_server_extension.py | 6 +++--- nbdime/webapp/nbdimeserver.py | 10 +++++----- packages/labextension/package.json | 8 ++++---- packages/nbdime/package.json | 10 +++++----- packages/webapp/package.json | 4 ++-- setup.py | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 jupyter-config/jupyter_notebook_config.d/nbdime.json create mode 100644 jupyter-config/jupyter_server_config.d/nbdime.json diff --git a/jupyter-config/jupyter_notebook_config.d/nbdime.json b/jupyter-config/jupyter_notebook_config.d/nbdime.json deleted file mode 100644 index e21b0263..00000000 --- a/jupyter-config/jupyter_notebook_config.d/nbdime.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "NotebookApp": { - "nbserver_extensions": { - "nbdime": true - } - } -} diff --git a/jupyter-config/jupyter_server_config.d/nbdime.json b/jupyter-config/jupyter_server_config.d/nbdime.json new file mode 100644 index 00000000..bbd17adc --- /dev/null +++ b/jupyter-config/jupyter_server_config.d/nbdime.json @@ -0,0 +1,7 @@ +{ + "ServerApp": { + "jpserver_extensions": { + "nbdime": true + } + } +} diff --git a/nbdime/__init__.py b/nbdime/__init__.py index c2d4d046..7ab08500 100644 --- a/nbdime/__init__.py +++ b/nbdime/__init__.py @@ -12,13 +12,13 @@ from .merging import merge_notebooks, decide_merge, apply_decisions -def load_jupyter_server_extension(nb_server_app): +def _load_jupyter_server_extension(nb_server_app): # Wrap this here to avoid pulling in webapp in a normal run from .webapp.nb_server_extension import _load_jupyter_server_extension _load_jupyter_server_extension(nb_server_app) -def _jupyter_server_extension_paths(): +def _jupyter_server_extension_points(): return [{ "module": "nbdime" }] @@ -40,5 +40,5 @@ def _jupyter_nbextension_paths(): "diff", "diff_notebooks", "patch", "patch_notebook", "decide_merge", "merge_notebooks", "apply_decisions", - "load_jupyter_server_extension", + "_load_jupyter_server_extension", ] diff --git a/nbdime/_version.py b/nbdime/_version.py index c8544971..9ad427e0 100644 --- a/nbdime/_version.py +++ b/nbdime/_version.py @@ -1,2 +1,2 @@ -version_info = (3, 0, 0, 'dev') +version_info = (3, 0, 0, 'dev0') __version__ = ".".join(map(str, version_info)) diff --git a/nbdime/webapp/nb_server_extension.py b/nbdime/webapp/nb_server_extension.py index 8e445bbd..3396e9cd 100644 --- a/nbdime/webapp/nb_server_extension.py +++ b/nbdime/webapp/nb_server_extension.py @@ -8,9 +8,9 @@ from jinja2 import ChoiceLoader, FileSystemLoader -from notebook.utils import url_path_join, to_os_path -from notebook.services.contents.checkpoints import GenericCheckpointsMixin -from notebook.services.contents.filecheckpoints import FileCheckpoints +from jupyter_server.utils import url_path_join, to_os_path +from jupyter_server.services.contents.checkpoints import GenericCheckpointsMixin +from jupyter_server.services.contents.filecheckpoints import FileCheckpoints from tornado.web import HTTPError, escape, authenticated, gen from ..args import process_diff_flags diff --git a/nbdime/webapp/nbdimeserver.py b/nbdime/webapp/nbdimeserver.py index 90fd5891..e4463a74 100644 --- a/nbdime/webapp/nbdimeserver.py +++ b/nbdime/webapp/nbdimeserver.py @@ -12,10 +12,10 @@ from jinja2 import FileSystemLoader, Environment import nbformat -from notebook.base.handlers import IPythonHandler, APIHandler -from notebook import DEFAULT_STATIC_FILES_PATH -from notebook.utils import url_path_join -from notebook.log import log_request +from jupyter_server.base.handlers import JupyterHandler, APIHandler +from jupyter_server import DEFAULT_STATIC_FILES_PATH +from jupyter_server.utils import url_path_join +from jupyter_server.log import log_request import requests from six import string_types from tornado import ioloop, web, escape, netutil, httpserver @@ -43,7 +43,7 @@ template_path = os.path.join(here, 'templates') -class NbdimeHandler(IPythonHandler): +class NbdimeHandler(JupyterHandler): def initialize(self, **params): self.params = params diff --git a/packages/labextension/package.json b/packages/labextension/package.json index bd1d35b6..e54ddef6 100644 --- a/packages/labextension/package.json +++ b/packages/labextension/package.json @@ -45,10 +45,10 @@ "@jupyterlab/rendermime": "^3.0.0-rc.11", "@jupyterlab/services": "^6.0.0-rc.11", "@jupyterlab/settingregistry": "^3.0.0-rc.11", - "@lumino/algorithm": "^1.1.2", - "@lumino/coreutils": "^1.3.0", - "@lumino/disposable": "^1.1.2", - "@lumino/widgets": "^1.6.0", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", + "@lumino/disposable": "^1.4.3", + "@lumino/widgets": "^1.16.0", "nbdime": "^7.0.0" }, "devDependencies": { diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index bb8e33b0..c0f633e1 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -30,11 +30,11 @@ "@jupyterlab/outputarea": "^3.0.0-rc.11", "@jupyterlab/rendermime": "^3.0.0-rc.11", "@jupyterlab/services": "^6.0.0-rc.11", - "@lumino/algorithm": "^1.1.2", - "@lumino/coreutils": "^1.3.0", - "@lumino/dragdrop": "^1.3.0", - "@lumino/signaling": "^1.2.2", - "@lumino/widgets": "^1.6.0", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", + "@lumino/dragdrop": "^1.7.0", + "@lumino/signaling": "^1.4.3", + "@lumino/widgets": "^1.16.0", "json-stable-stringify": "^1.0.1" }, "devDependencies": { diff --git a/packages/webapp/package.json b/packages/webapp/package.json index c059c294..13acbabb 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -23,8 +23,8 @@ "@jupyterlab/notebook": "^3.0.0-rc.11", "@jupyterlab/rendermime": "^3.0.0-rc.11", "@jupyterlab/theme-light-extension": "^3.0.0-rc.11", - "@lumino/dragdrop": "^1.3.0", - "@lumino/widgets": "^1.6.0", + "@lumino/dragdrop": "^1.7.0", + "@lumino/widgets": "^1.16.0", "alertify.js": "^1.0.12", "file-saver": "^2.0.1", "nbdime": "^7.0.0" diff --git a/setup.py b/setup.py index 73a73b74..3d502355 100644 --- a/setup.py +++ b/setup.py @@ -115,7 +115,7 @@ 'tornado', 'requests', 'GitPython!=2.1.4, !=2.1.5, !=2.1.6', # For difftool taking git refs - 'notebook', + 'jupyter_server', 'jinja2>=2.9', ] From d3dde51c24cd11b0d414874877af96d5d2746906 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Mon, 14 Dec 2020 14:37:50 -0800 Subject: [PATCH 04/18] reenable nbserver extension --- jupyter-config/jupyter_notebook_config.d/nbdime.json | 7 +++++++ nbdime/__init__.py | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 jupyter-config/jupyter_notebook_config.d/nbdime.json diff --git a/jupyter-config/jupyter_notebook_config.d/nbdime.json b/jupyter-config/jupyter_notebook_config.d/nbdime.json new file mode 100644 index 00000000..e21b0263 --- /dev/null +++ b/jupyter-config/jupyter_notebook_config.d/nbdime.json @@ -0,0 +1,7 @@ +{ + "NotebookApp": { + "nbserver_extensions": { + "nbdime": true + } + } +} diff --git a/nbdime/__init__.py b/nbdime/__init__.py index 7ab08500..0a3c6199 100644 --- a/nbdime/__init__.py +++ b/nbdime/__init__.py @@ -12,18 +12,24 @@ from .merging import merge_notebooks, decide_merge, apply_decisions -def _load_jupyter_server_extension(nb_server_app): +def load_jupyter_server_extension(nb_server_app): # Wrap this here to avoid pulling in webapp in a normal run from .webapp.nb_server_extension import _load_jupyter_server_extension _load_jupyter_server_extension(nb_server_app) -def _jupyter_server_extension_points(): +_load_jupyter_server_extension = load_jupyter_server_extension + + +def _jupyter_server_extension_paths(): return [{ "module": "nbdime" }] +_jupyter_server_extension_points = _jupyter_server_extension_paths + + def _jupyter_nbextension_paths(): return [dict( section="notebook", @@ -40,5 +46,6 @@ def _jupyter_nbextension_paths(): "diff", "diff_notebooks", "patch", "patch_notebook", "decide_merge", "merge_notebooks", "apply_decisions", + "load_jupyter_server_extension", "_load_jupyter_server_extension", ] From 1c247f41c56a9cab2df98dec457c05f99db3c92f Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 09:14:40 -0800 Subject: [PATCH 05/18] update dev docs --- docs/source/installing.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/source/installing.rst b/docs/source/installing.rst index 6eb41de1..251794cb 100644 --- a/docs/source/installing.rst +++ b/docs/source/installing.rst @@ -89,10 +89,14 @@ Installing Jupyter extensions If you want to use the development version of the notebook and lab extensions, you will also have to run the following commands after the pip dev install:: - jupyter serverextension enable --py nbdime [--sys-prefix/--user/--system] +> Note: only run one of the following two server commands, running both can cause issues in some cases - jupyter nbextension install --py nbdime [--sym-link] [--sys-prefix/--user/--system] - jupyter nbextension enable --py nbdime [--sys-prefix/--user/--system] + jupyter serverextension enable --py nbdime --sys-prefix # if developing for jupyter notebook + + jupyter server extension enable nbdime # if developing for jupyter lab or nbclassic + + jupyter nbextension install --py nbdime --sys-prefix [--sym-link] + jupyter nbextension enable --py nbdime --sys-prefix jupyter labextension link ./packages/nbdime --no-build jupyter labextension install ./packages/labextension From d388a8e8e33c62318db3accaf01d055e3d5dcc72 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 09:17:57 -0800 Subject: [PATCH 06/18] update to 3.0.0 --- package.json | 2 +- packages/labextension/package.json | 18 +++++++++--------- packages/nbdime/package.json | 16 ++++++++-------- packages/webapp/package.json | 20 ++++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index e5fd75f0..612fb710 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "watch": "tsc --build --watch" }, "devDependencies": { - "@jupyterlab/buildutils": "^3.0.0-rc.11", + "@jupyterlab/buildutils": "^3.0.0", "lerna": "^3.14.1", "rimraf": "^2.6.3" } diff --git a/packages/labextension/package.json b/packages/labextension/package.json index e54ddef6..2677f255 100644 --- a/packages/labextension/package.json +++ b/packages/labextension/package.json @@ -38,13 +38,13 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/apputils": "^3.0.0-rc.11", - "@jupyterlab/coreutils": "^5.0.0-rc.11", - "@jupyterlab/nbformat": "^3.0.0-rc.11", - "@jupyterlab/notebook": "^3.0.0-rc.11", - "@jupyterlab/rendermime": "^3.0.0-rc.11", - "@jupyterlab/services": "^6.0.0-rc.11", - "@jupyterlab/settingregistry": "^3.0.0-rc.11", + "@jupyterlab/apputils": "^3.0.0", + "@jupyterlab/coreutils": "^5.0.0", + "@jupyterlab/nbformat": "^3.0.0", + "@jupyterlab/notebook": "^3.0.0", + "@jupyterlab/rendermime": "^3.0.0", + "@jupyterlab/services": "^6.0.0", + "@jupyterlab/settingregistry": "^3.0.0", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/disposable": "^1.4.3", @@ -52,8 +52,8 @@ "nbdime": "^7.0.0" }, "devDependencies": { - "@jupyterlab/application": "^3.0.0-rc.11", - "@jupyterlab/docregistry": "^3.0.0-rc.11", + "@jupyterlab/application": "^3.0.0", + "@jupyterlab/docregistry": "^3.0.0", "@lumino/commands": "^1.6.1", "mkdirp": "^0.5.1", "rimraf": "^2.6.3", diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index c0f633e1..6098526e 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -23,13 +23,13 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/codeeditor": "^3.0.0-rc.11", - "@jupyterlab/codemirror": "^3.0.0-rc.11", - "@jupyterlab/coreutils": "^5.0.0-rc.11", - "@jupyterlab/nbformat": "^3.0.0-rc.11", - "@jupyterlab/outputarea": "^3.0.0-rc.11", - "@jupyterlab/rendermime": "^3.0.0-rc.11", - "@jupyterlab/services": "^6.0.0-rc.11", + "@jupyterlab/codeeditor": "^3.0.0", + "@jupyterlab/codemirror": "^3.0.0", + "@jupyterlab/coreutils": "^5.0.0", + "@jupyterlab/nbformat": "^3.0.0", + "@jupyterlab/outputarea": "^3.0.0", + "@jupyterlab/rendermime": "^3.0.0", + "@jupyterlab/services": "^6.0.0", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/dragdrop": "^1.7.0", @@ -38,7 +38,7 @@ "json-stable-stringify": "^1.0.1" }, "devDependencies": { - "@jupyterlab/apputils": "^3.0.0-rc.11", + "@jupyterlab/apputils": "^3.0.0", "@lumino/messaging": "^1.2.2", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 13acbabb..8344a7ae 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -13,16 +13,16 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.12.0", - "@jupyterlab/application": "^3.0.0-rc.11", - "@jupyterlab/apputils": "^3.0.0-rc.11", - "@jupyterlab/cells": "^3.0.0-rc.11", - "@jupyterlab/codemirror": "^3.0.0-rc.11", - "@jupyterlab/coreutils": "^5.0.0-rc.11", - "@jupyterlab/mathjax2": "^3.0.0-rc.11", - "@jupyterlab/nbformat": "^3.0.0-rc.11", - "@jupyterlab/notebook": "^3.0.0-rc.11", - "@jupyterlab/rendermime": "^3.0.0-rc.11", - "@jupyterlab/theme-light-extension": "^3.0.0-rc.11", + "@jupyterlab/application": "^3.0.0", + "@jupyterlab/apputils": "^3.0.0", + "@jupyterlab/cells": "^3.0.0", + "@jupyterlab/codemirror": "^3.0.0", + "@jupyterlab/coreutils": "^5.0.0", + "@jupyterlab/mathjax2": "^3.0.0", + "@jupyterlab/nbformat": "^3.0.0", + "@jupyterlab/notebook": "^3.0.0", + "@jupyterlab/rendermime": "^3.0.0", + "@jupyterlab/theme-light-extension": "^3.0.0", "@lumino/dragdrop": "^1.7.0", "@lumino/widgets": "^1.16.0", "alertify.js": "^1.0.12", From 6b7a6f79a148488f3a76cb2994da0b08e12b6c7f Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 09:21:57 -0800 Subject: [PATCH 07/18] update tests --- .gitignore | 1 + conftest.py | 4 + ...on.py => test_classic_server_extension.py} | 4 +- nbdime/tests/test_jupyter_server_extension.py | 273 ++++++++++++++++++ nbdime/webapp/nb_server_extension.py | 14 +- setup.py | 2 + 6 files changed, 292 insertions(+), 6 deletions(-) rename nbdime/tests/{test_server_extension.py => test_classic_server_extension.py} (99%) create mode 100644 nbdime/tests/test_jupyter_server_extension.py diff --git a/.gitignore b/.gitignore index 4917b6f2..9757ef79 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ MANIFEST .coverage .cache .pytest_cache +.idea .spyderproject diff --git a/conftest.py b/conftest.py index 1381b13f..22774feb 100644 --- a/conftest.py +++ b/conftest.py @@ -1,5 +1,9 @@ import pytest +# Add the jupyter_Server plugin for testing against jupyter_server +pytest_plugins = ("jupyter_server.pytest_plugin",) + + def pytest_addoption(parser): parser.addoption("--quick", action="store_true", default=False, help="skip slow tests") diff --git a/nbdime/tests/test_server_extension.py b/nbdime/tests/test_classic_server_extension.py similarity index 99% rename from nbdime/tests/test_server_extension.py rename to nbdime/tests/test_classic_server_extension.py index 40d37269..e206ca7f 100644 --- a/nbdime/tests/test_server_extension.py +++ b/nbdime/tests/test_classic_server_extension.py @@ -149,7 +149,6 @@ def test_diff_api_checkpoint(tmpdir, filespath, server_extension_app): if os.sep == '\\': url_path = url_path.replace('\\', '/') - # Create checkpoint url = 'http://127.0.0.1:%i/api/contents/%s/checkpoints' % ( server_extension_app['port'], @@ -164,7 +163,8 @@ def test_diff_api_checkpoint(tmpdir, filespath, server_extension_app): url = 'http://127.0.0.1:%i/nbdime/api/diff' % server_extension_app['port'] r = requests.post( - url, headers=auth_header, + url, + headers=auth_header, data=json.dumps({ 'base': 'checkpoint:' + url_path, })) diff --git a/nbdime/tests/test_jupyter_server_extension.py b/nbdime/tests/test_jupyter_server_extension.py new file mode 100644 index 00000000..5c2a44f9 --- /dev/null +++ b/nbdime/tests/test_jupyter_server_extension.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +import json +import os +import re +import shutil + +import pytest + +import nbformat + +from tornado.httpclient import HTTPError + +from ..utils import pushd +from .utils import WEB_TEST_TIMEOUT, TEST_TOKEN, call + + +pjoin = os.path.join + +_re_config = re.compile( + """""" +) + +@pytest.fixture +def jp_server_config(): + return { + "ServerApp": { + "jpserver_extensions": { + "nbdime": True + } + } + } + + +def read_response(response): + """Extract the useful pieces from a torando HTTPResponse object""" + # raise exception if it exists. + if response.error: + raise response.error + # Decode the body. + body = response.body.decode() + # Parse if it's JSON + try: + body = json.loads(body) + # If the body is empty, set the body to None. + except json.decoder.JSONDecodeError: + pass + code = response.code + return code, body + + +@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) +async def test_isgit(git_repo2, jp_fetch): + r = await jp_fetch( + 'nbdime/api/isgit', + method='POST', + body=json.dumps({ + 'path': git_repo2, + }) + ) + code, body = read_response(r) + assert body == {'is_git': True} + + +@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) +async def test_isgit_nonrepo(git_repo2, jp_root_dir, jp_fetch): + r = await jp_fetch( + 'nbdime/api/isgit', + method='POST', + body=json.dumps({ + # Give a random patch that doesn't have a git repo. + 'path': str(jp_root_dir), + }) + ) + code, body = read_response(r) + assert body == {'is_git': False} + + +@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) +async def test_difftool(git_repo2, jp_fetch): + r = await jp_fetch('nbdime/difftool') + code, body = read_response(r) + assert code == 200 + + +@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) +async def test_git_difftool(git_repo2, jp_fetch, jp_base_url): + r = await jp_fetch( + 'nbdime/git-difftool', + ) + code, body = read_response(r) + assert body.startswith('=2.9', ] @@ -125,6 +126,7 @@ 'pytest-cov', 'pytest-timeout', 'pytest-tornado', + 'jupyter_server[test]', 'jsonschema', 'mock', 'requests', From ec300b33a88516bad9f83549561d6c3085d06473 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 14:09:09 -0800 Subject: [PATCH 08/18] fixed misleading doc --- docs/source/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/testing.rst b/docs/source/testing.rst index 340d2288..e5305323 100644 --- a/docs/source/testing.rst +++ b/docs/source/testing.rst @@ -11,7 +11,7 @@ Dependencies Install the test dependencies:: - pip install "nbdime[test]" + pip install .[test] Running tests locally --------------------- From 3fe89666706ebdfe97360749451239e1384669ca Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 14:29:14 -0800 Subject: [PATCH 09/18] add nbclassic dep --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8ce12941..0457bca3 100644 --- a/setup.py +++ b/setup.py @@ -116,6 +116,7 @@ 'requests', 'GitPython!=2.1.4, !=2.1.5, !=2.1.6', # For difftool taking git refs 'notebook', + 'nbclassic', 'jupyter_server', 'jinja2>=2.9', ] From 2fcb8e1f1c7f53d5a45e2af6ed8deb9da5810035 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 14:53:10 -0800 Subject: [PATCH 10/18] try another CI fix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 119c293f..78d4837a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ install: # Don't use -v with JS as travis chokes with [Errno 11] write could not complete without blocking - | if [[ $GROUP == python ]]; then + pip install jupyter_server[test] pip install --upgrade --upgrade-strategy=eager ".[test]" -v elif [[ $GROUP == js ]]; then pip install --upgrade --upgrade-strategy=eager -e ".[test]" From 998c6d4816a5de273878dea66a97afebc0356a78 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 15:35:05 -0800 Subject: [PATCH 11/18] Addressed local and CI test failures --- .travis.yml | 1 - conftest.py | 4 ---- nbdime/tests/conftest.py | 3 +++ nbdime/tests/test_git_filter_integration.py | 6 +----- setup.py | 1 - 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78d4837a..119c293f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,6 @@ install: # Don't use -v with JS as travis chokes with [Errno 11] write could not complete without blocking - | if [[ $GROUP == python ]]; then - pip install jupyter_server[test] pip install --upgrade --upgrade-strategy=eager ".[test]" -v elif [[ $GROUP == js ]]; then pip install --upgrade --upgrade-strategy=eager -e ".[test]" diff --git a/conftest.py b/conftest.py index 22774feb..1381b13f 100644 --- a/conftest.py +++ b/conftest.py @@ -1,9 +1,5 @@ import pytest -# Add the jupyter_Server plugin for testing against jupyter_server -pytest_plugins = ("jupyter_server.pytest_plugin",) - - def pytest_addoption(parser): parser.addoption("--quick", action="store_true", default=False, help="skip slow tests") diff --git a/nbdime/tests/conftest.py b/nbdime/tests/conftest.py index b965a5d3..84b4399c 100644 --- a/nbdime/tests/conftest.py +++ b/nbdime/tests/conftest.py @@ -50,6 +50,9 @@ def popen_wait(p, timeout): schema_dir = os.path.abspath(pjoin(os.path.dirname(__file__), "..")) +# Add the jupyter_Server plugin for testing against jupyter_server +pytest_plugins = ("jupyter_server.pytest_plugin",) + def testspath(): return os.path.abspath(os.path.dirname(__file__)) diff --git a/nbdime/tests/test_git_filter_integration.py b/nbdime/tests/test_git_filter_integration.py index b090de9c..2de0146b 100644 --- a/nbdime/tests/test_git_filter_integration.py +++ b/nbdime/tests/test_git_filter_integration.py @@ -98,11 +98,7 @@ def test_apply_filter_invalid_filter(git_repo): def test_apply_filter_valid_filter(git_repo): - try: - call('cat --help') - filter_cmd = 'cat' - except (CalledProcessError, FileNotFoundError): - filter_cmd = 'findstr x*' + filter_cmd = 'findstr x*' if os.name == 'nt' else 'cat' path = pjoin(git_repo, 'diff.ipynb') gitattr = locate_gitattributes() with io.open(gitattr, 'a', encoding="utf8") as f: diff --git a/setup.py b/setup.py index 0457bca3..8ce12941 100644 --- a/setup.py +++ b/setup.py @@ -116,7 +116,6 @@ 'requests', 'GitPython!=2.1.4, !=2.1.5, !=2.1.6', # For difftool taking git refs 'notebook', - 'nbclassic', 'jupyter_server', 'jinja2>=2.9', ] From 5ec9389b285112b71d1037387d581b268f3aea66 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 16:04:00 -0800 Subject: [PATCH 12/18] fix dep failure --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8ce12941..7cb98282 100644 --- a/setup.py +++ b/setup.py @@ -127,6 +127,7 @@ 'pytest-timeout', 'pytest-tornado', 'jupyter_server[test]', + 'pytest-tornasync', 'jsonschema', 'mock', 'requests', From acc90b0ef0be55f4571967fa77dd9bcc8d571aaa Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 6 Jan 2021 16:16:00 -0800 Subject: [PATCH 13/18] remove uneeded CI fixes --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 7cb98282..8ce12941 100644 --- a/setup.py +++ b/setup.py @@ -127,7 +127,6 @@ 'pytest-timeout', 'pytest-tornado', 'jupyter_server[test]', - 'pytest-tornasync', 'jsonschema', 'mock', 'requests', From fabc6cc6a46ddf9649e8d430a214184fa7ddc750 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Thu, 7 Jan 2021 13:24:22 +0100 Subject: [PATCH 14/18] fix server extension tests --- nbdime/tests/conftest.py | 25 +- nbdime/tests/test_jupyter_server_extension.py | 273 ------------------ ..._extension.py => test_server_extension.py} | 3 +- 3 files changed, 16 insertions(+), 285 deletions(-) delete mode 100644 nbdime/tests/test_jupyter_server_extension.py rename nbdime/tests/{test_classic_server_extension.py => test_server_extension.py} (98%) diff --git a/nbdime/tests/conftest.py b/nbdime/tests/conftest.py index 84b4399c..d3d509f0 100644 --- a/nbdime/tests/conftest.py +++ b/nbdime/tests/conftest.py @@ -50,9 +50,6 @@ def popen_wait(p, timeout): schema_dir = os.path.abspath(pjoin(os.path.dirname(__file__), "..")) -# Add the jupyter_Server plugin for testing against jupyter_server -pytest_plugins = ("jupyter_server.pytest_plugin",) - def testspath(): return os.path.abspath(os.path.dirname(__file__)) @@ -444,11 +441,14 @@ def _term(): -def create_server_extension_config(tmpdir_factory): +def create_server_extension_config(tmpdir_factory, cmd): + appname = 'NotebookApp' if cmd == 'notebook' else 'ServerApp' + filename = 'jupyter_notebook_config.json' if cmd == 'notebook' else 'jupyter_server_config.json' + config_entry = 'nbserver_extensions' if cmd == 'notebook' else 'jpserver_extensions' path = tmpdir_factory.mktemp('server-extension-config') config = { - "NotebookApp": { - "nbserver_extensions": { + appname: { + config_entry: { "nbdime": True } } @@ -456,13 +456,16 @@ def create_server_extension_config(tmpdir_factory): config_str = json.dumps(config) if isinstance(config_str, bytes): config_str = unicode(config_str) - path.join('jupyter_notebook_config.json').write_text(config_str, 'utf-8') + path.join(filename).write_text(config_str, 'utf-8') return str(path) -@fixture(scope='module') +@fixture(scope='module', params=('notebook', 'jupyter_server')) def server_extension_app(tmpdir_factory, request): + cmd = request.param + + appname = 'NotebookApp' if cmd == 'notebook' else 'ServerApp' def _kill_nb_app(): try: @@ -472,7 +475,7 @@ def _kill_nb_app(): pass popen_wait(process, 10) - config_dir = create_server_extension_config(tmpdir_factory) + config_dir = create_server_extension_config(tmpdir_factory, cmd) env = os.environ.copy() env.update({'JUPYTER_CONFIG_DIR': config_dir}) @@ -481,10 +484,10 @@ def _kill_nb_app(): os.chdir(root_dir) process = Popen([ - sys.executable, '-m', 'notebook', + sys.executable, '-m', cmd, '--port=%i' % port, '--ip=127.0.0.1', - '--no-browser', '--NotebookApp.token=%s' % TEST_TOKEN], + '--no-browser', '--%s.token=%s' % (appname, TEST_TOKEN)], env=env) request.addfinalizer(_kill_nb_app) diff --git a/nbdime/tests/test_jupyter_server_extension.py b/nbdime/tests/test_jupyter_server_extension.py deleted file mode 100644 index 5c2a44f9..00000000 --- a/nbdime/tests/test_jupyter_server_extension.py +++ /dev/null @@ -1,273 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. - -import json -import os -import re -import shutil - -import pytest - -import nbformat - -from tornado.httpclient import HTTPError - -from ..utils import pushd -from .utils import WEB_TEST_TIMEOUT, TEST_TOKEN, call - - -pjoin = os.path.join - -_re_config = re.compile( - """""" -) - -@pytest.fixture -def jp_server_config(): - return { - "ServerApp": { - "jpserver_extensions": { - "nbdime": True - } - } - } - - -def read_response(response): - """Extract the useful pieces from a torando HTTPResponse object""" - # raise exception if it exists. - if response.error: - raise response.error - # Decode the body. - body = response.body.decode() - # Parse if it's JSON - try: - body = json.loads(body) - # If the body is empty, set the body to None. - except json.decoder.JSONDecodeError: - pass - code = response.code - return code, body - - -@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) -async def test_isgit(git_repo2, jp_fetch): - r = await jp_fetch( - 'nbdime/api/isgit', - method='POST', - body=json.dumps({ - 'path': git_repo2, - }) - ) - code, body = read_response(r) - assert body == {'is_git': True} - - -@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) -async def test_isgit_nonrepo(git_repo2, jp_root_dir, jp_fetch): - r = await jp_fetch( - 'nbdime/api/isgit', - method='POST', - body=json.dumps({ - # Give a random patch that doesn't have a git repo. - 'path': str(jp_root_dir), - }) - ) - code, body = read_response(r) - assert body == {'is_git': False} - - -@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) -async def test_difftool(git_repo2, jp_fetch): - r = await jp_fetch('nbdime/difftool') - code, body = read_response(r) - assert code == 200 - - -@pytest.mark.timeout(timeout=WEB_TEST_TIMEOUT) -async def test_git_difftool(git_repo2, jp_fetch, jp_base_url): - r = await jp_fetch( - 'nbdime/git-difftool', - ) - code, body = read_response(r) - assert body.startswith(' Date: Fri, 8 Jan 2021 18:10:36 +0100 Subject: [PATCH 15/18] Make things more cross compatible --- nbdime/__init__.py | 2 ++ nbdime/webapp/nb_server_extension.py | 27 ++++++++++++++++++------- packages/labextension/package.json | 30 ++++++++++++++-------------- packages/nbdime/package.json | 28 +++++++++++++------------- packages/webapp/package.json | 28 +++++++++++++------------- setup.py | 1 - 6 files changed, 65 insertions(+), 51 deletions(-) diff --git a/nbdime/__init__.py b/nbdime/__init__.py index 0a3c6199..16526fec 100644 --- a/nbdime/__init__.py +++ b/nbdime/__init__.py @@ -48,4 +48,6 @@ def _jupyter_nbextension_paths(): "decide_merge", "merge_notebooks", "apply_decisions", "load_jupyter_server_extension", "_load_jupyter_server_extension", + "_jupyter_server_extension_points", + "_jupyter_server_extension_paths", ] diff --git a/nbdime/webapp/nb_server_extension.py b/nbdime/webapp/nb_server_extension.py index 431f9e31..1f11464a 100644 --- a/nbdime/webapp/nb_server_extension.py +++ b/nbdime/webapp/nb_server_extension.py @@ -10,11 +10,24 @@ from jupyter_server.utils import url_path_join, to_os_path -from jupyter_server.services.contents.checkpoints import GenericCheckpointsMixin as jpserver_GenericCheckpointsMixin -from jupyter_server.services.contents.filecheckpoints import FileCheckpoints as jpserver_FileCheckpoints - -from notebook.services.contents.checkpoints import GenericCheckpointsMixin as nbserver_GenericCheckpointsMixin -from notebook.services.contents.filecheckpoints import FileCheckpoints as nbserver_FileCheckpoints +generic_checkpoint_mixin_types = [] +file_checkpoint_mixin_types = [] + +try: + from jupyter_server.services.contents.checkpoints import GenericCheckpointsMixin as jpserver_GenericCheckpointsMixin + from jupyter_server.services.contents.filecheckpoints import FileCheckpoints as jpserver_FileCheckpoints + generic_checkpoint_mixin_types.append(jpserver_GenericCheckpointsMixin) + file_checkpoint_mixin_types.append(jpserver_FileCheckpoints) +except ModuleNotFoundError: + pass + +try: + from notebook.services.contents.checkpoints import GenericCheckpointsMixin as nbserver_GenericCheckpointsMixin + from notebook.services.contents.filecheckpoints import FileCheckpoints as nbserver_FileCheckpoints + generic_checkpoint_mixin_types.append(nbserver_GenericCheckpointsMixin) + file_checkpoint_mixin_types.append(nbserver_FileCheckpoints) +except ModuleNotFoundError: + pass from tornado.web import HTTPError, escape, authenticated, gen @@ -154,11 +167,11 @@ def _get_checkpoint_notebooks(self, base): raise gen.Return((remote_nb, remote_nb)) self.log.debug('Checkpoints: %r', checkpoints) checkpoint = checkpoints[0] - if isinstance(cm.checkpoints, (jpserver_GenericCheckpointsMixin, nbserver_GenericCheckpointsMixin)): + if isinstance(cm.checkpoints, generic_checkpoint_mixin_types): checkpoint_model = yield gen.maybe_future( cm.checkpoints.get_notebook_checkpoint(checkpoint, base)) base_nb = checkpoint_model['content'] - elif isinstance(cm.checkpoints, (jpserver_FileCheckpoints, nbserver_FileCheckpoints)): + elif isinstance(cm.checkpoints, file_checkpoint_mixin_types): path = yield gen.maybe_future( cm.checkpoints.checkpoint_path(checkpoint['id'], base)) base_nb = read_notebook(path, on_null='minimal') diff --git a/packages/labextension/package.json b/packages/labextension/package.json index 2677f255..51757372 100644 --- a/packages/labextension/package.json +++ b/packages/labextension/package.json @@ -1,6 +1,6 @@ { "name": "nbdime-jupyterlab", - "version": "3.0.0", + "version": "2.1.0", "description": "A JupyterLab extension for showing Notebook diffs.", "keywords": [ "jupyter", @@ -38,22 +38,22 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/apputils": "^3.0.0", - "@jupyterlab/coreutils": "^5.0.0", - "@jupyterlab/nbformat": "^3.0.0", - "@jupyterlab/notebook": "^3.0.0", - "@jupyterlab/rendermime": "^3.0.0", - "@jupyterlab/services": "^6.0.0", - "@jupyterlab/settingregistry": "^3.0.0", - "@lumino/algorithm": "^1.3.3", - "@lumino/coreutils": "^1.5.3", - "@lumino/disposable": "^1.4.3", - "@lumino/widgets": "^1.16.0", - "nbdime": "^7.0.0" + "@jupyterlab/apputils": "^2 || ^3", + "@jupyterlab/coreutils": "^4 || ^5", + "@jupyterlab/nbformat": "^2 || ^3", + "@jupyterlab/notebook": "^2 || ^3", + "@jupyterlab/rendermime": "^2 || ^3", + "@jupyterlab/services": "^5 || ^6", + "@jupyterlab/settingregistry": "^2 || ^3", + "@lumino/algorithm": "^1.1.2", + "@lumino/coreutils": "^1.3.0", + "@lumino/disposable": "^1.1.2", + "@lumino/widgets": "^1.6.0", + "nbdime": "^6.1.0" }, "devDependencies": { - "@jupyterlab/application": "^3.0.0", - "@jupyterlab/docregistry": "^3.0.0", + "@jupyterlab/application": "^2 || ^3", + "@jupyterlab/docregistry": "^2 || ^3", "@lumino/commands": "^1.6.1", "mkdirp": "^0.5.1", "rimraf": "^2.6.3", diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index 6098526e..1af14f82 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -1,6 +1,6 @@ { "name": "nbdime", - "version": "7.0.0", + "version": "6.1.0", "description": "Diff and merge of Jupyter Notebooks", "repository": { "type": "git", @@ -23,22 +23,22 @@ "watch": "tsc --build --watch" }, "dependencies": { - "@jupyterlab/codeeditor": "^3.0.0", - "@jupyterlab/codemirror": "^3.0.0", - "@jupyterlab/coreutils": "^5.0.0", - "@jupyterlab/nbformat": "^3.0.0", - "@jupyterlab/outputarea": "^3.0.0", - "@jupyterlab/rendermime": "^3.0.0", - "@jupyterlab/services": "^6.0.0", - "@lumino/algorithm": "^1.3.3", - "@lumino/coreutils": "^1.5.3", - "@lumino/dragdrop": "^1.7.0", - "@lumino/signaling": "^1.4.3", - "@lumino/widgets": "^1.16.0", + "@jupyterlab/codeeditor": "^2 || ^3", + "@jupyterlab/codemirror": "^2 || ^3", + "@jupyterlab/coreutils": "^4 || ^5", + "@jupyterlab/nbformat": "^2 || ^3", + "@jupyterlab/outputarea": "^2 || ^3", + "@jupyterlab/rendermime": "^2 || ^3", + "@jupyterlab/services": "^5 || ^6", + "@lumino/algorithm": "^1.1.2", + "@lumino/coreutils": "^1.3.0", + "@lumino/dragdrop": "^1.3.0", + "@lumino/signaling": "^1.2.2", + "@lumino/widgets": "^1.6.0", "json-stable-stringify": "^1.0.1" }, "devDependencies": { - "@jupyterlab/apputils": "^3.0.0", + "@jupyterlab/apputils": "^2 || ^3", "@lumino/messaging": "^1.2.2", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 8344a7ae..28dc7520 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -1,6 +1,6 @@ { "name": "nbdime-webapp", - "version": "4.1.0", + "version": "4.2.0", "private": true, "license": "BSD-3-Clause", "main": "static/nbdime.js", @@ -13,21 +13,21 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.12.0", - "@jupyterlab/application": "^3.0.0", - "@jupyterlab/apputils": "^3.0.0", - "@jupyterlab/cells": "^3.0.0", - "@jupyterlab/codemirror": "^3.0.0", - "@jupyterlab/coreutils": "^5.0.0", - "@jupyterlab/mathjax2": "^3.0.0", - "@jupyterlab/nbformat": "^3.0.0", - "@jupyterlab/notebook": "^3.0.0", - "@jupyterlab/rendermime": "^3.0.0", - "@jupyterlab/theme-light-extension": "^3.0.0", - "@lumino/dragdrop": "^1.7.0", - "@lumino/widgets": "^1.16.0", + "@jupyterlab/application": "^2 || ^3", + "@jupyterlab/apputils": "^2 || ^3", + "@jupyterlab/cells": "^2 || ^3", + "@jupyterlab/codemirror": "^2 || ^3", + "@jupyterlab/coreutils": "^4 || ^5", + "@jupyterlab/mathjax2": "^2 || ^3", + "@jupyterlab/nbformat": "^2 || ^3", + "@jupyterlab/notebook": "^2 || ^3", + "@jupyterlab/rendermime": "^2 || ^3", + "@jupyterlab/theme-light-extension": "^2 || ^3", + "@lumino/dragdrop": "^1.3.0", + "@lumino/widgets": "^1.6.0", "alertify.js": "^1.0.12", "file-saver": "^2.0.1", - "nbdime": "^7.0.0" + "nbdime": "^6.1.0" }, "devDependencies": { "@types/file-saver": "^2.0.0", diff --git a/setup.py b/setup.py index 8ce12941..4f1baf77 100644 --- a/setup.py +++ b/setup.py @@ -115,7 +115,6 @@ 'tornado', 'requests', 'GitPython!=2.1.4, !=2.1.5, !=2.1.6', # For difftool taking git refs - 'notebook', 'jupyter_server', 'jinja2>=2.9', ] From a86a61dd2e9ee9710dc30f7fa88438142011cd6a Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Tue, 12 Jan 2021 10:11:54 +0100 Subject: [PATCH 16/18] notebook still a test dependency --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4f1baf77..cdafb1b7 100644 --- a/setup.py +++ b/setup.py @@ -128,6 +128,7 @@ 'jupyter_server[test]', 'jsonschema', 'mock', + 'notebook', 'requests', 'tabulate', # For profiling ], From 62e73b16d734a02b3354342d2226227a144229f5 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Wed, 13 Jan 2021 19:05:44 +0100 Subject: [PATCH 17/18] Fix some test issues + dev deps --- nbdime/webapp/nb_server_extension.py | 3 +++ packages/nbdime/package.json | 16 ++++++++-------- .../nbdime/test/src/common/flexpanel.spec.ts | 8 ++++---- packages/webapp/package.json | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/nbdime/webapp/nb_server_extension.py b/nbdime/webapp/nb_server_extension.py index 1f11464a..2949583e 100644 --- a/nbdime/webapp/nb_server_extension.py +++ b/nbdime/webapp/nb_server_extension.py @@ -29,6 +29,9 @@ except ModuleNotFoundError: pass +generic_checkpoint_mixin_types = tuple(generic_checkpoint_mixin_types) +file_checkpoint_mixin_types = tuple(file_checkpoint_mixin_types) + from tornado.web import HTTPError, escape, authenticated, gen diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index 1af14f82..a1578114 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -40,22 +40,22 @@ "devDependencies": { "@jupyterlab/apputils": "^2 || ^3", "@lumino/messaging": "^1.2.2", + "@types/codemirror": "^0.0.97", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", - "@types/mocha": "^5.2.6", - "@types/node": "^12.0.10", + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.13", "@types/sanitizer": "^0.0.28", "expect.js": "^0.3.1", "fs-extra": "^8.1.0", - "karma": "^4.0.1", - "karma-chrome-launcher": "^2.2.0", - "karma-firefox-launcher": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", + "karma": "^5.2.3", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", "karma-typescript": "^4.0.0", "karma-typescript-es6-transform": "^4.0.0", - "mocha": "^6.0.2", + "mocha": "^8.2.1", "rimraf": "^2.6.3", "typescript": "^3.7.2" }, diff --git a/packages/nbdime/test/src/common/flexpanel.spec.ts b/packages/nbdime/test/src/common/flexpanel.spec.ts index e1a0a5fe..a169409e 100644 --- a/packages/nbdime/test/src/common/flexpanel.spec.ts +++ b/packages/nbdime/test/src/common/flexpanel.spec.ts @@ -29,15 +29,15 @@ import { */ function combinatorialTest( description: string, - steps: ((done: MochaDone) => void)[] | { [key: string]: ((done?: MochaDone) => void) }, - beforeEach?: (done: MochaDone) => void, - afterEach?: (done: MochaDone) => void) { + steps: ((done: Mocha.Done) => void)[] | { [key: string]: ((done?: Mocha.Done) => void) }, + beforeEach?: (done: Mocha.Done) => void, + afterEach?: (done: Mocha.Done) => void) { let stepNames: string[]; if (Array.isArray(steps)) { stepNames = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); } else { stepNames = Object.keys(steps); - let stepArray: ((done?: MochaDone) => void)[] = []; + let stepArray: ((done?: Mocha.Done) => void)[] = []; for (let key of stepNames) { stepArray.push(steps[key]); } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 28dc7520..9d50c97e 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@types/file-saver": "^2.0.0", "@types/json-stable-stringify": "^1.0.32", - "@types/node": "^12.0.10", + "@types/node": "^14.14.13", "@types/sanitizer": "^0.0.28", "css-loader": "^3.0.0", "file-loader": "^4.0.0", From 8c52de801d8b908809de39baa6fa092bd4b1b76f Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Thu, 14 Jan 2021 13:50:23 +0100 Subject: [PATCH 18/18] fix broken typings --- packages/nbdime/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/nbdime/package.json b/packages/nbdime/package.json index a1578114..fbd8a95e 100644 --- a/packages/nbdime/package.json +++ b/packages/nbdime/package.json @@ -19,7 +19,6 @@ "test:chrome": "karma start --browsers=Chrome test/karma.conf.js", "test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true test/karma-nocov.conf.js", "test:firefox": "karma start --browsers=Firefox test/karma.conf.js", - "test:ie": "karma start --browsers=IE test/karma.conf.js", "watch": "tsc --build --watch" }, "dependencies": { @@ -40,7 +39,6 @@ "devDependencies": { "@jupyterlab/apputils": "^2 || ^3", "@lumino/messaging": "^1.2.2", - "@types/codemirror": "^0.0.97", "@types/expect.js": "^0.3.29", "@types/json-stable-stringify": "^1.0.32", "@types/mocha": "^8.2.0",