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
33 changes: 26 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# API Keys (Required to enable respective provider)
ANTHROPIC_API_KEY="your_anthropic_api_key_here" # Required: Format: sk-ant-api03-...
PERPLEXITY_API_KEY="your_perplexity_api_key_here" # Optional: Format: pplx-...
OPENAI_API_KEY="your_openai_api_key_here" # Optional, for OpenAI/OpenRouter models. Format: sk-proj-...
GOOGLE_API_KEY="your_google_api_key_here" # Optional, for Google Gemini models.
MISTRAL_API_KEY="your_mistral_key_here" # Optional, for Mistral AI models.
XAI_API_KEY="YOUR_XAI_KEY_HERE" # Optional, for xAI AI models.
AZURE_OPENAI_API_KEY="your_azure_key_here" # Optional, for Azure OpenAI models (requires endpoint in .taskmaster/config.json).
OLLAMA_API_KEY="your_ollama_api_key_here" # Optional: For remote Ollama servers that require authentication.

# Test repository (format: owner/repo)
TOADY_TEST_REPO=tonyblank/toady-integration-tests

# Test organization
TOADY_TEST_ORG=tonyblank

# Test PR number (PR that has review comments)
TOADY_TEST_PR_NUMBER=1

# API timeout in seconds
TOADY_API_TIMEOUT=30

# Rate limit buffer (minimum remaining API calls)
TOADY_RATE_LIMIT_BUFFER=100

# Skip slow tests (true/false)
TOADY_SKIP_SLOW_TESTS=false

# Retry configuration
TOADY_MAX_RETRY_ATTEMPTS=3
TOADY_RETRY_DELAY=1.0

# GitHub token (optional - gh CLI should handle auth)
# GH_TOKEN=your_github_token_here
EOF < /dev/null
44 changes: 44 additions & 0 deletions .github/workflows/ci-uv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI with uv

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

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

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: |
uv sync --all-extras

- name: Run linting
run: |
uv run ruff check src tests
uv run black --check src tests
uv run mypy src

- name: Run tests
run: |
uv run pytest --cov=src/toady --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
48 changes: 41 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-lint-${{ hashFiles('requirements-dev.txt') }}
key: ${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-lint-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e ".[dev]"
- name: Run pre-commit
run: pre-commit run --all-files

Expand All @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -48,26 +48,60 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-test-${{ matrix.python-version }}-${{ hashFiles('requirements-dev.txt') }}
key: ${{ runner.os }}-pip-test-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-test-${{ matrix.python-version }}-
${{ runner.os }}-pip-test-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
pip install -e ".[dev]"
- name: Run tests with pytest
run: |
pytest -v --cov=toady --cov-report=xml:coverage.xml --cov-report=term-missing
pytest -v --cov=toady --cov-report=xml:coverage.xml --cov-report=term-missing -m "not real_api"
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false

integration-test:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.TOADY_INTEGRATION_TOKEN || secrets.GITHUB_TOKEN }}
TOADY_TEST_REPO: tonyblank/toady-integration-tests
TOADY_TEST_ORG: tonyblank
TOADY_TEST_PR_NUMBER: 1
TOADY_API_TIMEOUT: 30
TOADY_RATE_LIMIT_BUFFER: 100
TOADY_SKIP_SLOW_TESTS: false
TOADY_MAX_RETRY_ATTEMPTS: 3
TOADY_RETRY_DELAY: 1.0
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-integration-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-integration-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run integration tests
run: |
pytest -v tests/integration/ -m "real_api" --tb=short --maxfail=3
continue-on-error: true

build:
runs-on: ubuntu-latest
needs: [lint, test]
Expand Down
114 changes: 87 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
.PHONY: help install install-dev test test-fast test-integration test-performance test-analysis lint format format-check type-check pre-commit check check-fast fix-check clean build
.PHONY: help install install-dev test test-fast test-integration test-performance test-analysis
.PHONY: lint format format-check type-check pre-commit check check-fast fix-check clean build
.PHONY: sync lock update add remove deps-check shell run

# Single source of truth: ALL commands use uv
export PATH := $(HOME)/.local/bin:$(PATH)

# Default target
help:
@echo "Available commands:"
@echo "🐍 Toady CLI Development Commands (Powered by uv)"
@echo ""
@echo "🚀 Installation:"
@echo " make install Install package in production mode"
@echo " make install-dev Install package in development mode with all dev dependencies"
@echo " make sync Sync dependencies from lock file (fastest)"
@echo ""
@echo "🧪 Testing:"
@echo " make test Run all tests with coverage (80% threshold)"
@echo "🧪 Testing (Advanced Test Suite):"
@echo " make test Run all tests with coverage (90% threshold)"
@echo " make test-fast Run fast unit tests only"
@echo " make test-integration Run integration tests only"
@echo " make test-performance Run performance benchmarks"
Expand All @@ -22,72 +28,88 @@ help:
@echo " make type-check Run type checking with mypy"
@echo " make pre-commit Run all pre-commit hooks"
@echo ""
@echo "✅ CI/CD Pipeline:"
@echo "✅ CI/CD Pipeline (Elegant Reporting):"
@echo " make check 🎯 Run COMPREHENSIVE CI/CD pipeline (all checks + tests)"
@echo " make check-fast ⚡ Run FAST quality checks (no tests, quick validation)"
@echo " make fix-check 🔧 Run checks with auto-fixing (like CI pipeline)"
@echo ""
@echo "📦 Dependency Management:"
@echo " make lock Generate/update lock file with exact versions"
@echo " make update Update dependencies to latest compatible versions"
@echo " make add PKG=name Add new dependency"
@echo " make remove PKG=name Remove dependency"
@echo " make deps-check Check for dependency conflicts"
@echo ""
@echo "🛠️ Development Utilities:"
@echo " make shell Open shell with project dependencies loaded"
@echo " make run ARGS='...' Run toady CLI in development mode"
@echo ""
@echo "🧹 Maintenance:"
@echo " make clean Remove build artifacts and cache files"
@echo " make build Build distribution packages"

