File tree 2 files changed +30
-3
lines changed
2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ jupyter labextension list
40
40
41
41
- Be sure to be in a Git repository in the filebrowser tab
42
42
43
- - Check the server log. If you see a warning with a 404 code similar to:
43
+ - Check the server log. If you see a warning with a 404 code similar to:
44
44
` [W 00:27:41.800 LabApp] 404 GET /git/server_root?1576081660665 `
45
45
46
46
Explicitly enable the server extension by running:
@@ -106,7 +106,6 @@ cd jupyterlab-git
106
106
107
107
# Install the server extension in development mode and enable it
108
108
pip install -e .[test]
109
- jupyter serverextension enable --py jupyterlab_git
110
109
111
110
# Build the labextension and dev-mode link it to jlab
112
111
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,36 @@ 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
+
41
69
cmdclass = create_cmdclass ('pack_labext' , data_files_spec = data_files_spec )
42
70
cmdclass ['pack_labext' ] = pack_labext
43
- cmdclass . pop ( 'develop' )
71
+ cmdclass [ 'develop' ] = DevelopAndEnable
44
72
45
73
with open ("README.md" , "r" ) as fh :
46
74
long_description = fh .read ()
You can’t perform that action at this time.
0 commit comments