@@ -75,7 +75,9 @@ def checkout(folder, branch_or_tag, cwdp):
7575
7676 print (f'Checking out { branch_or_tag } ' )
7777 try :
78+ subprocess .call (['git' , 'fetch' ], cwd = newPath )
7879 subprocess .call (['git' , 'checkout' , branch_or_tag ], cwd = newPath )
80+ subprocess .call (['git' , 'pull' , 'origin' , branch_or_tag ], cwd = newPath )
7981 except Exception as e :
8082 logging .error ('Cannot checkout branch or tag %s on %s' , branch_or_tag , folder , exc_info = True )
8183
@@ -85,30 +87,21 @@ def compile_mod():
8587
8688
8789def main (netpyne_branch , workspace_branch , geppetto_branch = None , skipNpm = False ,
88- skipTest = False , development = False ):
90+ skipTest = False , development = False ):
8991 cprint ("Installing requirements" )
90- print (workspace_branch )
9192 execute (cmd = ['pip' , 'install' , '-r' , 'requirements.txt' ], cwd = ROOT_DIR )
93+ cprint ("Installing UI python package..." )
94+ execute (cmd = ['pip' , 'install' , '-e' , '.' , '--no-deps' ], cwd = ROOT_DIR )
9295
9396 if not os .path .exists (DEPS_DIR ):
9497 os .mkdir (DEPS_DIR )
9598
96-
97- if development :
99+ if geppetto_branch :
100+ if geppetto_branch .replace (" " , "" ) is '' :
101+ geppetto_branch = 'development'
98102 os .chdir (DEPS_DIR )
99-
100- # cloning geppetto meta
101103 cprint ("Installing geppetto-meta" )
102- clone (repository = META ,
103- folder = META_DIR ,
104- branch_or_tag = geppetto_branch
105- )
106-
107- # clone and install netpyne
108- cprint ("Installing netpyne" )
109- clone (repository = NETPYNE , branch_or_tag = netpyne_branch )
110- execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = os .path .join (DEPS_DIR , NETPYNE_DIR ))
111-
104+ clone (repository = META , folder = META_DIR , branch_or_tag = geppetto_branch )
112105 # installing pygeppetto
113106 cprint ("Installing pygeppetto" )
114107 execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = os .path .join (DEPS_DIR , META_DIR , PYGEPPETTO_DIR ))
@@ -117,14 +110,15 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
117110 execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = os .path .join (DEPS_DIR , META_DIR , JUPYTER_DIR ))
118111 # installing core dependencies
119112 execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = ROOT_DIR )
120- if netpyne_branch and netpyne_branch != 'master' :
121- cprint ("Installing netpyne" )
122- clone (repository = NETPYNE , branch_or_tag = netpyne_branch )
123- execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = os .path .join (DEPS_DIR , NETPYNE_DIR ))
124- else :
125- # install requirements
126- cprint ("Installing UI python package..." )
127- execute (cmd = ['pip' , 'install' , '-e' , '.' , '--no-deps' ], cwd = ROOT_DIR )
113+ if netpyne_branch :
114+ if netpyne_branch .replace (" " , "" ) is '' :
115+ netpyne_branch = 'development'
116+ os .chdir (DEPS_DIR )
117+ cprint ("Installing netpyne" )
118+ clone (repository = NETPYNE , branch_or_tag = netpyne_branch )
119+ execute (cmd = ['pip' , 'install' , '-e' , '.' ], cwd = os .path .join (DEPS_DIR , NETPYNE_DIR ))
120+
121+
128122
129123 os .chdir (ROOT_DIR )
130124 if workspace_branch :
@@ -194,7 +188,7 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
194188
195189 cprint ("Installing client packages" )
196190 if not skipNpm :
197- if development :
191+ if geppetto_branch :
198192 # install geppetto meta
199193 if os .path .exists (os .path .join (WEBAPP_DIR , '.yalc' )):
200194 execute (cmd = ['rm' , '-rf' , '.yalc' ], cwd = WEBAPP_DIR )
@@ -209,7 +203,7 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
209203 else :
210204 # install jupyter geppetto
211205 cprint ("Installing geppetto ui, client and core dependecies" )
212- execute (cmd = ['yarn' , 'install' , '--frozen-lockfile ' ], cwd = WEBAPP_DIR )
206+ execute (cmd = ['yarn' , 'install' , '--immutable ' ], cwd = WEBAPP_DIR )
213207 execute (cmd = ['yarn' , 'run' , 'build' ], cwd = WEBAPP_DIR )
214208
215209
@@ -228,22 +222,22 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
228222 help = 'Install for development.' )
229223
230224 parser .add_argument ('--netpyne' , '-vn' , dest = 'netpyne_version' , action = "store" ,
231- default = os .getenv ('NETPYNE_VERSION' , 'development' ),
225+ default = os .getenv ('NETPYNE_VERSION' , None ),
232226 help = 'Specify NetPyNE library branch or tag.' )
233227
234228 parser .add_argument ('--workspace' , '-vw' , dest = 'workspace_version' , action = "store" ,
235229 default = os .getenv ('WORKSPACE_VERSION' , 'master' ),
236230 help = 'Specify workspace branch or tag.' )
237231
238232 parser .add_argument ('--geppetto' , '-vp' , dest = 'geppetto_version' , action = "store" ,
239- default = os .getenv ('GEPPETTO_VERSION' , 'development' ),
233+ default = os .getenv ('GEPPETTO_VERSION' , None ),
240234 help = 'Specify Pygeppetto library branch or tag (only for dev build).' )
241235
242236 args = parser .parse_args (sys .argv [1 :])
243237 print ('Install arguments:\n ' , args )
244238
245239 main (skipNpm = args .skipNpm , skipTest = args .skipTest , development = args .development ,
246- netpyne_branch = args .netpyne_version ,
247- workspace_branch = args .workspace_version ,
248- geppetto_branch = args .geppetto_version ,
249- )
240+ netpyne_branch = args .netpyne_version ,
241+ workspace_branch = args .workspace_version ,
242+ geppetto_branch = args .geppetto_version ,
243+ )
0 commit comments