-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (60 loc) · 2.02 KB
/
Makefile
File metadata and controls
79 lines (60 loc) · 2.02 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
.PHONY: help install test lint format clean docker-build docker-run docker-compose-up docker-compose-down
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.txt
install-dev: ## Install development dependencies
pip install -r requirements.txt
pip install black isort flake8 mypy
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 cache and temporary files
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
rm -rf htmlcov/
rm -rf .coverage
run: ## Run the application
uvicorn main:app --reload --host 0.0.0.0 --port 8000
run-prod: ## Run the application in production mode
uvicorn main:app --host 0.0.0.0 --port 8000
docker-build: ## Build Docker image
docker build -t fastapi-template .
docker-run: ## Run Docker container
docker run -p 8000:8000 --env-file .env fastapi-template
docker-compose-up: ## Start services with Docker Compose
docker-compose up -d
docker-compose-down: ## Stop services with Docker Compose
docker-compose down
docker-compose-logs: ## View Docker Compose logs
docker-compose logs -f
setup: ## Initial setup
cp env.example .env
@echo "Please edit .env file with your configuration"
@echo "Then run: make install"
dev: ## Development setup
make install-dev
make format
make test
ci: ## Continuous integration checks
make format-check
make lint
make test-cov