Bugfix versionbump

This commit is contained in:
Paul Gauthier 2023-07-24 15:12:15 -03:00
parent 62344a39cc
commit ece45c7dc2

View file

@ -19,12 +19,14 @@ def main():
raise ValueError(f"Invalid version format, must be x.y.z: {new_version_str}")
new_version = version.parse(new_version_str)
incremented_version = version.Version(f"{new_version.major}.{new_version.minor}.{new_version.micro + 1}")
incremented_version = version.Version(
f"{new_version.major}.{new_version.minor}.{new_version.micro + 1}"
)
with open("aider/__init__.py", "r") as f:
content = f.read()
current_version = re.search(r'__version__ = "(.+?)"', content).group(1).split("-dev")[0]
current_version = re.search(r'__version__ = "(.+?)"', content).group(1)
if new_version <= version.parse(current_version):
raise ValueError(
f"New version {new_version} must be greater than the current version {current_version}"