-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathMakefile
More file actions
118 lines (92 loc) · 3.71 KB
/
Copy pathMakefile
File metadata and controls
118 lines (92 loc) · 3.71 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Makefile for Execra project
# Centralises common commands for developers and contributors
# Variables
PYTHON = python
PIP = pip
UVICORN = uvicorn
PYTEST = pytest
DOCKER_COMPOSE = docker-compose
.DEFAULT_GOAL := help
.PHONY: help install dev test test-unit test-integration coverage lint format docs models health docker-up docker-down eval eval-compare eval-full clean
# Default target: show help
help:
@echo "Execra Management Commands:"
@echo " make install Install dependencies"
@echo " make dev Run the development server"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests"
@echo " make test-integration Run integration tests"
@echo " make coverage Run tests and generate coverage report"
@echo " make lint Run linting checks (flake8, mypy)"
@echo " make format Format code (black, isort)"
@echo " make docs Serve documentation"
@echo " make models Download required models"
@echo " make health Run system health check"
@echo " make docker-up Start services with Docker Compose"
@echo " make docker-down Stop Docker Compose services"
@echo " make clean Remove temporary files and caches"
@echo " make eval-full Runs evaluator and Baseline comaprison with reports"
@echo " make eval Runs evaluator with evaluation report"
@echo " make eval-compare Runs Baseline comaprison with baseline reports"
# Prerequisite: requirements.txt and requirements-dev.txt must exist
install:
$(PIP) install -r requirements.txt -r requirements-dev.txt
# Prerequisite: api/main.py must exist
dev:
$(UVICORN) api.main:app --reload --host 0.0.0.0 --port 8000
# Prerequisite: tests/ directory must exist
test:
$(PYTHON) -m $(PYTEST) tests/ -v
# Prerequisite: tests/unit/ directory must exist
test-unit:
$(PYTHON) -m $(PYTEST) tests/unit/ -v
# Prerequisite: tests/integration/ directory must exist
test-integration:
$(PYTHON) -m $(PYTEST) tests/integration/ -v
# Prerequisite: core/ and api/ directories must exist
coverage:
$(PYTHON) -m $(PYTEST) --cov=core --cov=api --cov-report=html
# Prerequisite: core/ and api/ directories must exist; flake8 and mypy installed
lint:
flake8 core/ api/ && mypy core/ api/
# Prerequisite: core/, api/, and tests/ directories must exist; black and isort installed
format:
black core/ api/ tests/ && isort core/ api/ tests/
# Prerequisite: mkdocs.yml must exist
docs:
mkdocs serve
# Prerequisite: scripts/download_models.py must exist
models:
$(PYTHON) scripts/download_models.py
# Prerequisite: scripts/health_check.py must exist
health:
$(PYTHON) scripts/health_check.py
# Prerequisite: docker-compose.yml must exist
docker-up:
$(DOCKER_COMPOSE) up --build -d
# Prerequisite: Docker Compose services must be running
docker-down:
$(DOCKER_COMPOSE) down
RESULTS_DIR = research/results
# Ensure results directory exists
$(RESULTS_DIR):
python -c "import os; os.makedirs('$(RESULTS_DIR)', exist_ok=True)"
eval: $(RESULTS_DIR)
python -m research.eval.evaluator \
--dataset research/eval/eval_dataset.json \
--output $(RESULTS_DIR)/eval_report.json
eval-compare: $(RESULTS_DIR)
python -m research.eval.compare_baselines \
--dataset research/eval/eval_dataset.json \
--output $(RESULTS_DIR)/baseline_report.json
eval-full: $(RESULTS_DIR)
python -m research.eval.evaluator \
--dataset research/eval/eval_dataset.json \
--output $(RESULTS_DIR)/eval_report.json
python -m research.eval.compare_baselines \
--dataset research/eval/eval_dataset.json \
--output $(RESULTS_DIR)/baseline_report.json
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
rm -rf .pytest_cache htmlcov/ logs/
rm -rf $(RESULTS_DIR)