Skip to content

Commit

Permalink
Merge pull request #23 from dougollerenshaw/fix_api_test_function_again
Browse files Browse the repository at this point in the history
Fixed broken "check_api" method
  • Loading branch information
dougollerenshaw authored Sep 19, 2024
2 parents f42fa74 + 9ec8127 commit 4e631a4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 21 deletions.
6 changes: 5 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ replace = __version__ = "{new_version}"

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

[bumpversion:file:.cz.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
5 changes: 5 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.1.0"
tag_format = "v$version"
update_changelog_on_bump = true
34 changes: 17 additions & 17 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Version Management
name: Automated Version Management

on:
pull_request:
Expand All @@ -23,30 +23,30 @@ jobs:
with:
python-version: '3.x'

- name: Install commitizen
run: pip install commitizen
- name: Install dependencies
run: pip install -r requirements.txt

- name: Preview version bump
id: preview
run: |
if git log -1 --pretty=%B | grep -qE '^(feat|fix|BREAKING CHANGE):|#(minor|major)'; then
NEW_VERSION=$(cz bump --dry-run)
cz bump --dry-run --yes
else
NEW_VERSION=$(cz bump --increment PATCH --dry-run)
cz bump --dry-run --yes --increment PATCH
fi
echo "New version would be: $NEW_VERSION"
echo "::set-output name=new_version::$NEW_VERSION"
NEW_VERSION=$(python -c "exec(open('version.py').read()); print(__version__)")
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.PAT }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
body: 'When merged, this PR will bump the version to: ${{ steps.preview.outputs.new_version }}'
owner: 'dougollerenshaw',
repo: 'CodeAIde',
body: `When merged, this PR will bump the version to: ${process.env.new_version}`
})
bump-version:
Expand All @@ -65,19 +65,19 @@ jobs:
with:
python-version: '3.x'

- name: Install commitizen
run: pip install commitizen
- name: Install dependencies
run: pip install -r requirements.txt

- name: Bump version
id: cz
id: bump
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 }}
NEW_VERSION=$(python -c "exec(open('version.py').read()); print(__version__)")
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Push changes
uses: ad-m/github-push-action@master
Expand All @@ -87,4 +87,4 @@ jobs:
tags: true

- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
run: echo "Bumped to version ${{ env.new_version }}"
3 changes: 1 addition & 2 deletions codeaide/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ 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()
success, message = api_utils.check_api_connection()
if success:
print("Connection successful!")
print("Claude says:", message)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ black
isort
pre-commit
pyqt5
bump2version
bump2version
commitizen

0 comments on commit 4e631a4

Please sign in to comment.