Move to tag-versioning. v1.6.0
authorCarl Hetherington <cth@carlh.net>
Sat, 7 Apr 2018 23:57:47 +0000 (00:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 7 Apr 2018 23:57:47 +0000 (00:57 +0100)
wscript

diff --git a/wscript b/wscript
index 4676b2bd977fd75045a3d35c99b0eb5c0ccaba14..b6271e5a344cf82f7ddc03628b0ca179d1f5ed22 100644 (file)
--- a/wscript
+++ b/wscript
@@ -38,7 +38,15 @@ import distutils.spawn
 from waflib import Logs, Context
 
 APPNAME = 'libdcp'
-VERSION = '1.5.1devel'
+
+this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+
+if this_version == '':
+    VERSION = '%sdevel' % last_version[1:].strip()
+else:
+    VERSION = this_version[1:].strip()
+
 API_VERSION = '-1.0'
 
 def options(opt):