Prevent pip version checks when calling `pip freeze`

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-04-03 14:15:36 -07:00
parent e2f6f0122e
commit e7e159076b
1 changed files with 6 additions and 1 deletions

View File

@ -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(