Override bumpversion

This commit is contained in:
2019-11-22 15:30:58 -05:00
parent e6820821a8
commit 1f0bc75c67
2 changed files with 18 additions and 6 deletions

View File

@ -11,18 +11,17 @@ except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
def get_version(dot=False):
config = ConfigParser()
config.read('./.bumpversion.cfg')
def get_tag_version():
version = "develop"
tagged_versions = subprocess.Popen(['git','tag','-l','[0-9]*.[0-9]*.[0-9]*'],
stdout=subprocess.PIPE, stderr=DEVNULL, cwd=".").stdout.read().decode('utf-8').rstrip().split('\n')
if len(tagged_versions) > 0 and tagged_versions[-1] != "":
version = tagged_versions[-1]
return version
def get_version(dot=False):
version = get_tag_version()
# Get the commit hash of the version
v_hash = subprocess.Popen(['git', 'rev-list', '-n', '1', version], stdout=subprocess.PIPE,