Skip to content

Commit

Permalink
Fix regression (egg caching broke against master/15.10).
Browse files Browse the repository at this point in the history
Closes #396.
  • Loading branch information
jmchilton committed Jan 13, 2016
1 parent 81cd367 commit 6d0f502
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions planemo/galaxy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ def config_join(*args):
config_directory = mkdtemp()
try:
latest_galaxy = False
install_env = {}
if install_galaxy:
_install_galaxy(ctx, config_directory, kwds)
_build_eggs_cache(ctx, install_env, kwds)
_install_galaxy(ctx, config_directory, install_env, kwds)
latest_galaxy = True
galaxy_root = config_join("galaxy-dev")

Expand Down Expand Up @@ -235,8 +237,7 @@ def config_join(*args):
# retry_job_output_collection = 0

env = _build_env_for_galaxy(properties, template_args)
if install_galaxy:
_build_eggs_cache(ctx, env, kwds)
env.update(install_env)
_build_test_env(properties, env)
env['GALAXY_TEST_SHED_TOOL_CONF'] = shed_tool_conf

Expand Down Expand Up @@ -534,25 +535,25 @@ def _shed_tool_conf(install_galaxy, config_directory):
return os.path.join(config_dir, "shed_tool_conf.xml")


def _install_galaxy(ctx, config_directory, kwds):
def _install_galaxy(ctx, config_directory, env, kwds):
if not kwds.get("no_cache_galaxy", False):
_install_galaxy_via_git(ctx, config_directory, kwds)
_install_galaxy_via_git(ctx, config_directory, env, kwds)
else:
_install_galaxy_via_download(ctx, config_directory, kwds)
_install_galaxy_via_download(ctx, config_directory, env, kwds)


def _install_galaxy_via_download(ctx, config_directory, kwds):
def _install_galaxy_via_download(ctx, config_directory, env, kwds):
branch = _galaxy_branch(kwds)
tar_cmd = "tar -zxvf %s" % branch
command = galaxy_run.DOWNLOAD_GALAXY + "; %s | tail" % tar_cmd
_install_with_command(ctx, config_directory, command, kwds)
_install_with_command(ctx, config_directory, command, env, kwds)


def _install_galaxy_via_git(ctx, config_directory, kwds):
def _install_galaxy_via_git(ctx, config_directory, env, kwds):
gx_repo = _ensure_galaxy_repository_available(ctx, kwds)
branch = _galaxy_branch(kwds)
command = git.command_clone(ctx, gx_repo, "galaxy-dev", branch=branch)
_install_with_command(ctx, config_directory, command, kwds)
_install_with_command(ctx, config_directory, command, env, kwds)


def _build_eggs_cache(ctx, env, kwds):
Expand Down Expand Up @@ -587,7 +588,7 @@ def _galaxy_source(kwds):
return source


def _install_with_command(ctx, config_directory, command, kwds):
def _install_with_command(ctx, config_directory, command, env, kwds):
# TODO: --watchdog
pip_installs = []
if kwds.get("cwl", False):
Expand All @@ -606,7 +607,7 @@ def _install_with_command(ctx, config_directory, command, kwds):
galaxy_run.setup_common_startup_args(),
COMMAND_STARTUP_COMMAND,
)
shell(install_cmd)
shell(install_cmd, env=env)


def _ensure_galaxy_repository_available(ctx, kwds):
Expand Down

0 comments on commit 6d0f502

Please sign in to comment.