install:
pip install -e .
@echo "📦 Installing package in production mode..."
uv pip install .

install-dev:
pip install -e ".[dev]"
pre-commit install
@echo "🔧 Installing development environment..."
uv sync --all-extras
uv run pre-commit install
@echo "✅ Development environment ready!"

## Testing (Advanced Test Suite - ALL using uv)
test:
@echo "🧪 Running comprehensive test suite with 80% coverage requirement..."
python3 scripts/test_config.py full

@echo "🧪 Running comprehensive test suite with 90% coverage requirement..."
uv run python scripts/test_config.py full

test-fast:
@echo "⚡ Running fast unit tests..."
python3 scripts/test_config.py fast
uv run python scripts/test_config.py fast

test-integration:
@echo "🔗 Running integration tests..."
python3 scripts/test_config.py integration
uv run python scripts/test_config.py integration

test-performance:
@echo "📊 Running performance benchmarks..."
python3 scripts/test_config.py performance
uv run python scripts/test_config.py performance

test-analysis:
@echo "📈 Generating test suite analysis..."
python3 scripts/test_config.py analyze
python3 scripts/test_config.py report
uv run python scripts/test_config.py analyze
uv run python scripts/test_config.py report

## Code Quality (ALL using uv)
lint:
ruff check --no-fix src tests
uv run ruff check --no-fix src tests

format:
black src tests
uv run black src tests

format-check:
black --check src tests
uv run black --check src tests

type-check:
mypy --strict --ignore-missing-imports src
uv run mypy --strict --ignore-missing-imports src

pre-commit:
pre-commit run --all-files
uv run pre-commit run --all-files

## CI/CD Pipeline (Elegant Reporting - ALL using uv)
# 🎯 COMPREHENSIVE CI/CD PIPELINE
# This is the main command that runs all quality checks, tests, and validations
# with beautiful reporting and elegant progress tracking
check:
@echo "🚀 Launching comprehensive CI/CD pipeline..."
python3 scripts/ci_check.py full
uv run python scripts/ci_check.py full

# ⚡ FAST QUALITY CHECK PIPELINE
# Quick validation without running the full test suite
# Perfect for rapid development feedback
check-fast:
@echo "⚡ Running fast quality check pipeline..."
python3 scripts/ci_check.py fast
uv run python scripts/ci_check.py fast

# 🔧 AUTO-FIXING PIPELINE
# Runs checks with automatic fixing where possible
Expand All @@ -96,17 +118,53 @@ fix-check:
@echo "🔧 Running auto-fixing CI/CD pipeline..."
@echo ""
@echo "📋 Step 1: Auto-fixing code issues..."
pre-commit run --all-files || true
uv run pre-commit run --all-files || true
@echo ""
@echo "🔍 Step 2: Running type checks..."
mypy --strict --ignore-missing-imports src
uv run mypy --strict --ignore-missing-imports src
@echo ""
@echo "🧪 Step 3: Running comprehensive tests..."
python3 scripts/test_config.py full
uv run python scripts/test_config.py full
@echo ""
@echo "✨ Auto-fixing pipeline completed!"

## Dependency Management (uv native commands)
sync:
@echo "⚡ Syncing dependencies from lock file..."
uv sync

lock:
@echo "🔒 Generating lock file with exact versions..."
uv lock

update:
@echo "⬆️ Updating dependencies to latest compatible versions..."
uv lock --upgrade

add:
@echo "➕ Adding dependency: $(PKG)"
uv add $(PKG)

remove:
@echo "➖ Removing dependency: $(PKG)"
uv remove $(PKG)

deps-check:
@echo "🔍 Checking for dependency conflicts..."
uv pip check

## Development Utilities (uv powered)
shell:
@echo "🐚 Opening shell with project dependencies..."
uv shell

run:
@echo "🚀 Running toady CLI in development mode..."
uv run toady $(ARGS)

## Maintenance (Enhanced)
clean:
@echo "🧹 Cleaning build artifacts and cache..."
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
Expand All @@ -115,8 +173,10 @@ clean:
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
rm -rf test-reports/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete

build: clean
python -m build
@echo "📦 Building distribution packages..."
uv build
1 change: 1 addition & 0 deletions coverage.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions coverage_unit.json

Large diffs are not rendered by default.

Loading
Loading