From 2d0f789cb9f8c486ccbdd03a76f116f1d5c7b7cb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 20 Jul 2023 09:48:11 -0300 Subject: [PATCH 1/5] aider: Increment the version by 0.0.1 and add "-dev" after the version bump. # Aider chat conversation: USER: why is it thinking that 0.9.0 is newer than 0.9.0-dev ASSISTANT: The version comparison is being done using the `packaging.version.parse` function. This function follows the PEP 440 version identification and comparison rules. According to PEP 440, a version like "0.9.0-dev" is considered a pre-release of "0.9.0", and therefore "0.9.0" is considered newer. If you want "0.9.0-dev" to be considered newer than "0.9.0", you would need to change the version comparison logic. However, this would be against the standard Python versioning rules and is not recommended. If you still want to proceed with this, please confirm and I will provide the necessary changes. USER: I added these *read-write* files: scripts/versionbump.py ASSISTANT: I understand that you want to modify the version comparison logic in your scripts. However, I would like to clarify where exactly you want this change to be made. The file `scripts/versionbump.py` does not seem to have any version comparison logic that would consider "0.9.0 ^C KeyboardInterrupt USER: instead of adding -dev into the version after the bump, can you instead increment the version by 0.0.1 and then add dev ASSISTANT: Sure, we can modify the `scripts/versionbump.py` script to increment the version by 0.0.1 and then add "-dev" to it. Here's how we can do it: 1. After the new version is parsed, we can increment the patch version by 1. 2. Then, we can add "-dev" to this incremented version. Here's the change: ```python scripts/versionbump.py <<<<<<< ORIGINAL new_version = version.parse(new_version_str) with open("aider/__init__.py", "r") as f: content = f.read() ======= new_version = version.parse(new_version_str) 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() >>>>>>> UPDATED ``` ```python scripts/versionbump.py <<<<<<< ORIGINAL updated_dev_content = re.sub( r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content ) ======= updated_dev_content = re.sub( r'__version__ = ".+?"', f'__version__ = "{incremented_version}-dev"', content ) >>>>>>> UPDATED ``` This will increment the patch version by 0.0.1 and then add "-dev" to it after the version bump. --- aider/versioncheck.py | 6 ++++++ scripts/versionbump.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/aider/versioncheck.py b/aider/versioncheck.py index c16a0d4b6..f297c7695 100644 --- a/aider/versioncheck.py +++ b/aider/versioncheck.py @@ -13,6 +13,12 @@ def check_version(print_cmd): latest_version = data["info"]["version"] current_version = aider.__version__ + from aider.dump import dump + dump(current_version) + dump(packaging.version.parse(latest_version)) + dump(packaging.version.parse( + current_version + )) if packaging.version.parse(latest_version) <= packaging.version.parse( current_version ): diff --git a/scripts/versionbump.py b/scripts/versionbump.py index 86549077e..027e15658 100644 --- a/scripts/versionbump.py +++ b/scripts/versionbump.py @@ -19,6 +19,7 @@ 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}") with open("aider/__init__.py", "r") as f: content = f.read() @@ -51,7 +52,7 @@ def main(): subprocess.run(cmd, check=True) updated_dev_content = re.sub( - r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content + r'__version__ = ".+?"', f'__version__ = "{incremented_version}-dev"', content ) print() From 46083802c7894134cd9aca1a3ce911fe4777eac2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 20 Jul 2023 09:49:40 -0300 Subject: [PATCH 2/5] cleanup --- aider/__init__.py | 2 +- aider/versioncheck.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/aider/__init__.py b/aider/__init__.py index 8ea1e3450..0dffdf106 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1 +1 @@ -__version__ = "0.9.0-dev" +__version__ = "0.9.1-dev" diff --git a/aider/versioncheck.py b/aider/versioncheck.py index f297c7695..3c4ff2811 100644 --- a/aider/versioncheck.py +++ b/aider/versioncheck.py @@ -13,15 +13,7 @@ def check_version(print_cmd): latest_version = data["info"]["version"] current_version = aider.__version__ - from aider.dump import dump - dump(current_version) - dump(packaging.version.parse(latest_version)) - dump(packaging.version.parse( - current_version - )) - if packaging.version.parse(latest_version) <= packaging.version.parse( - current_version - ): + if packaging.version.parse(latest_version) <= packaging.version.parse(current_version): return print_cmd(f"Newer version v{latest_version} is available. To upgrade, run:") From d7fd4eb8c76fffc97fa001cf252b1b6f9db36afb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 20 Jul 2023 09:51:16 -0300 Subject: [PATCH 3/5] aider: Centered the SVG image and added a Discord badge below it linking to https://discord.gg/SqzfE6bw. # Aider chat conversation: USER: center the svg image and place a discord badge below it linking to https://discord.gg/SqzfE6bw ASSISTANT: To center the SVG image and place a Discord badge below it, we need to modify the README.md file. Here are the changes: markdown README.md <<<<<<< ORIGINAL ![aider screencast](assets/screencast.svg) - [Discord](https://discord.gg/SqzfE6bw) =======

aider screencast

chat on Discord

>>>>>>> UPDATED This change centers the SVG image and places a Discord badge below it. The badge links to the provided Discord URL. --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ce123464..a696f7c5b 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,15 @@ Aider makes it easy to proposed by GPT without copy/pasting. It also has features that [help GPT-4 understand and modify larger codebases](https://aider.chat/docs/ctags.html). -![aider screencast](assets/screencast.svg) +

+ aider screencast +

-- [Discord](https://discord.gg/SqzfE6bw) +

+ + chat on Discord + +

- [Getting started](#getting-started) - [Example chat transcripts](#example-chat-transcripts) - [Features](#features) From 750f8a45c644e073052149f90286ed0bfbbacf93 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 20 Jul 2023 09:52:54 -0300 Subject: [PATCH 4/5] Changed Discord chat badge to a blue "Join Discord" badge. # Aider chat conversation: --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a696f7c5b..d0425b3e7 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ It also has features that [help GPT-4 understand and modify larger codebases](ht

- chat on Discord +

- [Getting started](#getting-started) From bd1811db4d751803afbde3cce80ba4c5a52532e1 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 20 Jul 2023 09:53:26 -0300 Subject: [PATCH 5/5] space --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d0425b3e7..c6b6ca399 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ It also has features that [help GPT-4 understand and modify larger codebases](ht

+ - [Getting started](#getting-started) - [Example chat transcripts](#example-chat-transcripts) - [Features](#features)