diff --git a/tools/__init__.py b/tools/__init__.py index cd0a21e04..a8b0b3eb7 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -303,7 +303,7 @@ def _patch(self, path, patch): @property def _package_installed(self): - result = util.misc.run_and_print(["conda", "list", "-f", "-c", "-p", self.env_path, "--json", self.package], silent=True, check=True, env=self.conda_env) + result = util.misc.run_and_print(["conda", "list", "-f", "-c", "-p", self.env_path, "--json", self.package], silent=True, env=self.conda_env) if result.returncode == 0: command_output = result.stdout.decode("UTF-8") data = json.loads(self._string_from_start_of_json(command_output)) @@ -381,7 +381,7 @@ def get_installed_version(self): run_cmd = ["conda", "list", "-c", "--json", "-f", "-p", self.env_path, self.package] - result = util.misc.run_and_print(run_cmd, silent=True, check=True, env=self.conda_env) + result = util.misc.run_and_print(run_cmd, silent=True, env=self.conda_env) if result.returncode == 0: try: command_output = result.stdout.decode("UTF-8") @@ -407,7 +407,6 @@ def uninstall_package(self): result = util.misc.run_and_print( run_cmd, silent=True, - check=True, env=self.conda_env) if result.returncode == 0: @@ -435,7 +434,7 @@ def install_package(self): python_version = "python=" + python_version if python_version else "" run_cmd.extend([python_version]) - result = util.misc.run_and_print(run_cmd, silent=True, check=True, env=self.conda_env) + result = util.misc.run_and_print(run_cmd, silent=True, env=self.conda_env) try: command_output = result.stdout.decode("UTF-8") data = json.loads(self._string_from_start_of_json(command_output)) @@ -454,7 +453,6 @@ def install_package(self): self._package_str ], silent=True, - check=True, env=self.conda_env, ) diff --git a/tools/diamond.py b/tools/diamond.py index a1fe8b1b4..caac7a367 100644 --- a/tools/diamond.py +++ b/tools/diamond.py @@ -15,6 +15,7 @@ URL = 'https://github.com/bbuchfink/diamond/archive/b576a5c03177603554f4627ae367f7bcbc6b8dcb.zip' TOOL_VERSION = '0.7.9' +CONDA_VERSION = tools.CondaPackageVersion('0.7.10', 'boost1.60_1') DIAMOND_COMMIT_DIR = 'diamond-b576a5c03177603554f4627ae367f7bcbc6b8dcb' DIAMOND_DIR = 'diamond-{}'.format(TOOL_VERSION) @@ -27,7 +28,9 @@ class Diamond(tools.Tool): def __init__(self, install_methods=None): if not install_methods: - install_methods = [DownloadAndBuildDiamond(URL, os.path.join(DIAMOND_DIR, 'bin', 'diamond'))] + install_methods = [ + tools.CondaPackage("diamond", version=CONDA_VERSION), + DownloadAndBuildDiamond(URL, os.path.join(DIAMOND_DIR, 'bin', 'diamond'))] super().__init__(install_methods=install_methods) def version(self): diff --git a/util/misc.py b/util/misc.py index 2f4d98b35..131a0c492 100644 --- a/util/misc.py +++ b/util/misc.py @@ -175,6 +175,7 @@ def run(args, stdin=None, stdout=None, stderr=None, shell=False, error = '' if check and returncode != 0: print(output.decode("utf-8")) + print(error.decode("utf-8")) try: raise subprocess.CalledProcessError( returncode, args, output, error) @@ -213,6 +214,10 @@ def run_and_print(args, stdout=None, stderr=None, log.log(loglevel, result.stdout.decode('utf-8')) else: print(e.output.decode('utf-8')) + try: + print(e.stderr.decode('utf-8')) + except TypeError: + pass sys.stdout.flush() raise(e) else: