summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF Ding <jian-feng.ding@intel.com>2012-05-16 17:55:48 +0800
committerJF Ding <jian-feng.ding@intel.com>2012-05-16 17:59:58 +0800
commite7139b0d4633f810407755261103f1bae7ef4480 (patch)
tree05011dbcf01ef3ff4da499efde7259bbeffc7a2e
parent5a4c2e7367d510717e1c9dcb69b4c3ec5b2426ff (diff)
downloadkickstarter-e7139b0d4633f810407755261103f1bae7ef4480.tar.gz
kickstarter-e7139b0d4633f810407755261103f1bae7ef4480.tar.bz2
kickstarter-e7139b0d4633f810407755261103f1bae7ef4480.zip
update setup.py to apply VERSION in installation
-rw-r--r--setup.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index f46eaae..735a510 100644
--- a/setup.py
+++ b/setup.py
@@ -8,8 +8,28 @@ try:
except ImportError:
pass
+MOD_NAME = 'kickstart'
+
+version_path = 'VERSION'
+if not os.path.isfile(version_path):
+ print 'No VERSION file in topdir, abort'
+ sys.exit(1)
+
+try:
+ # first line should be the version number
+ version = open(version_path).readline().strip()
+ if not version:
+ print 'VERSION file is invalid, abort'
+ sys.exit(1)
+
+ ver_file = open('%s/__version__.py' % MOD_NAME, 'w')
+ ver_file.write("VERSION = \"%s\"\n" % version)
+ ver_file.close()
+except IOError:
+ print 'WARNING: Cannot write version number file'
+
setup(name='kickstarter',
- version = "0.2",
+ version = version,
description='Kickstarter',
author='Anas Nashif',
author_email='anas.nashif@intel.com',