diff options
author | JF Ding <jian-feng.ding@intel.com> | 2012-05-16 17:55:48 +0800 |
---|---|---|
committer | JF Ding <jian-feng.ding@intel.com> | 2012-05-16 17:59:58 +0800 |
commit | e7139b0d4633f810407755261103f1bae7ef4480 (patch) | |
tree | 05011dbcf01ef3ff4da499efde7259bbeffc7a2e | |
parent | 5a4c2e7367d510717e1c9dcb69b4c3ec5b2426ff (diff) | |
download | kickstarter-e7139b0d4633f810407755261103f1bae7ef4480.tar.gz kickstarter-e7139b0d4633f810407755261103f1bae7ef4480.tar.bz2 kickstarter-e7139b0d4633f810407755261103f1bae7ef4480.zip |
update setup.py to apply VERSION in installation
-rw-r--r-- | setup.py | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -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', |