-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (47 loc) · 2.36 KB
/
Makefile
File metadata and controls
69 lines (47 loc) · 2.36 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
# Makefile — GigaAM ASR development commands.
# `make pre-commit` runs AFTER EVERY TASK and must be green.
# This is a Makefile target, not the pre-commit tool.
HOST ?= 0.0.0.0
PORT ?= 8000
IMAGE ?= gigaam-api:latest
.PHONY: install run download-weights-local lint format format-check typecheck test test-integration coverage check pre-commit clean \
build-docker up down logs download-weights
install: ## Install dependencies (uv sync)
uv sync
run: ## Local service run (uvicorn --reload)
uv run uvicorn gigaam_api.main:app --host $(HOST) --port $(PORT) --reload
download-weights-local: ## Warm up weights natively (uv, no Docker) into MODELS_DIR from .env
uv run python -m gigaam_api.download_weights
lint: ## ruff check
uv run ruff check .
format: ## ruff format (apply)
uv run ruff format .
format-check: ## ruff format --check
uv run ruff format --check .
typecheck: ## mypy (strict)
uv run mypy gigaam_api tests
test: ## Unit tests (no integration)
uv run pytest -m "not integration"
test-integration: ## Integration tests (real model/network). Exit code 5 ("no tests") is treated as success.
uv run pytest -m integration || [ $$? -eq 5 ]
coverage: ## Coverage report (no gate)
uv run pytest -m "not integration" --cov=gigaam_api --cov-report=term-missing
check: lint format-check typecheck test ## Fast loop: lint + format-check + mypy + unit
pre-commit: lint format-check typecheck test test-integration ## The whole batch of all test types in a row
clean: ## Remove tool caches
rm -rf .pytest_cache .mypy_cache .ruff_cache .coverage coverage.xml htmlcov
find . -type d -name __pycache__ -prune -exec rm -rf {} +
# --- Docker/deployment (stage 06) ---
# A convenience for development on Mac. In production, deployment goes through docker-compose.yml +
# `docker compose` (no make). The production image is linux/amd64 (built on Mac via
# emulation; native on an amd64 host).
build-docker: ## Build the production image (linux/amd64)
docker build --platform linux/amd64 -t $(IMAGE) .
up: ## docker compose up -d (start the service)
docker compose up -d
down: ## docker compose down (stop the service)
docker compose down
logs: ## docker compose logs -f (service logs)
docker compose logs -f
download-weights: ## Warm up weights into ./models (a one-off container, no service startup)
docker compose --profile tools run --rm download-weights