mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
aider: Set version to x.y.z-dev and push to origin.
# Aider chat conversation: USER: I did `git reset --hard HEAD~1` to discard the last edits. ASSISTANT: Okay, that command will undo the last commit and discard the changes. If you need to make any further changes or need assistance with anything else, feel free to ask. USER: we need to commit __init__ with x.y.z, tag it, push it. and THEN write a new __init__ with the -dev version, and then commit that. ASSISTANT: Understood. We need to modify the `scripts/versionbump.py` file to implement this. Here are the proposed changes: ```python scripts/versionbump.py <<<<<<< ORIGINAL updated_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}"', content) if dry_run: print("Updating aider/__init__.py with new version:") print(updated_content) else: with open("aider/__init__.py", "w") as f: f.write(updated_content) git_commands = [ ["git", "add", "aider/__init__.py"], ["git", "commit", "-m", f"version bump to {new_version}"], ["git", "tag", f"v{new_version}"], ["git", "push", "origin"], ["git", "push", "origin", f"v{new_version}"], ] ======= updated_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}"', content) if dry_run: print("Updating aider/__init__.py with new version:") print(updated_content) else: with open("aider/__init__.py", "w") as f: f.write(updated_content) git_commands = [ ["git", "add", "aider/__init__.py"], ["git", "commit", "-m", f"version bump to {new_version}"], ["git", "tag", f"v{new_version}"], ["git", "push", "origin"], ["git", "push", "origin", f"v{new_version}"], ] for cmd in git_commands: if dry_run: print(f"Running: {' '.join(cmd)}") else: subprocess.run(cmd, check=True) updated_dev_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content) if dry_run: print("Updating aider/__init__.py with new dev version:") print(updated_dev_content) else: with open("aider/__init__.py", "w") as f: f.write(updated_dev_content) git_commands_dev = [ ["git", "add", "aider/__init__.py"], ["git", "commit", "-m", f"set version to {new_version}-dev"], ["git", "push", "origin"], ] for cmd in git_commands_dev: if dry_run: print(f"Running: {' '.join(cmd)}") else: subprocess.run(cmd, check=True) >>>>>>> UPDATED ``` These changes will ensure that the version in `aider/__init__.py` is set to 'x.y.z', committed, tagged, and pushed. Then, it will be updated to 'x.y.z-dev', committed, and pushed.
This commit is contained in:
parent
967cb1bd8d
commit
54939d5f6c
1 changed files with 27 additions and 0 deletions
|
@ -52,6 +52,33 @@ def main():
|
||||||
else:
|
else:
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
updated_dev_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content)
|
||||||
|
|
||||||
|
if dry_run:
|
||||||
|
print("Updating aider/__init__.py with new dev version:")
|
||||||
|
print(updated_dev_content)
|
||||||
|
else:
|
||||||
|
with open("aider/__init__.py", "w") as f:
|
||||||
|
f.write(updated_dev_content)
|
||||||
|
|
||||||
|
git_commands_dev = [
|
||||||
|
["git", "add", "aider/__init__.py"],
|
||||||
|
["git", "commit", "-m", f"set version to {new_version}-dev"],
|
||||||
|
["git", "push", "origin"],
|
||||||
|
]
|
||||||
|
|
||||||
|
for cmd in git_commands_dev:
|
||||||
|
if dry_run:
|
||||||
|
print(f"Running: {' '.join(cmd)}")
|
||||||
|
else:
|
||||||
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
for cmd in git_commands:
|
||||||
|
if dry_run:
|
||||||
|
print(f"Running: {' '.join(cmd)}")
|
||||||
|
else:
|
||||||
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue