From 1c89d18b6beecade6b7c9007b324e8cf0f486e22 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 13 Dec 2014 12:24:41 -0800 Subject: Prefix git suffixes with + instead of . setuptools 8.0 enforces the accepted version of PEP440, which means that 1.2.3.g123456 is now sorted before 1.0. Forget for a second that under no obvious human inspection this makes sense, it is now the law of the land and we must comply. I swear to god I'm going to start coding in Go. Change-Id: I2a5072d73e19ce77fa29ba5d8aa6e9649859a551 (cherry picked from commit fafd6c4db07789b2d378fdb5ceda89115d2abe30) --- pbr/packaging.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pbr/packaging.py b/pbr/packaging.py index 471ed85..44c14cc 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -809,10 +809,11 @@ def _get_version_from_git(pre_version): except Exception: sha = _run_git_command( ['log', '-n1', '--pretty=format:%h'], git_dir) - return "%s.dev%s.g%s" % (pre_version, _get_revno(git_dir), sha) + return "%s.dev%s+g%s" % (pre_version, _get_revno(git_dir), sha) else: return _run_git_command( - ['describe', '--always'], git_dir).replace('-', '.') + ['describe', '--always'], + git_dir).replace('-', '.').replace('.g', '+g') # 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 # object to work with. -- cgit v1.2.1