Skip to content

Commit

Permalink
maintain download() interface in conda.exports (#8698)
Browse files Browse the repository at this point in the history
maintain download() interface in conda.exports
  • Loading branch information
msarahan committed May 30, 2019
2 parents 0fd7941 + 4f37e32 commit 30a1730
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions conda/core/package_cache_data.py
Expand Up @@ -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)
11 changes: 8 additions & 3 deletions conda/exports.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 30a1730

Please sign in to comment.