Do not use the cache dir for PIP installs (#24233)

This commit is contained in:
Paulus Schoutsen committed 2019-06-01 14:34:27 -07:00
1 parent 09c43e8854
commit bf85e18d45
3 files changed
+23 -10

No files matched your search

+4 -1
View File
@@ -49,7 +49,8 @@ def is_installed(package: str) -> bool:
def install_package(package: str, upgrade: bool = True,
target: Optional[str] = None,
constraints: Optional[str] = None,
find_links: Optional[str] = None) -> bool:
find_links: Optional[str] = None,
no_cache_dir: Optional[bool] = False) -> bool:
"""Install a package on PyPi. Accepts pip compatible package strings.
Return boolean if install successful.
@@ -58,6 +59,8 @@ def install_package(package: str, upgrade: bool = True,
_LOGGER.info('Attempting install of %s', package)
env = os.environ.copy()
args = [sys.executable, '-m', 'pip', 'install', '--quiet', package]
if no_cache_dir:
args.append('--no-cache-dir')
if upgrade:
args.append('--upgrade')
if constraints is not None: