diff --git a/setup.py b/setup.py index 834f1d67dc9b038b4a0a34bcbba6ef605afa4c1a..3822bef407cb19eb6ded4337ab7982239a159845 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,17 @@ import platform from setuptools import find_packages from setuptools import setup -slim_version = "2.3.3" +if 'develop' in subprocess.getoutput('git branch'): + slim_version = '0.0.0_dev' +else: + tag_list = subprocess.getoutput('git tag').split('\n') + if 'rc' in tag_list[-1]: + if tag_list[-1].split('-')[0] == tag_list[-2]: + slim_version = tag_list[-2] + else: + slim_version = tag_list[-1] + else: + slim_version = tag_list[-1] with open('./requirements.txt') as f: setup_requires = f.read().splitlines()