-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
74 lines (55 loc) · 2.08 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
.PHONY: dev up test openapi run lint export-sample demo
dev:
cd apps/action-engine-api && python -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt && uvicorn app.main:app --reload
up:
docker compose -f infra/compose.yaml up --build
test:
pytest -q
openapi:
cd apps/action-engine-api && uv run python scripts/generate_openapi.py
# ===== UV workflow =====
.PHONY: deps-uv dev-uv lock-uv sync-uv
VENV_DIR := apps/action-engine-api/.venv
VENV_PY := $(VENV_DIR)/bin/python
# 只有當 .venv 不在時才建立
$(VENV_PY):
cd apps/action-engine-api && uv venv --python 3.14
deps-uv: $(VENV_PY)
cd apps/action-engine-api && uv pip install -r requirements.txt
lock-uv:
cd apps/action-engine-api && uv pip compile requirements.in -o requirements.txt --generate-hashes
sync-uv: $(VENV_PY)
cd apps/action-engine-api && uv pip sync requirements.txt
dev-uv: deps-uv
cd apps/action-engine-api && uv run uvicorn app.main:app --reload --http h11 --loop asyncio
# ===== 新增目標 =====
run: dev-uv
test:
cd apps/action-engine-api && uv run pytest -q
export-sample:
curl -s -X POST http://127.0.0.1:8000/actions/export?format=csv \
-H "Content-Type: application/json" \
-d '{"shop_type": "drink_shop", "drivers": ["rain_up"]}' \
-o actions_export.csv
lint:
cd apps/action-engine-api && uv run ruff check .
fmt:
cd apps/action-engine-api && uv run ruff check . --fix && uv run black .
typecheck:
cd apps/action-engine-api && uv run mypy app
ci:
cd apps/action-engine-api && uv run ruff check .
cd apps/action-engine-api && uv run black --check .
cd apps/action-engine-api && uv run mypy app
cd apps/action-engine-api && uv run coverage run -m pytest -q
cd apps/action-engine-api && uv run coverage report --fail-under 70
demo:
@echo "🚀 Running LocalPulse Action Engine Demo..."
@echo "Make sure the service is running with 'make run' first"
@echo ""
bash scripts/demo.sh $(BASE_URL)
demo-smoke:
@echo "🔥 Running LocalPulse Demo Smoke Test..."
@echo "Starting local server and running automated tests"
@echo ""
cd apps/action-engine-api && bash scripts/demo_smoke.sh