diff --git a/scripts/versionbump.py b/scripts/versionbump.py index f0f57e0cd..30277fd52 100755 --- a/scripts/versionbump.py +++ b/scripts/versionbump.py @@ -2,6 +2,7 @@ import argparse import datetime +import os import re import subprocess import sys @@ -150,6 +151,15 @@ def main(): if not dry_run: subprocess.run(cmd, check=True) + # Remove aider/__version__.py if it exists + version_file = "aider/__version__.py" + if os.path.exists(version_file): + print(f"Removing {version_file}") + if not dry_run: + os.remove(version_file) + subprocess.run(["git", "add", version_file], check=True) + subprocess.run(["git", "commit", "-m", f"Remove {version_file}"], check=True) + subprocess.run(["git", "push", "origin", "--no-verify"], check=True) if __name__ == "__main__": main()