update to bump2version

This commit is contained in:
Semantic Versioner 2019-11-25 16:12:58 -05:00
parent c2ac4fc1a7
commit 839a1dfb1d
4 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@ current_version = 0.0.0
commit = False
tag = True
tag_name = {new_version}
message = Bump version: {current_version} -> {new_version}
tag_message = Bump version: {current_version} -> {new_version}
[bumpversion:file:semver/__init__.py]
search = version = '{current_version}'

View File

@ -103,17 +103,17 @@ class SemVer(object):
with open(".bumpversion.cfg", "r") as file:
config_file = file.read()
# Update .bumpconfig
pattern = re.compile("current_version = [0-9.]*")
current_config = re.search(pattern, config_file)
if current_config:
config_file.replace(current_config.group(0), "current_version = " + get_tag_version())
else:
config_file.replace("[bumpversion]","[bumpversion]\ncurrent_version = " + get_tag_version())
with open(".bumpversion.cfg", "w") as file:
file.write(config_file)
#pattern = re.compile("current_version = [0-9.]*")
#current_config = re.search(pattern, config_file)
#if current_config:
#config_file.replace(current_config.group(0), "current_version = " + get_tag_version())
#else:
#config_file.replace("[bumpversion]","[bumpversion]\ncurrent_version = " + get_tag_version())
#with open(".bumpversion.cfg", "w") as file:
#file.write(config_file)
# version repo
p = subprocess.Popen(['bumpversion', self.version_type],
p = subprocess.Popen(['bumpversion', '--current-version', get_tag_version(), self.version_type],
cwd='.')
p.wait()
return self

View File

@ -98,7 +98,7 @@ setup(
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
'bumpversion==0.5.3',
'bump2version>=0.5.11',
'argparse>=1.2.1'
],