Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
5c2e3ebf
Commit
5c2e3ebf
authored
Mar 05, 2021
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: not easy to know current versions of pip, setuptools
and wheels in developement Solution: show used versions
parent
2dbcc13a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
dev.py
dev.py
+16
-0
No files found.
dev.py
View file @
5c2e3ebf
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment