|
| 1 | +.PHONY: help install test test-unit test-integration test-integration-slow test-all lint lint-fix format format-check types clean |
| 2 | + |
| 3 | +# Default target |
| 4 | +help: |
| 5 | + @echo "Available commands:" |
| 6 | + @echo " install Install dependencies with uv" |
| 7 | + @echo " test-unit Run unit tests only (excludes integration tests)" |
| 8 | + @echo " test-integration Run integration tests without extra slow tests" |
| 9 | + @echo " test-integration-slow Run integration tests including extra slow tests" |
| 10 | + @echo " test-all Run all tests" |
| 11 | + @echo " lint Run ruff check" |
| 12 | + @echo " lint-fix Run ruff check with --fix" |
| 13 | + @echo " format Run ruff format" |
| 14 | + @echo " format-check Run ruff format with --check" |
| 15 | + @echo " types Run mypy type checking" |
| 16 | + @echo " clean Clean up cache files" |
| 17 | + |
| 18 | +# Install dependencies |
| 19 | +install: |
| 20 | + uv sync --locked --all-extras --dev |
| 21 | + |
| 22 | +# Test commands |
| 23 | +test-unit: |
| 24 | + uv run --dev pytest -m "not integration" |
| 25 | + |
| 26 | +test-integration: |
| 27 | + uv run --dev pytest -m "integration and not extra_slow" |
| 28 | + |
| 29 | +test-integration-slow: |
| 30 | + uv run --dev pytest -m "integration" |
| 31 | + |
| 32 | +test-all: |
| 33 | + uv run --dev pytest |
| 34 | + |
| 35 | +# Shorthand for test-unit (most common use case) |
| 36 | +test: test-unit |
| 37 | + |
| 38 | +# Linting commands |
| 39 | +lint: |
| 40 | + uv run ruff check |
| 41 | + |
| 42 | +lint-fix: |
| 43 | + uv run ruff check --fix |
| 44 | + |
| 45 | +# Formatting commands |
| 46 | +format: |
| 47 | + uv run ruff format |
| 48 | + |
| 49 | +format-check: |
| 50 | + uv run ruff format --check |
| 51 | + |
| 52 | +# Type checking |
| 53 | +types: |
| 54 | + uv run mypy src/ test/ |
| 55 | + |
| 56 | +# Clean up |
| 57 | +clean: |
| 58 | + find . -type f -name "*.pyc" -delete |
| 59 | + find . -type d -name "__pycache__" -delete |
| 60 | + find . -type d -name ".pytest_cache" -exec rm -rf {} + |
| 61 | + find . -type d -name ".mypy_cache" -exec rm -rf {} + |
| 62 | + find . -type d -name ".ruff_cache" -exec rm -rf {} + |
0 commit comments