|
| 1 | +.PHONY: help test test-coverage test-fast lint format clean install dev-install |
| 2 | + |
| 3 | +help: ## Show this help message |
| 4 | + @echo "Available commands:" |
| 5 | + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
| 6 | + |
| 7 | +install: ## Install the package |
| 8 | + uv sync |
| 9 | + |
| 10 | +dev-install: ## Install development dependencies |
| 11 | + uv sync --group dev |
| 12 | + |
| 13 | +test: ## Run tests |
| 14 | + uv run pytest |
| 15 | + |
| 16 | +test-fast: ## Run tests in parallel |
| 17 | + uv run pytest -n auto |
| 18 | + |
| 19 | +test-coverage: ## Run tests with coverage |
| 20 | + @echo "🧪 Running tests with coverage..." |
| 21 | + uv run pytest \ |
| 22 | + --cov=src/stac_auth_proxy \ |
| 23 | + --cov-report=term-missing \ |
| 24 | + --cov-report=html \ |
| 25 | + --cov-report=xml \ |
| 26 | + --cov-fail-under=85 \ |
| 27 | + -v |
| 28 | + @echo "✅ Coverage report generated!" |
| 29 | + @echo "📊 HTML report available at: htmlcov/index.html" |
| 30 | + @echo "📄 XML report available at: coverage.xml" |
| 31 | + @if [ "$(CI)" = "true" ]; then \ |
| 32 | + echo "🚀 Running in CI environment"; \ |
| 33 | + else \ |
| 34 | + echo "💻 Running locally - opening HTML report..."; \ |
| 35 | + if command -v open >/dev/null 2>&1; then \ |
| 36 | + open htmlcov/index.html; \ |
| 37 | + elif command -v xdg-open >/dev/null 2>&1; then \ |
| 38 | + xdg-open htmlcov/index.html; \ |
| 39 | + else \ |
| 40 | + echo "Please open htmlcov/index.html in your browser to view the coverage report"; \ |
| 41 | + fi; \ |
| 42 | + fi |
| 43 | + |
| 44 | +lint: ## Run linting |
| 45 | + uv run pre-commit run ruff-check --all-files |
| 46 | + uv run pre-commit run mypy --all-files |
| 47 | + |
| 48 | +format: ## Format code |
| 49 | + uv run pre-commit run ruff-format --all-files |
| 50 | + |
| 51 | +clean: ## Clean up generated files |
| 52 | + rm -rf htmlcov/ |
| 53 | + rm -rf .coverage |
| 54 | + rm -rf coverage.xml |
| 55 | + rm -rf .pytest_cache/ |
| 56 | + rm -rf build/ |
| 57 | + rm -rf dist/ |
| 58 | + rm -rf *.egg-info/ |
| 59 | + find . -type d -name __pycache__ -delete |
| 60 | + find . -type f -name "*.pyc" -delete |
| 61 | + |
| 62 | +ci: ## Run CI checks locally |
| 63 | + uv run pre-commit run --all-files |
| 64 | + @echo "🧪 Running tests with coverage..." |
| 65 | + uv run pytest \ |
| 66 | + --cov=src/stac_auth_proxy \ |
| 67 | + --cov-report=term-missing \ |
| 68 | + --cov-report=html \ |
| 69 | + --cov-report=xml \ |
| 70 | + --cov-fail-under=85 \ |
| 71 | + -v |
| 72 | + @echo "✅ CI checks completed!" |
0 commit comments