Commit 202f679a authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: pip Python2.7 warning displayed too often

Solution: show it only once
parent 911dfb3f
......@@ -4,6 +4,8 @@ Change History
3.0.0a2 (unreleased)
====================
- Show only once pip warning about python version.
- Better patch for ``pkg_resources.Distribution.hashcmp`` performance.
......
......@@ -1659,6 +1659,17 @@ def call_pip_install(spec, dest):
args.append(spec)
try:
from pip._internal.cli.cmdoptions import no_python_version_warning
HAS_WARNING_OPTION = True
except ImportError:
HAS_WARNING_OPTION = False
if HAS_WARNING_OPTION:
if not hasattr(call_pip_install, 'displayed'):
call_pip_install.displayed = True
else:
args.append('--no-python-version-warning')
if level <= logging.DEBUG:
logger.debug('Running pip install:\n"%s"\npath=%s\n',
'" "'.join(args), path)
......
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