Skip to content

Commit

Permalink
update the getpyver script as bugfix releases are not distinguished b…
Browse files Browse the repository at this point in the history
…y wheels

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 2, 2014
1 parent c0d4153 commit 803952b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions scripts/getpyver.py
@@ -1,13 +1,25 @@
#!/usr/bin/env python
# For internal use only.
"""Return the Python version in a sane format (vX.Y.Z).
"""Return the Python version in a sane format (vX.Y).
Also available a less sane format (X.Y.Z) if `short` is provided
Also available a less sane format (X.Y) if `short` is provided
as an argument.
Or ([v]X.Y.Z) if `long` is provided.
$ getpyver.py
v2.7
$ getpyver.py short
2.7
$ getpyver.py long
v2.7.6
$ getpyver.py long short
2.7.6
"""
import sys
limit = 3 if 'long' in sys.argv else 2
if 'short' in sys.argv:
print(".".join([str(i) for i in sys.version_info[0:3]]))
print(".".join([str(i) for i in sys.version_info[0:limit]]))
else:
print("v" + (".".join([str(i) for i in sys.version_info[0:3]])))
print("v" + (".".join([str(i) for i in sys.version_info[0:limit]])))

0 comments on commit 803952b

Please sign in to comment.