Skip to content

Commit

Permalink
Changes to control versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
dougollerenshaw committed Sep 19, 2024
1 parent 814a904 commit 44784f4
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 38 deletions.
12 changes: 12 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 0.1.0
commit = True
tag = True

[bumpversion:file:version.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
47 changes: 47 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bump version

on:
push:
branches:
- main

jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install commitizen
run: pip install commitizen

- name: Bump version
id: cz
run: |
if git log -1 --pretty=%B | grep -qE '^(feat|fix|BREAKING CHANGE):|#(minor|major)'; then
cz bump --yes
else
cz bump --increment PATCH --yes
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true

- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ https://github.com/user-attachments/assets/8aa729ff-c431-4a61-a9ef-d17050a27d02
## Usage
To test the API connection, run:
```
python codeaide.py test
```
This will send a simple "Hi Claude, are we communicating?" prompt to the API. If your API key is set up properly and you have an internet connection, you'll see a response at the command line that looks something like this:
```
Connection successful!
Claude says: Yes, we are communicating! I'm Claude, an AI assistant. How can I help you today?
```
To start CodeAIde for actual code generation, run:
```
Expand All @@ -79,6 +68,18 @@ Follow the prompts to interact with the AI assistant. You can:
- Copy the code to your clipboard or save it as a standalone file
- Select and re-run any previous version of the code form the current conversation.
To test the API connection, run:
```
python codeaide.py test
```
This will send a simple "Hi Claude, are we communicating?" prompt to the API. If your API key is set up properly and you have an internet connection, you'll see a response at the command line that looks something like this:
```
Connection successful!
Claude says: Yes, we are communicating! I'm Claude, an AI assistant. How can I help you today?
```
## Future feature roadmap
The following features do not currently exist, but adding them in the future would make this project more useful:
Expand Down
28 changes: 1 addition & 27 deletions codeaide.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
import sys

from PyQt5.QtWidgets import QApplication

from codeaide.logic.chat_handler import ChatHandler
from codeaide.ui.chat_window import ChatWindow
from codeaide.utils import api_utils


def main():
chat_handler = ChatHandler()

if len(sys.argv) > 1 and sys.argv[1] == "test":
success, message = chat_handler.check_api_connection()
success, message = api_utils.test_api_connection()
if success:
print("Connection successful!")
print("Claude says:", message)
else:
print("Connection failed.")
print("Error:", message)
else:
app = QApplication(sys.argv)
chat_window = ChatWindow(chat_handler)
chat_window.show()
sys.exit(app.exec_())

from codeaide.__main__ import main

if __name__ == "__main__":
main()
30 changes: 30 additions & 0 deletions codeaide/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import sys

from PyQt5.QtWidgets import QApplication

from codeaide.logic.chat_handler import ChatHandler
from codeaide.ui.chat_window import ChatWindow
from codeaide.utils import api_utils


def main():
chat_handler = ChatHandler()

if len(sys.argv) > 1 and sys.argv[1] == "test":
success, message = chat_handler.check_api_connection()
success, message = api_utils.test_api_connection()
if success:
print("Connection successful!")
print("Claude says:", message)
else:
print("Connection failed.")
print("Error:", message)
else:
app = QApplication(sys.argv)
chat_window = ChatWindow(chat_handler)
chat_window.show()
sys.exit(app.exec_())


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ black
isort
pre-commit
pyqt5
bump2version
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from setuptools import setup, find_packages
from version import __version__

# Read requirements from requirements.txt
with open("requirements.txt") as f:
requirements = f.read().splitlines()

setup(
name="codeaide",
version=__version__,
packages=find_packages(),
install_requires=requirements,
entry_points={
"console_scripts": [
"codeaide=codeaide.__main__:main",
],
},
author="Doug Ollerenshaw",
author_email="[email protected]",
description="A chat application leveraging large language models (LLMs) for code generation and execution",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https://github.com/dougollerenshaw/CodeAIde",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
)
2 changes: 2 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# version.py
__version__ = "0.1.0"

0 comments on commit 44784f4

Please sign in to comment.