From 1efd4d4b3b99ec40071aa4d6fb7cf4030c51e2e0 Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Fri, 16 Sep 2016 18:46:37 +0200 Subject: [PATCH] add a conda clean function to remove downloaded tarballs after installation --- lib/galaxy/tools/deps/conda_util.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/galaxy/tools/deps/conda_util.py b/lib/galaxy/tools/deps/conda_util.py index 42ddc44f77d..4f12716f927 100644 --- a/lib/galaxy/tools/deps/conda_util.py +++ b/lib/galaxy/tools/deps/conda_util.py @@ -214,6 +214,16 @@ class CondaContext(installable.InstallableContext): install_base_args.extend(args) return self.exec_command("install", install_base_args) + def exec_clean(self, args=[]): + """ + Clean up after conda installation. + """ + clean_base_args = [ + "--tarballs" + ] + clean_base_args.extend(args) + return self.exec_command("clean", clean_base_args) + def export_list(self, name, path): return self.exec_command("list", [ "--name", name, @@ -488,6 +498,7 @@ def build_isolated_environment( return (path or tempdir_name, exit_code) finally: + conda_context.exec_clean() shutil.rmtree(tempdir)