File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
from enum import Enum
2
2
from importlib import import_module
3
+ from packaging import version
4
+ import importlib_metadata
3
5
import sys
4
6
5
7
@@ -28,7 +30,6 @@ def find_env():
28
30
else :
29
31
return Env .SAGEMAKER
30
32
except :
31
- import sys
32
33
if sys .platform == 'emscripten' :
33
34
return Env .JUPYTERLITE
34
35
return Env .HYPHA
@@ -38,6 +39,15 @@ def find_env():
38
39
39
40
if ENVIRONMENT is not Env .JUPYTERLITE and ENVIRONMENT is not Env .HYPHA :
40
41
if ENVIRONMENT is not Env .COLAB :
42
+ if ENVIRONMENT is Env .JUPYTER_NOTEBOOK :
43
+ notebook_version = importlib_metadata .version ('notebook' )
44
+ if version .parse (notebook_version ) < version .parse ('7' ):
45
+ raise RuntimeError ('itkwidgets 1.0a51 and newer requires Jupyter notebook>=7.' )
46
+ elif ENVIRONMENT is Env .JUPYTERLAB :
47
+ lab_version = importlib_metadata .version ('jupyterlab' )
48
+ if version .parse (lab_version ) < version .parse ('4' ):
49
+ raise RuntimeError ('itkwidgets 1.0a51 and newer requires jupyterlab>=4.' )
50
+
41
51
try :
42
52
import_module ("imjoy-jupyterlab-extension" )
43
53
except ModuleNotFoundError :
You can’t perform that action at this time.
0 commit comments