-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (78 loc) · 2.88 KB
/
Makefile
File metadata and controls
97 lines (78 loc) · 2.88 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: help test test-unit test-integration test-cov test-fast lint format clean install dev-install
# Default target
help:
@echo "AI Knowledge Assistant - Development Commands"
@echo ""
@echo "Testing:"
@echo " make test - Run all tests"
@echo " make test-unit - Run unit tests only"
@echo " make test-integration - Run integration tests only"
@echo " make test-cov - Run tests with coverage report"
@echo " make test-fast - Run tests in parallel"
@echo " make test-verbose - Run tests with verbose output"
@echo ""
@echo "Code Quality:"
@echo " make lint - Run linters (ruff, mypy)"
@echo " make format - Format code (black, ruff)"
@echo " make check - Run all quality checks"
@echo ""
@echo "Setup:"
@echo " make install - Install production dependencies"
@echo " make dev-install - Install dev dependencies"
@echo " make clean - Clean temporary files"
@echo ""
@echo "Docker:"
@echo " make docker-build - Build Docker images"
@echo " make docker-up - Start Docker services"
@echo " make docker-down - Stop Docker services"
@echo " make docker-logs - View Docker logs"
@echo " make docker-restart - Restart API service"
# Testing
test:
uv run pytest
test-unit:
uv run pytest -m unit
test-integration:
uv run pytest -m integration
test-cov:
uv run pytest --cov=src/app --cov-report=html --cov-report=term-missing
test-fast:
uv run pytest -n auto
test-verbose:
uv run pytest -vv
# Code Quality
lint:
uv run ruff check src/ tests/
uv run mypy src/
format:
uv run black src/ tests/
uv run ruff check --fix src/ tests/
check: format lint test
# Setup
install:
uv sync --no-dev
dev-install:
uv sync
clean:
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '__pycache__' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '*.egg-info' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '.pytest_cache' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '.ruff_cache' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '.mypy_cache' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter 'htmlcov' | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Recurse -File -Filter '*.pyc' | Remove-Item -Force"
powershell -Command "if (Test-Path .coverage) { Remove-Item .coverage -Force }"
# Docker
docker-build:
docker-compose build
docker-up:
docker-compose up -d
docker-down:
docker-compose down
docker-logs:
docker-compose logs -f api
docker-restart:
docker-compose restart api
docker-clean:
docker-compose down -v
docker system prune -f