-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (61 loc) · 2.5 KB
/
Copy pathMakefile
File metadata and controls
80 lines (61 loc) · 2.5 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
# Makefile for audiobook-dev project
.PHONY: help install install-dev install-audible test test-fast test-integration lint lint-fix format format-check type-check clean run pre-commit ci
AUDIBLE_GIT_REF := 458131b4702cca48a8a6eb68c19c21b91b276d37
AUDIBLE_PIP_SPEC := git+https://github.com/mkb79/Audible.git@$(AUDIBLE_GIT_REF)
help:
@echo "Available commands:"
@echo " make install - Install production dependencies"
@echo " make install-dev - Install development dependencies"
@echo " make install-audible - Install mkb79/Audible from GitHub"
@echo " make test - Run tests with coverage"
@echo " make test-fast - Run tests without coverage"
@echo " make test-integration - Run integration tests only"
@echo " make lint - Run ruff linter"
@echo " make format - Format code with ruff"
@echo " make type-check - Run mypy type checking"
@echo " make pre-commit - Run pre-commit hooks on all files"
@echo " make clean - Clean cache and build files"
@echo " make run - Run the application"
@echo " make ci - Run all CI checks locally (pre-commit + tests)"
install:
pip install -r requirements.txt
$(MAKE) install-audible
install-dev:
pip install -r requirements.txt
$(MAKE) install-audible
pip install -e ".[dev]"
pre-commit install
install-audible:
pip install --force-reinstall --no-deps "$(AUDIBLE_PIP_SPEC)"
test:
pytest --cov=src --cov-branch --cov-report=term-missing --cov-report=html --cov-fail-under=50 -v
test-fast:
pytest -v
test-integration:
pytest -v -m integration
lint:
ruff check src/ tests/
lint-fix:
ruff check --fix src/ tests/
format:
ruff format src/ tests/
format-check:
ruff format --check src/ tests/
type-check:
mypy src/ --ignore-missing-imports
pre-commit:
pre-commit run --all-files
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "htmlcov" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name ".coverage" -delete 2>/dev/null || true
find . -type f -name "coverage.xml" -delete 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
run:
python -m uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
ci: pre-commit test
@echo "✅ All CI checks passed!"
.DEFAULT_GOAL := help