mirror of https://github.com/docker/compose.git
Prevent pip version checks when calling `pip freeze`
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
e2f6f0122e
commit
e7e159076b
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
@ -12,8 +13,12 @@ try:
|
|||
# https://github.com/docker/compose/issues/4425
|
||||
# https://github.com/docker/compose/issues/4481
|
||||
# https://github.com/pypa/pip/blob/master/pip/_vendor/__init__.py
|
||||
env = os.environ.copy()
|
||||
env[str('PIP_DISABLE_PIP_VERSION_CHECK')] = str('1')
|
||||
|
||||
s_cmd = subprocess.Popen(
|
||||
['pip', 'freeze'], stderr=subprocess.PIPE, stdout=subprocess.PIPE
|
||||
['pip', 'freeze'], stderr=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
env=env
|
||||
)
|
||||
packages = s_cmd.communicate()[0].splitlines()
|
||||
dockerpy_installed = len(
|
||||
|
|
Loading…
Reference in New Issue