dvc: dynamic version

Fixes #566

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-03-28 13:55:30 +03:00
parent 83848b08ad
commit 4089aebfba
+15
View File
@@ -3,5 +3,20 @@ DVC
----
Make your data science projects reproducible and shareable.
"""
import os
VERSION = '0.9.3'
if os.getenv('APPVEYOR_REPO_TAG', '').lower() != 'true' and os.getenv('TRAVIS_TAG', '') == '':
# Dynamically update version
try:
import git
repo = git.Repo(os.curdir, search_parent_directories=True)
sha = repo.head.object.hexsha
short_sha = repo.git.rev_parse(sha, short=6)
dirty = '.mod' if repo.is_dirty() else ''
VERSION = '{}+{}{}'.format(VERSION, short_sha, dirty)
except:
pass
__version__ = VERSION