Skip to content

BLD: Use 'git describe' to generate the version string for dev versions #4218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
3 commits merged into from Jul 25, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def build_extensions(self):
MAJOR = 0
MINOR = 12
MICRO = 0
ISRELEASED = True
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''

Expand All @@ -199,19 +199,20 @@ def build_extensions(self):
try:
import subprocess
try:
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
pipe = subprocess.Popen(["git", "describe", "HEAD"],
stdout=subprocess.PIPE).stdout
except OSError:
# msysgit compatibility
pipe = subprocess.Popen(
["git.cmd", "rev-parse", "--short", "HEAD"],
["git.cmd", "describe", "HEAD"],
stdout=subprocess.PIPE).stdout
rev = pipe.read().strip()
# makes distutils blow up on Python 2.7
if sys.version_info[0] >= 3:
rev = rev.decode('ascii')

FULLVERSION += "-%s" % rev
FULLVERSION = rev.lstrip('v')

except:
warnings.warn("WARNING: Couldn't get git revision")
else:
Expand Down