From cace9675b0c81e0a56835cfbe8718b4932545cf0 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 11 Jul 2023 18:36:54 -0700 Subject: [PATCH] aider: The current version is now parsed and the "-dev" suffix is ignored. # Aider chat conversation: USER: we need to parse `current_version` and ignore the -dev if it is present ASSISTANT: To implement this, we need to modify the `scripts/versionbump.py` file. Here is the proposed change: ```python scripts/versionbump.py <<<<<<< ORIGINAL 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}" ) ======= current_version = re.search(r'__version__ = "(.+?)"', content).group(1).split('-dev')[0] if new_version <= version.parse(current_version): raise ValueError( f"New version {new_version} must be greater than the current version {current_version}" ) >>>>>>> UPDATED ``` This change will ensure that the '-dev' suffix is discarded when parsing the `current_version`. --- scripts/versionbump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/versionbump.py b/scripts/versionbump.py index 3a49325e5..716443d63 100644 --- a/scripts/versionbump.py +++ b/scripts/versionbump.py @@ -23,7 +23,7 @@ def main(): with open("aider/__init__.py", "r") as f: content = f.read() - current_version = re.search(r'__version__ = "(.+?)"', content).group(1) + current_version = re.search(r'__version__ = "(.+?)"', content).group(1).split('-dev')[0] if new_version <= version.parse(current_version): raise ValueError( f"New version {new_version} must be greater than the current version {current_version}"