@@ -136,8 +136,10 @@ def config_join(*args):
136136 config_directory = mkdtemp ()
137137 try :
138138 latest_galaxy = False
139+ install_env = {}
139140 if install_galaxy :
140- _install_galaxy (ctx , config_directory , kwds )
141+ _build_eggs_cache (ctx , install_env , kwds )
142+ _install_galaxy (ctx , config_directory , install_env , kwds )
141143 latest_galaxy = True
142144 galaxy_root = config_join ("galaxy-dev" )
143145
@@ -235,8 +237,7 @@ def config_join(*args):
235237 # retry_job_output_collection = 0
236238
237239 env = _build_env_for_galaxy (properties , template_args )
238- if install_galaxy :
239- _build_eggs_cache (ctx , env , kwds )
240+ env .update (install_env )
240241 _build_test_env (properties , env )
241242 env ['GALAXY_TEST_SHED_TOOL_CONF' ] = shed_tool_conf
242243
@@ -534,25 +535,25 @@ def _shed_tool_conf(install_galaxy, config_directory):
534535 return os .path .join (config_dir , "shed_tool_conf.xml" )
535536
536537
537- def _install_galaxy (ctx , config_directory , kwds ):
538+ def _install_galaxy (ctx , config_directory , env , kwds ):
538539 if not kwds .get ("no_cache_galaxy" , False ):
539- _install_galaxy_via_git (ctx , config_directory , kwds )
540+ _install_galaxy_via_git (ctx , config_directory , env , kwds )
540541 else :
541- _install_galaxy_via_download (ctx , config_directory , kwds )
542+ _install_galaxy_via_download (ctx , config_directory , env , kwds )
542543
543544
544- def _install_galaxy_via_download (ctx , config_directory , kwds ):
545+ def _install_galaxy_via_download (ctx , config_directory , env , kwds ):
545546 branch = _galaxy_branch (kwds )
546547 tar_cmd = "tar -zxvf %s" % branch
547548 command = galaxy_run .DOWNLOAD_GALAXY + "; %s | tail" % tar_cmd
548- _install_with_command (ctx , config_directory , command , kwds )
549+ _install_with_command (ctx , config_directory , command , env , kwds )
549550
550551
551- def _install_galaxy_via_git (ctx , config_directory , kwds ):
552+ def _install_galaxy_via_git (ctx , config_directory , env , kwds ):
552553 gx_repo = _ensure_galaxy_repository_available (ctx , kwds )
553554 branch = _galaxy_branch (kwds )
554555 command = git .command_clone (ctx , gx_repo , "galaxy-dev" , branch = branch )
555- _install_with_command (ctx , config_directory , command , kwds )
556+ _install_with_command (ctx , config_directory , command , env , kwds )
556557
557558
558559def _build_eggs_cache (ctx , env , kwds ):
@@ -587,7 +588,7 @@ def _galaxy_source(kwds):
587588 return source
588589
589590
590- def _install_with_command (ctx , config_directory , command , kwds ):
591+ def _install_with_command (ctx , config_directory , command , env , kwds ):
591592 # TODO: --watchdog
592593 pip_installs = []
593594 if kwds .get ("cwl" , False ):
@@ -606,7 +607,7 @@ def _install_with_command(ctx, config_directory, command, kwds):
606607 galaxy_run .setup_common_startup_args (),
607608 COMMAND_STARTUP_COMMAND ,
608609 )
609- shell (install_cmd )
610+ shell (install_cmd , env = env )
610611
611612
612613def _ensure_galaxy_repository_available (ctx , kwds ):
0 commit comments