Skip to content

Commit 212dd05

Browse files
committed
BUG: imjoy-jupyterlab-extension dep with notebook>=7
JupyterLab extensions server both JupyterLab>=4 and the Jupyter notebook>=7 with JupyterLab>=4. Our updated imjoy-jupyterlab-extension supports both.
1 parent 5d83f28 commit 212dd05

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

itkwidgets/integrations/environment.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,16 @@ def find_env():
3838

3939
if ENVIRONMENT is not Env.JUPYTERLITE and ENVIRONMENT is not Env.HYPHA:
4040
if ENVIRONMENT is not Env.COLAB:
41-
if ENVIRONMENT is Env.JUPYTER_NOTEBOOK and sys.version_info.minor > 7:
42-
try:
43-
import imjoy_jupyter_extension
44-
except:
45-
raise RuntimeError('imjoy-jupyter-extension is required. `pip install itkwidgets[notebook]` and refresh page.')
46-
else:
41+
try:
42+
import_module("imjoy-jupyterlab-extension")
43+
except ModuleNotFoundError:
4744
try:
48-
import_module("imjoy-jupyterlab-extension")
45+
import_module("imjoy_jupyterlab_extension")
4946
except ModuleNotFoundError:
50-
try:
51-
import_module("imjoy_jupyterlab_extension")
52-
except ModuleNotFoundError:
53-
if ENVIRONMENT is Env.JUPYTERLITE:
54-
raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.')
55-
elif sys.version_info.minor > 7:
56-
raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.')
47+
if ENVIRONMENT is Env.JUPYTERLITE:
48+
raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.')
49+
elif sys.version_info.minor > 7:
50+
raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.')
5751

5852
try:
5953
import imjoy_elfinder

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Source = "https://github.com/InsightSoftwareConsortium/itkwidgets"
6464
all = [
6565
"imjoy-jupyterlab-extension",
6666
"imjoy-elfinder[jupyter]",
67-
"imjoy-jupyter-extension",
6867
"aiohttp <4.0"
6968
]
7069
lab = [
@@ -82,7 +81,7 @@ cli = [
8281
]
8382

8483
notebook = [
85-
"imjoy-jupyter-extension >=0.3.0",
84+
"imjoy-jupyterlab-extension",
8685
"imjoy-elfinder[jupyter]"
8786
]
8887
test = [

0 commit comments

Comments
 (0)