From b28b885eb7b57faa0b8470ee7a70f71e7099b9ea Mon Sep 17 00:00:00 2001 From: minqiyang Date: Fri, 29 Jun 2018 12:48:30 +0800 Subject: [PATCH] Add is_tag function fo ISTAGED --- python/setup.py.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/setup.py.in b/python/setup.py.in index 83f98daa882..38c79d8399b 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -5,11 +5,7 @@ class BinaryDistribution(Distribution): def has_ext_modules(foo): return True -MAJOR = 0 -MINOR = 11 -PATCH = 0 RC = 0 -ISTAGED = False @@ -53,6 +49,14 @@ def get_patch(): return PATCH def is_taged(): + try: + # release/0.13.0 + # git describe --exact-match --tags + cmd = ['git', 'rev-parse', 'HEAD'] + git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0].strip() + except: + git_commit = 'Unknown' + return git_commit return ISTAGED def write_version_py(filename='paddle/version.py'): -- GitLab