Use post version signifiers

PEP440 is unhappy about revcounts after pre-release tags.

Change-Id: I553a0bf9f522d50bcbdb16756c994058bd27da77
This commit is contained in:
Monty Taylor 2014-12-17 00:44:13 -05:00 committed by Clark Boylan
parent 65f4fafd90
commit 5dd31ac46b
1 changed files with 5 additions and 3 deletions

View File

@ -707,11 +707,13 @@ def _get_version_from_git(pre_version):
# First, if there are no -'s or .'s, then it's just a short sha.
# Create a synthetic version for it.
if '-' not in raw_version and '.' not in raw_version:
return "0.0.0.%s" % _get_revno(git_dir)
return "0.0.0.post%s" % _get_revno(git_dir)
# Now, we want to strip the short-sha prefix
stripped_version = raw_version.split('-g')[0]
# Finally, if we convert - to ., we'll get the version we want
return stripped_version.replace('-', '.')
# Finally, if we convert - to .post, which will turn the remaining
# - which separates the version from the revcount into a PEP440
# post string
return stripped_version.replace('-', '.post')
# If we don't know the version, return an empty string so at least
# the downstream users of the value always have the same type of