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`.
This commit is contained in:
Paul Gauthier 2023-07-11 18:36:54 -07:00
parent 54939d5f6c
commit cace9675b0

View file

@ -23,7 +23,7 @@ def main():
with open("aider/__init__.py", "r") as f: with open("aider/__init__.py", "r") as f:
content = f.read() 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): if new_version <= version.parse(current_version):
raise ValueError( raise ValueError(
f"New version {new_version} must be greater than the current version {current_version}" f"New version {new_version} must be greater than the current version {current_version}"