-
-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (62 loc) · 2.57 KB
/
Makefile
File metadata and controls
78 lines (62 loc) · 2.57 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
.PHONY: help install dev-install setup-hooks format lint type-check security test test-api test-cli test-cov clean run ci-check openapi
help:
@echo "Available commands:"
@echo " make install - Install production dependencies"
@echo " make dev-install - Install all dependencies + git hooks"
@echo " make setup-hooks - Reinstall git hooks (if needed)"
@echo " make format - Format code with ruff"
@echo " make lint - Lint code with ruff"
@echo " make type-check - Run ty type checking"
@echo " make security - Run security checks with bandit"
@echo " make test - Run all tests"
@echo " make test-api - Run aegra-api tests only"
@echo " make test-cli - Run aegra-cli tests only"
@echo " make test-cov - Run tests with coverage"
@echo " make openapi - Regenerate docs/openapi.json from code"
@echo " make ci-check - Run all CI checks locally"
@echo " make clean - Clean cache files"
@echo " make run - Run the server"
install:
uv sync --all-packages --no-dev
dev-install:
uv sync --all-packages
@uv run pre-commit install
@uv run pre-commit install --hook-type commit-msg
@echo ""
@echo "Done! Dependencies installed and git hooks set up."
setup-hooks:
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
@echo ""
@echo "Git hooks reinstalled!"
format:
uv run ruff format .
uv run ruff check --fix .
lint:
uv run ruff check .
type-check:
uv run ty check libs/aegra-api/src/ libs/aegra-cli/src/
security:
uv run bandit -c pyproject.toml -r libs/aegra-api/src/ libs/aegra-cli/src/
test: test-api test-cli
test-api:
uv run --package aegra-api pytest libs/aegra-api/tests/
test-cli:
uv run --package aegra-cli pytest libs/aegra-cli/tests/
test-cov:
uv run --package aegra-api pytest libs/aegra-api/tests/ --cov=libs/aegra-api/src --cov-report=html --cov-report=term
uv run --package aegra-cli pytest libs/aegra-cli/tests/ --cov=libs/aegra-cli/src --cov-report=term
openapi:
uv run --package aegra-api python scripts/export_openapi.py
ci-check: format lint
-uv run ty check libs/aegra-api/src/ libs/aegra-cli/src/
-uv run bandit -c pyproject.toml -r libs/aegra-api/src/ libs/aegra-cli/src/
$(MAKE) test
@echo ""
@echo "All CI checks completed! (ty and bandit are non-blocking)"
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
rm -rf .pytest_cache .ty_cache .ruff_cache htmlcov 2>/dev/null || true
run:
uv run --package aegra-api uvicorn aegra_api.main:app --reload