Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/[email protected]

- name: Setup uv
uses: astral-sh/[email protected]
with:
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Sync dependencies
run: uv sync --all-extras --dev --locked

- name: Run tests
run: uv run pytest --cov=acmsg --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
fail_ci_if_error: false

- name: Check types with mypy
run: uv run mypy src/acmsg
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
**/__pycache__
**/*.egg-info
dist/
build/
.pytest_cache/
.coverage
coverage.xml
.mypy_cache/
.ruff_cache/
*.log
.DS_Store
justfile
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include src/acmsg/assets/*.md
include src/acmsg/assets/*.yaml
include src/acmsg/templates/assets/*.md
include src/acmsg/templates/assets/*.yaml
include src/acmsg/*.py
include src/acmsg/*/*.py
5 changes: 0 additions & 5 deletions TODO.md

This file was deleted.

27 changes: 27 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
default:
help

help:
@just --list

build:
@echo "Running uv build..."
uv build

clean:
@echo "Cleaning cache dirs..."
uv clean
fd -uE .venv "__pycache__|.*_cache|dist|egg-info" | xargs rm -rf

test: clean
@echo "Running tests..."
pytest
mypy src/acmsg

sync:
@echo "Running uv sync..."
uv sync --all-packages --dev

bump-version:
@echo "Running bump-version..."
nix run .#bump-version
24 changes: 21 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ dependencies = [
"pyyaml (>=6.0.2,<7.0.0)",
"colorama (>=0.4.6,<0.5.0)",
"jinja2>=3.1.6",
"types-colorama>=0.4.15.20240311",
"types-pyyaml>=6.0.12.20250402",
"types-requests>=2.32.0.20250328",
]

[project.urls]
Expand All @@ -32,18 +35,33 @@ build-backend = "setuptools.build_meta"

[tool.setuptools]
package-dir = { "" = "src" }
packages = ["acmsg"]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]
include = ["acmsg*"]
namespaces = false

[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
ignored_tag_formats = ["latest"]
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = true
major_version_zero = true


[dependency-groups]
dev = [
"commitizen>=4.6.3",
"ipython>=9.2.0",
"commitizen>=4.6.3",
"ipython>=9.2.0",
"mypy>=1.15.0",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
pythonpath = ["src"]
10 changes: 10 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts = --cov=acmsg --cov-report=term-missing --cov-report=xml --no-cov-on-fail -v
log_cli = false
log_cli_level = INFO
log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
23 changes: 23 additions & 0 deletions src/acmsg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Automatic git commit message generator using AI models & the OpenRouter API."""

from importlib.metadata import version as _version

__version__ = _version(__name__)

from .core.config import Config
from .core.git import GitUtils
from .core.generation import CommitMessageGenerator, format_message
from .api.openrouter import OpenRouterClient
from .exceptions import AcmsgError, ApiError, GitError, ConfigError

__all__ = [
"Config",
"GitUtils",
"CommitMessageGenerator",
"format_message",
"OpenRouterClient",
"AcmsgError",
"ApiError",
"GitError",
"ConfigError",
]
Loading
Loading