Fixes related to cache directory changes in pip>=6.

This commit is contained in:
zer0def 2017-03-27 16:29:41 +02:00
parent 9d0762deca
commit 7976840100
3 changed files with 17 additions and 8 deletions

View file

@ -344,6 +344,7 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
target=None,
download=None,
download_cache=None,
cache_dir=None,
source=None,
upgrade=False,
force_reinstall=False,
@ -440,8 +441,8 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
download
Download packages into ``download`` instead of installing them
download_cache
Cache downloaded packages in ``download_cache`` dir
download_cache | cache_dir
Cache downloaded packages in ``download_cache`` or ``cache_dir`` dir
source
Check out ``editable`` packages into ``source`` dir
@ -678,8 +679,10 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
if download:
cmd.extend(['--download', download])
if download_cache:
cmd.extend(['--download-cache', download_cache])
if download_cache or cache_dir:
cmd.extend(['--cache-dir' if salt.utils.compare_versions(
ver1=version(bin_env), oper='>=', ver2='6.0.0'
) else '--download-cache', download_cache or cache_dir])
if source:
cmd.extend(['--source', source])

View file

@ -237,6 +237,7 @@ def installed(name,
target=None,
download=None,
download_cache=None,
cache_dir=None,
source=None,
upgrade=False,
force_reinstall=False,
@ -336,8 +337,8 @@ def installed(name,
download
Download packages into ``download`` instead of installing them
download_cache
Cache downloaded packages in ``download_cache`` dir
download_cache | cache_dir
Cache downloaded packages in ``download_cache`` or ``cache_dir`` dir
source
Check out ``editable`` packages into ``source`` dir
@ -681,6 +682,7 @@ def installed(name,
target=target,
download=download,
download_cache=download_cache,
cache_dir=cache_dir,
source=source,
upgrade=upgrade,
force_reinstall=force_reinstall,

View file

@ -47,6 +47,7 @@ def managed(name,
no_deps=False,
pip_download=None,
pip_download_cache=None,
pip_cache_dir=None,
pip_exists_action=None,
pip_ignore_installed=False,
proxy=None,
@ -54,7 +55,8 @@ def managed(name,
env_vars=None,
no_use_wheel=False,
pip_upgrade=False,
pip_pkgs=None):
pip_pkgs=None,
pip_no_cache_dir=False):
'''
Create a virtualenv and optionally manage it with pip
@ -270,6 +272,7 @@ def managed(name,
extra_index_url=extra_index_url,
download=pip_download,
download_cache=pip_download_cache,
cache_dir=pip_cache_dir,
no_chown=no_chown,
pre_releases=pre_releases,
exists_action=pip_exists_action,
@ -278,7 +281,8 @@ def managed(name,
no_deps=no_deps,
proxy=proxy,
use_vt=use_vt,
env_vars=env_vars
env_vars=env_vars,
no_cache_dir=pip_no_cache_dir
)
ret['result'] &= _ret['retcode'] == 0
if _ret['retcode'] > 0: