Skip to content

Commit a0854b0

Browse files
author
y-p
committed
Merge pull request #4218 from y-p/PR_dev_version_string
BLD: Use 'git describe' to generate the version string for dev versions
2 parents e231da4 + c95cddc commit a0854b0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def build_extensions(self):
189189
MAJOR = 0
190190
MINOR = 12
191191
MICRO = 0
192-
ISRELEASED = True
192+
ISRELEASED = False
193193
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
194194
QUALIFIER = ''
195195

@@ -199,19 +199,20 @@ def build_extensions(self):
199199
try:
200200
import subprocess
201201
try:
202-
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
202+
pipe = subprocess.Popen(["git", "describe", "HEAD"],
203203
stdout=subprocess.PIPE).stdout
204204
except OSError:
205205
# msysgit compatibility
206206
pipe = subprocess.Popen(
207-
["git.cmd", "rev-parse", "--short", "HEAD"],
207+
["git.cmd", "describe", "HEAD"],
208208
stdout=subprocess.PIPE).stdout
209209
rev = pipe.read().strip()
210210
# makes distutils blow up on Python 2.7
211211
if sys.version_info[0] >= 3:
212212
rev = rev.decode('ascii')
213213

214-
FULLVERSION += "-%s" % rev
214+
FULLVERSION = rev.lstrip('v')
215+
215216
except:
216217
warnings.warn("WARNING: Couldn't get git revision")
217218
else:

0 commit comments

Comments
 (0)