fix too many outputs bug
@@ -82,7 +82,7 @@ def parse_req(req):
def get_pip_list_output():
"""Uses the invoking python executable to get the output from pip list."""
out = subprocess.Popen(
- [sys.executable, "-m", "pip", "list", "--disable-pip-version-check"],
+ [sys.executable, "-m", "pip", "list", "--disable-pip-version-check", "--format", "freeze"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
@@ -95,7 +95,7 @@ def get_pip_list_output():
# this should be compatible with py27 https://docs.python.org/2.7/library/stdtypes.html#str.decode
for line in stdout.decode("utf-8").split(os.linesep)[2:]:
if line:
- package, version = re.split("\s+", line)
+ package, version = re.split("==", line)
collected_output[package] = version
else:
raise Exception(stderr)
