From 5dd31ac46b8b5b7d3b0e1fb123f653ac915eeac6 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 17 Dec 2014 00:44:13 -0500 Subject: Use post version signifiers PEP440 is unhappy about revcounts after pre-release tags. Change-Id: I553a0bf9f522d50bcbdb16756c994058bd27da77 --- pbr/packaging.py | 8 +++++--- 1 file 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 -- cgit v1.2.1