-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 947 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 947 Bytes
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
BIND_PORT ?= 8000
BIND_HOST ?= localhost
.PHONY: help
help: ## Print this help message
grep -E '^[\.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.env: ## Ensure there is env file or create one
echo "No .env file found. Want to create it from .env.example? [y/n]" && read answer && if [ $${answer:-'N'} = 'y' ]; then cp .env.example .env;fi
.PHONY: local-setup
local-setup: ## Setup local postgres database
docker compose up -d
.PHONY: up
up: local-setup ## Run FastAPI development server
uv run alembic upgrade head
uv run uvicorn app.main:app --reload --host $(BIND_HOST) --port $(BIND_PORT)
.PHONY: run
run: up ## Alias for `up`
.PHONY: down
down: ## Stop database
docker compose down
.PHONY: test
test: local-setup ## Run unit tests
uv run pytest .
.PHONY: lint
lint: local-setup ## Run all linters
uv run pre-commit run -a
uv run mypy .