Commit 2f3dda81 authored by Xavier Thompson's avatar Xavier Thompson

[feat] Disable pip caching for reproducibility

parent 8580e18f
...@@ -1876,6 +1876,12 @@ try: ...@@ -1876,6 +1876,12 @@ try:
except ImportError: except ImportError:
PIP_HAS_PYTHON_VERSION_WARNING_OPTION = False PIP_HAS_PYTHON_VERSION_WARNING_OPTION = False
try:
from pip._internal.cli.cmdoptions import no_cache
PIP_HAS_CACHE_OPTION = True
except ImportError:
PIP_HAS_CACHE_OPTION = False
def call_pip_command(command, operand, options, verbosity=-10): def call_pip_command(command, operand, options, verbosity=-10):
""" """
...@@ -1928,6 +1934,10 @@ def call_pip_command(command, operand, options, verbosity=-10): ...@@ -1928,6 +1934,10 @@ def call_pip_command(command, operand, options, verbosity=-10):
else: else:
args.append('--no-python-version-warning') args.append('--no-python-version-warning')
if PIP_HAS_CACHE_OPTION:
# Disable pip caching
args.append('--no-cache-dir')
args.extend(operand) args.extend(operand)
if log_level < logging.DEBUG: if log_level < logging.DEBUG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment