Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the getpyver script as bugfix releases are not distinguished b…
…y wheels Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
- Loading branch information
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]]))) |