Skip to content

Commit 5e0b6d1

Browse files
committed
Conda improvements.
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.
1 parent 6e8d199 commit 5e0b6d1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

planemo/galaxy_config.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import click
1515

1616
from planemo import galaxy_run
17+
from planemo.conda import build_conda_context
1718
from planemo.io import warn
1819
from planemo.io import shell
1920
from planemo.io import shell_join
@@ -210,6 +211,7 @@ def config_join(*args):
210211
log_level="${log_level}",
211212
debug="${debug}",
212213
watch_tools="auto",
214+
default_job_shell="/bin/bash", # For conda dependency resolution
213215
tool_data_table_config_path=tool_data_table,
214216
integrated_tool_panel_config=("${temp_directory}/"
215217
"integrated_tool_panel_conf.xml"),
@@ -679,14 +681,21 @@ def _handle_dependency_resolution(config_directory, kwds):
679681
'conda_auto_install': False,
680682
'conda_ensure_channels': '',
681683
}
682-
683684
attributes = []
685+
686+
def add_attribute(key, value):
687+
attributes.append('%s="%s"' % (key, value))
688+
684689
for key, default_value in iteritems(dependency_attribute_kwds):
685690
value = kwds.get(key, default_value)
686691
if value != default_value:
687692
# Strip leading prefix (conda_) off attributes
688693
attribute_key = "_".join(key.split("_")[1:])
689-
attributes.append('%s="%s"' % (attribute_key, value))
694+
add_attribute(attribute_key, value)
695+
696+
if "prefix" not in attributes:
697+
conda_context = build_conda_context(**kwds)
698+
add_attribute("prefix", conda_context.conda_prefix)
690699

691700
attribute_str = " ".join(attributes)
692701

0 commit comments

Comments
 (0)