From c3a727ac7ee5e942a4a44b4eec89ba1e789d7cf0 Mon Sep 17 00:00:00 2001 From: khazhyk Date: Thu, 12 Oct 2017 21:32:26 -0700 Subject: [PATCH] Show sha1 for development versions. --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b24921437..3441ff27c 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,12 @@ if version.endswith(('a', 'b', 'rc')): stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if out: - version = version + out.decode('utf-8').strip() + version += out.decode('utf-8').strip() + p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if out: + version += '-' + out.decode('utf-8').strip() except Exception: pass