diff --git a/README.md b/README.md index 72655b1..f604c4d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Successfully executed cells are frozen automatically to prevent to re-run. # Prerequisite -* [Jupyter Notebook](https://github.com/jupyter/notebook) 4.2.x +* [Jupyter Notebook](https://github.com/jupyter/notebook) 4.2.x or 5.x * [Collapsible Headings extension](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/collapsible_headings) is installed and enabled * [Freeze extension](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/freeze) is installed and enabled diff --git a/lc_run_through/extensionapp.py b/lc_run_through/extensionapp.py index 000eeeb..c6cd4b8 100644 --- a/lc_run_through/extensionapp.py +++ b/lc_run_through/extensionapp.py @@ -7,13 +7,18 @@ from notebook.nbextensions import (InstallNBExtensionApp, EnableNBExtensionApp, DisableNBExtensionApp) -from notebook.nbextensions import BaseNBExtensionApp +try: + from notebook.extensions import BaseExtensionApp +except ImportError: + from notebook.nbextensions import BaseNBExtensionApp + BaseExtensionApp = BaseNBExtensionApp + from notebook import nbextensions from traitlets.config.application import catch_config_error from traitlets.config.application import Application -class ExtensionQuickSetupApp(BaseNBExtensionApp): +class ExtensionQuickSetupApp(BaseExtensionApp): """Installs and enables all parts of this extension""" name = "jupyter run-through quick-setup" version = __version__ @@ -44,7 +49,7 @@ def enable_collapsible_headings(self): enable.start(); -class ExtensionQuickRemovalApp(BaseNBExtensionApp): +class ExtensionQuickRemovalApp(BaseExtensionApp): """Disables and uninstalls all parts of this extension""" name = "jupyter run-through quick-remove" version = __version__ diff --git a/lc_run_through/nbextension/run-through.yml b/lc_run_through/nbextension/run-through.yml index ea5d93c..aba395f 100644 --- a/lc_run_through/nbextension/run-through.yml +++ b/lc_run_through/nbextension/run-through.yml @@ -5,4 +5,4 @@ Description: "Run through extension for Literate Computing" Link: README.md Icon: icon.png Main: main.js -Compatibility: 4.x +Compatibility: 4.x 5.x diff --git a/setup.py b/setup.py index a1d7222..c31be94 100644 --- a/setup.py +++ b/setup.py @@ -14,10 +14,10 @@ description='LC run through extension for Jupyter Notebook', packages=['lc_run_through'], include_package_data=True, - platforms=['Jupyter Notebook 4.2.x'], + platforms=['Jupyter Notebook 4.2.x', 'Jupyter Notebook 5.x'], zip_safe=False, install_requires=[ - 'notebook>=4.2.0,<5.0', + 'notebook>=4.2.0', ], entry_points={ 'console_scripts': [