Commit 5c2e3ebf authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: not easy to know current versions of pip, setuptools

and wheels in developement

Solution: show used versions
parent 2dbcc13a
......@@ -96,10 +96,26 @@ def check_upgrade(package):
except subprocess.CalledProcessError:
raise RuntimeError("Upgrade %s failed." % package)
def show(package):
try:
sys.stdout.flush()
output = subprocess.check_output(
[sys.executable, '-m', 'pip', 'show', package],
)
for line in output.splitlines():
if line.startswith(b'Name') or line.startswith(b'Version'):
print(line.decode('utf8'))
except subprocess.CalledProcessError:
raise RuntimeError("Upgrade %s failed." % package)
need_restart = False
for package in ['pip', 'setuptools', 'wheel']:
did_upgrade = check_upgrade(package)
show(package)
need_restart = need_restart or did_upgrade
if need_restart:
print("Restart")
sys.stdout.flush()
......
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