diff options
author | Monty Taylor <mordred@inaugust.com> | 2014-12-17 00:44:13 -0500 |
---|---|---|
committer | Clark Boylan <clark.boylan@gmail.com> | 2014-12-17 13:54:26 -0800 |
commit | 5dd31ac46b8b5b7d3b0e1fb123f653ac915eeac6 (patch) | |
tree | fe9b613812a38ed10239e0d8bb4cf14fe7eaf987 | |
parent | 65f4fafd907a16ea1952ab7072676db2e9e0c51d (diff) | |
download | pbr-5dd31ac46b8b5b7d3b0e1fb123f653ac915eeac6.tar.gz |
Use post version signifiers
PEP440 is unhappy about revcounts after pre-release tags.
Change-Id: I553a0bf9f522d50bcbdb16756c994058bd27da77
-rw-r--r-- | pbr/packaging.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py index 820cb9c..294421d 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -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 |