-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (62 loc) · 2.04 KB
/
Makefile
File metadata and controls
81 lines (62 loc) · 2.04 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.PHONY: help install dev test lint format clean docker-up docker-down migrate
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install: ## Install dependencies
pip install -r requirements/dev.txt
dev: ## Run development server
python main.py
test: ## Run tests
pytest
test-cov: ## Run tests with coverage
pytest --cov=app --cov-report=html
lint: ## Run linting
flake8 app/ tests/
mypy app/
format: ## Format code
black app/ tests/
isort app/ tests/
format-check: ## Check code formatting
black --check app/ tests/
isort --check-only app/ tests/
clean: ## Clean up temporary files
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov/
rm -rf dist/
rm -rf build/
docker-up: ## Start Docker services
docker-compose up -d
docker-down: ## Stop Docker services
docker-compose down
docker-logs: ## View Docker logs
docker-compose logs -f
migrate: ## Run database migrations
alembic upgrade head
migrate-create: ## Create new migration
@read -p "Enter migration message: " msg; \
alembic revision --autogenerate -m "$$msg"
db-reset: ## Reset database (WARNING: This will delete all data)
docker-compose down -v
docker-compose up -d postgres
sleep 5
alembic upgrade head
pre-commit: ## Install pre-commit hooks
pre-commit install
pre-commit-run: ## Run pre-commit hooks on all files
pre-commit run --all-files
docs: ## Generate API documentation
@echo "API documentation available at:"
@echo " Swagger UI: http://localhost:8000/docs"
@echo " ReDoc: http://localhost:8000/redoc"
setup: install pre-commit ## Complete setup for development
@echo "Development environment setup complete!"
@echo "Don't forget to:"
@echo " 1. Copy .env.example to .env and configure it"
@echo " 2. Set up your database"
@echo " 3. Run 'make migrate' to set up database schema"