Skip to content

Commit

Permalink
Add --strict-channel-priority to conda create/install commands
Browse files Browse the repository at this point in the history
Fix galaxyproject#12790 .

This is added only if using conda >=4.7.5 , which includes this bug
fix: conda/conda#8819
  • Loading branch information
nsoranzo committed Oct 25, 2022
1 parent 32e3287 commit bb000b2
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lib/galaxy/tools/deps/conda_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,14 @@ def exec_create(self, args, allow_local=True, stdout_path=None):
"""
Return the process exit code (i.e. 0 in case of success).
"""
create_base_args = [
"-y",
"--quiet"
]
create_args = ["-y", "--quiet"]
if self.conda_version >= packaging.version.parse("4.7.5"):
create_args.append("--strict-channel-priority")
if allow_local and self.use_local:
create_base_args.extend(["--use-local"])
create_base_args.extend(self._override_channels_args)
create_base_args.extend(args)
return self.exec_command("create", create_base_args, stdout_path=stdout_path)
create_args.extend(["--use-local"])
create_args.extend(self._override_channels_args)
create_args.extend(args)
return self.exec_command("create", create_args, stdout_path=stdout_path)

def exec_remove(self, args):
"""
Expand All @@ -252,14 +251,14 @@ def exec_install(self, args, allow_local=True, stdout_path=None):
"""
Return the process exit code (i.e. 0 in case of success).
"""
install_base_args = [
"-y"
]
install_args = ["-y"]
if self.conda_version >= packaging.version.parse("4.7.5"):
install_args.append("--strict-channel-priority")
if allow_local and self.use_local:
install_base_args.append("--use-local")
install_base_args.extend(self._override_channels_args)
install_base_args.extend(args)
return self.exec_command("install", install_base_args, stdout_path=stdout_path)
install_args.append("--use-local")
install_args.extend(self._override_channels_args)
install_args.extend(args)
return self.exec_command("install", install_args, stdout_path=stdout_path)

def exec_clean(self, args=[], quiet=False):
"""
Expand Down

0 comments on commit bb000b2

Please sign in to comment.