Skip to content

Commit

Permalink
Conda improvements.
Browse files Browse the repository at this point in the history
Use user's conda environment for planemo - this way if conda_init, conda_install will setup subsequent test and serve calls. Also use /bin/bash as the default job shell - requires merging galaxyproject/galaxy#1473.
  • Loading branch information
jmchilton committed Jan 13, 2016
1 parent 6e8d199 commit 5e0b6d1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions planemo/galaxy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import click

from planemo import galaxy_run
from planemo.conda import build_conda_context
from planemo.io import warn
from planemo.io import shell
from planemo.io import shell_join
Expand Down Expand Up @@ -210,6 +211,7 @@ def config_join(*args):
log_level="${log_level}",
debug="${debug}",
watch_tools="auto",
default_job_shell="/bin/bash", # For conda dependency resolution
tool_data_table_config_path=tool_data_table,
integrated_tool_panel_config=("${temp_directory}/"
"integrated_tool_panel_conf.xml"),
Expand Down Expand Up @@ -679,14 +681,21 @@ def _handle_dependency_resolution(config_directory, kwds):
'conda_auto_install': False,
'conda_ensure_channels': '',
}

attributes = []

def add_attribute(key, value):
attributes.append('%s="%s"' % (key, value))

for key, default_value in iteritems(dependency_attribute_kwds):
value = kwds.get(key, default_value)
if value != default_value:
# Strip leading prefix (conda_) off attributes
attribute_key = "_".join(key.split("_")[1:])
attributes.append('%s="%s"' % (attribute_key, value))
add_attribute(attribute_key, value)

if "prefix" not in attributes:
conda_context = build_conda_context(**kwds)
add_attribute("prefix", conda_context.conda_prefix)

attribute_str = " ".join(attributes)

Expand Down

0 comments on commit 5e0b6d1

Please sign in to comment.