Skip to content

Commit

Permalink
Bugfix versionbump
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Jul 24, 2023
1 parent 62344a3 commit ece45c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/versionbump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit ece45c7

Please sign in to comment.