Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix singularity logging messages causing conda fail #1523

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 8 additions & 11 deletions snakemake/deployment/conda.py
Expand Up @@ -624,19 +624,16 @@ def _check(self):
try:
version = shell.check_output(
self._get_cmd("conda --version"),
stderr=subprocess.STDOUT,
stderr=subprocess.PIPE,
universal_newlines=True,
)
if self.container_img:
version = "\n".join(
filter(
lambda line: not line.startswith("WARNING:")
and not line.startswith("ERROR:"),
version.splitlines(),
)
version_matches = re.findall("\d+.\d+.\d+", version)
if len(version_matches) != 1:
raise WorkflowError(
f"Unable to determine conda version. 'conda --version' returned {version}"
)

version = version.split()[1]
else:
version = version_matches[0]
if StrictVersion(version) < StrictVersion("4.2"):
raise CreateCondaEnvironmentException(
"Conda must be version 4.2 or later, found version {}.".format(
Expand All @@ -645,7 +642,7 @@ def _check(self):
)
except subprocess.CalledProcessError as e:
raise CreateCondaEnvironmentException(
"Unable to check conda version:\n" + e.output.decode()
"Unable to check conda version:\n" + e.stderr.decode()
)

def bin_path(self):
Expand Down