Skip to content

Commit

Permalink
Merge pull request #3536 from blankenberg/17.01-conda-fix
Browse files Browse the repository at this point in the history
[17.01] Fix conda resolver when conda_auto_install = True and install = False
  • Loading branch information
martenson committed Feb 2, 2017
2 parents f1062af + 0ce7f68 commit 961efb4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/galaxy/tools/deps/resolvers/conda.py
Expand Up @@ -160,7 +160,14 @@ def resolve_all(self, requirements, **kwds):
dependencies = []

is_installed = self.conda_context.has_env(env)
if not is_installed and (self.auto_install or kwds.get('install', False)):
install = kwds.get('install', None)
if install is None:
# Default behavior, install dependencies if conda_auto_install is active.
install = not is_installed and self.auto_install
elif install:
# Install has been set to True, install if not yet installed.
install = not is_installed
if install:
is_installed = self.install_all(conda_targets)

if is_installed:
Expand Down Expand Up @@ -209,7 +216,12 @@ def resolve(self, requirement, **kwds):
preserve_python_environment = kwds.get("preserve_python_environment", False)

job_directory = kwds.get("job_directory", None)
if not is_installed and (self.auto_install or kwds.get('install', False)):
install = kwds.get('install', None)
if install is None:
install = not is_installed and self.auto_install
elif install:
install = not is_installed
if install:
is_installed = self.install_dependency(name=name, version=version, type=type)

if not is_installed:
Expand Down

0 comments on commit 961efb4

Please sign in to comment.