Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
51 lines (37 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.PHONY: help install install-dev run test test-cov lint format type-check pre-commit clean
.DEFAULT_GOAL := help
help: ## Show this help message
@echo 'GoiasData-API - Development Commands'
@echo ''
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install production dependencies
pip install -r requirements.txt
install-dev: ## Install development dependencies
pip install -e ".[dev]"
pre-commit install
run: ## Run the API server
uvicorn app.main:app --reload
run-prod: ## Run the API server in production mode
uvicorn app.main:app --host 0.0.0.0 --port 8000
test: ## Run tests
pytest
test-cov: ## Run tests with coverage report
pytest --cov=app --cov-report=html --cov-report=term-missing
lint: ## Run linters (ruff)
ruff check app tests
format: ## Format code with black and ruff
ruff format app tests
ruff check --fix app tests
type-check: ## Run type checker (mypy)
mypy app
pre-commit: ## Run pre-commit hooks
pre-commit run --all-files
clean: ## Clean up cache and build artifacts
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name htmlcov -exec rm -rf {} + 2>/dev/null || true
find . -type f -name .coverage -delete
dev-setup: install-dev ## Complete development setup
@echo "✓ Development environment ready!"