diff --git a/beakerx_widgets/beakerx/__init__.py b/beakerx_widgets/beakerx/__init__.py index bb047f7..7d88b55 100644 --- a/beakerx_widgets/beakerx/__init__.py +++ b/beakerx_widgets/beakerx/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. from ._version import version_info, __version__ -# from .commands import parse_widgets +from .commands import parse_widgets from .forms import * from .jupyter_server_handlers import setup_jupyter_server_handlers from .magics import * diff --git a/beakerx_widgets/beakerx/commands.py b/beakerx_widgets/beakerx/commands.py index a8bbf47..f14cb28 100644 --- a/beakerx_widgets/beakerx/commands.py +++ b/beakerx_widgets/beakerx/commands.py @@ -15,7 +15,6 @@ import sys import beakerx -from notebook import notebookapp as app from .bkr2ipynb import main from .install import install, uninstall @@ -63,14 +62,9 @@ def bkr2ipynb_subparser(subparser): # Py4JServer(args.port, args.pyport, args.kernel, args.context) -def run_jupyter(jupyter_commands): - app.launch_new_instance(jupyter_commands) - - def init_parser(): parser = argparse.ArgumentParser() parser.add_argument('--version', action='version', version=beakerx.__version__) - parser.set_defaults(func=run_jupyter) subparsers = parser.add_subparsers() install_subparser(subparsers) @@ -83,9 +77,7 @@ def init_parser(): def parse_widgets(): parser = init_parser() args, jupyter_commands = parser.parse_known_args() - if args.func == run_jupyter: - args.func(jupyter_commands) - elif not jupyter_commands: + if not jupyter_commands: args.func(args) else: parser.parse_args(jupyter_commands) diff --git a/beakerx_widgets/beakerx/install.py b/beakerx_widgets/beakerx/install.py index 9aaed1f..efebec3 100644 --- a/beakerx_widgets/beakerx/install.py +++ b/beakerx_widgets/beakerx/install.py @@ -123,12 +123,8 @@ def make_parser(): def install(args): - if sys.platform == 'win32': - subprocess.check_call(["jupyter", "nbextension", "install", "beakerx", "--py", "--sys-prefix"]) - - subprocess.check_call(["jupyter", "nbextension", "enable", "beakerx", "--py", "--sys-prefix"]) subprocess.check_call(["jupyter", "serverextension", "enable", "beakerx", "--py", "--sys-prefix"]) - if LAB_VERSION is not None and LAB_VERSION != 3: + if LAB_VERSION is not None and LAB_VERSION < 3: subprocess.call(["jupyter", "labextension", "install", "@jupyter-widgets/jupyterlab-manager", "--no-build"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) if LAB_VERSION == 1: @@ -142,7 +138,6 @@ def install(args): def uninstall(args): - subprocess.check_call(["jupyter", "nbextension", "disable", "beakerx", "--py", "--sys-prefix"]) subprocess.check_call(["jupyter", "nbextension", "uninstall", "beakerx", "--py", "--sys-prefix"]) subprocess.check_call(["jupyter", "serverextension", "disable", "beakerx", "--py", "--sys-prefix"]) if LAB_VERSION is not None: diff --git a/beakerx_widgets/pyproject.toml b/beakerx_widgets/pyproject.toml index 68605bf..8b9a4b6 100644 --- a/beakerx_widgets/pyproject.toml +++ b/beakerx_widgets/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.1"] +requires = ["jupyter_packaging~=0.10,<2", "jupyterlab>4,<5"] build-backend = "jupyter_packaging.build_api" [tool.jupyter-packaging.options] diff --git a/configuration.yml b/configuration.yml index 4d4108e..41f9941 100644 --- a/configuration.yml +++ b/configuration.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - bottle - - ipywidgets>=7.5.1,<8 + - ipywidgets>=7.5.1,<9 - pandas - py4j - pyspark