File tree 2 files changed +31
-2
lines changed
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ cd jupyterlab-git
101
101
102
102
# Install the server extension in development mode and enable it
103
103
pip install -e .[test]
104
- jupyter serverextension enable --py jupyterlab_git
105
104
106
105
# Build the labextension and dev-mode link it to jlab
107
106
jlpm build
Original file line number Diff line number Diff line change 12
12
)
13
13
14
14
import setuptools
15
+ from setuptools .command .develop import develop
15
16
16
17
# The name of the project
17
18
name = 'jupyterlab_git'
@@ -38,9 +39,38 @@ def runPackLabextension():
38
39
pass
39
40
pack_labext = command_for_func (runPackLabextension )
40
41
42
+ class DevelopAndEnable (develop ):
43
+ def run (self ):
44
+ develop .run (self )
45
+
46
+ list_cmd = [
47
+ 'jupyter' ,
48
+ 'serverextension' ,
49
+ 'list'
50
+ ]
51
+ enable_cmd = [
52
+ 'jupyter' ,
53
+ 'serverextension' ,
54
+ 'enable' ,
55
+ '--py' ,
56
+ 'jupyterlab_git'
57
+ ]
58
+
59
+ # test if `jupyter` cmd is available
60
+ try :
61
+ run (list_cmd )
62
+ except :
63
+ print ('`jupyter` cmd not installed, skipping serverextension activation...' )
64
+ return
65
+
66
+ print ('Enabling serverextension...' )
67
+ run (enable_cmd )
68
+
69
+
70
+
41
71
cmdclass = create_cmdclass ('pack_labext' , data_files_spec = data_files_spec )
42
72
cmdclass ['pack_labext' ] = pack_labext
43
- cmdclass . pop ( 'develop' )
73
+ cmdclass [ 'develop' ] = DevelopAndEnable
44
74
45
75
with open ("README.md" , "r" ) as fh :
46
76
long_description = fh .read ()
You can’t perform that action at this time.
0 commit comments