Skip to content

Commit

Permalink
BUG: imjoy-jupyterlab-extension dep with notebook>=7
Browse files Browse the repository at this point in the history
JupyterLab extensions server both JupyterLab>=4 and the Jupyter
notebook>=7 with JupyterLab>=4. Our updated imjoy-jupyterlab-extension
supports both.
  • Loading branch information
thewtex committed Apr 17, 2024
1 parent 5d83f28 commit 212dd05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
22 changes: 8 additions & 14 deletions itkwidgets/integrations/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,16 @@ def find_env():

if ENVIRONMENT is not Env.JUPYTERLITE and ENVIRONMENT is not Env.HYPHA:
if ENVIRONMENT is not Env.COLAB:
if ENVIRONMENT is Env.JUPYTER_NOTEBOOK and sys.version_info.minor > 7:
try:
import imjoy_jupyter_extension
except:
raise RuntimeError('imjoy-jupyter-extension is required. `pip install itkwidgets[notebook]` and refresh page.')
else:
try:
import_module("imjoy-jupyterlab-extension")
except ModuleNotFoundError:
try:
import_module("imjoy-jupyterlab-extension")
import_module("imjoy_jupyterlab_extension")
except ModuleNotFoundError:
try:
import_module("imjoy_jupyterlab_extension")
except ModuleNotFoundError:
if ENVIRONMENT is Env.JUPYTERLITE:
raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.')
elif sys.version_info.minor > 7:
raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.')
if ENVIRONMENT is Env.JUPYTERLITE:
raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.')
elif sys.version_info.minor > 7:
raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.')

try:
import imjoy_elfinder
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ Source = "https://github.com/InsightSoftwareConsortium/itkwidgets"
all = [
"imjoy-jupyterlab-extension",
"imjoy-elfinder[jupyter]",
"imjoy-jupyter-extension",
"aiohttp <4.0"
]
lab = [
Expand All @@ -82,7 +81,7 @@ cli = [
]

notebook = [
"imjoy-jupyter-extension >=0.3.0",
"imjoy-jupyterlab-extension",
"imjoy-elfinder[jupyter]"
]
test = [
Expand Down

0 comments on commit 212dd05

Please sign in to comment.