From 4f37e32c7cc5361fd4f483599776c3fcbad9fbf3 Mon Sep 17 00:00:00 2001 From: Kale Franz Date: Mon, 20 May 2019 13:35:18 -0500 Subject: [PATCH] maintain download() interface in conda.exports Signed-off-by: Kale Franz --- conda/core/package_cache_data.py | 4 ++-- conda/exports.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/conda/core/package_cache_data.py b/conda/core/package_cache_data.py index e78dcd1b4f2..a5f5fd5bb44 100644 --- a/conda/core/package_cache_data.py +++ b/conda/core/package_cache_data.py @@ -727,6 +727,6 @@ def rm_fetched(dist): raise NotImplementedError() -def download(url, dst_path, session=None, md5=None, urlstxt=False, retries=3): +def download(url, dst_path, session=None, md5sum=None, urlstxt=False, retries=3): from ..gateways.connection.download import download as gateway_download - gateway_download(url, dst_path, md5) + gateway_download(url, dst_path, md5sum) diff --git a/conda/exports.py b/conda/exports.py index 765818f5eb9..b15eee5ab48 100644 --- a/conda/exports.py +++ b/conda/exports.py @@ -52,13 +52,13 @@ from .gateways.disk.link import lchmod # NOQA lchmod = lchmod -from .gateways.connection.download import TmpDownload # NOQA +from .gateways.connection.download import TmpDownload, download as _download # NOQA TmpDownload = TmpDownload handle_proxy_407 = lambda x, y: _warnings.warn("handle_proxy_407 is deprecated. " "Now handled by CondaSession.") -from .core.package_cache_data import download, rm_fetched # NOQA -download, rm_fetched = download, rm_fetched +from .core.package_cache_data import rm_fetched # NOQA +rm_fetched = rm_fetched from .gateways.disk.delete import delete_trash, move_to_trash # NOQA delete_trash, move_to_trash = delete_trash, move_to_trash @@ -394,3 +394,8 @@ def is_linked(prefix, dist): return prefix_record else: return None + + +def download(url, dst_path, session=None, md5sum=None, urlstxt=False, retries=3, + sha256=None, size=None): + return _download(url, dst_path, md5=md5sum, sha256=sha256, size=size)