add a conda clean function to remove downloaded tarballs after installation

This commit is contained in:
Bjoern Gruening
2016-11-29 17:42:09 +01:00
committed by mvdbeek
parent 16b49d9140
commit 1efd4d4b3b
+11
View File
@@ -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)