Commit 26cdb43c authored by Sylvain Herlédan's avatar Sylvain Herlédan

Update build version each time code is modified and versioned.

parent 38074385
......@@ -39,6 +39,8 @@ nosetests.xml
DS_Store
*.sqlite3
VERSION.txt
migrations
*/migrations/*.py
......
......@@ -30,10 +30,24 @@ except subprocess.CalledProcessError:
with open("CONTRIBUTORS.txt", "r") as f:
authors_email = ', '.join(f.readlines())
# Update version when there is a new git commit
major_minor_version = '0.1'
package_dir = os.path.dirname(__file__)
version_path = os.path.join(package_dir, 'VERSION.txt')
if os.path.exists('.git') and os.path.isdir('.git'):
commits = subprocess.check_output([ '/usr/bin/git'
, 'rev-list'
, 'HEAD'
, '--count']).decode('utf-8').strip()
with open(version_path, 'w') as f:
f.write('{}.{}\n'.format(major_minor_version, commits))
with open(version_path, 'r') as f:
version = f.read()
setup(
name = "cerbere",
version = "0.1.1",
version = version,
author = "Felyx Project Collaborators: %s" % authors_email,
author_email = "jean.francois.piolle@ifremer.fr",
description = "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment