-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (62 loc) · 2.09 KB
/
Copy pathMakefile
File metadata and controls
82 lines (62 loc) · 2.09 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
.PHONY: dev fmt lint typecheck test test-unit test-integration migrate seed seed-edgar eval bench bench-eval bench-regress clean install
PY ?= python3
VENV ?= .venv
BIN := $(VENV)/bin
install:
$(PY) -m venv $(VENV)
$(BIN)/pip install -U pip wheel setuptools
$(BIN)/pip install -e ".[dev]"
dev:
$(BIN)/uvicorn lexscribe_api.main:app --reload --port 8080
fmt:
$(BIN)/ruff check --fix .
$(BIN)/black .
lint:
$(BIN)/ruff check .
$(BIN)/black --check .
typecheck:
$(BIN)/mypy packages/shared/lexscribe_shared packages/retrieval/lexscribe_retrieval
test: test-unit
test-unit:
$(BIN)/pytest -m "not integration and not contract" -q
test-integration:
RUN_INTEGRATION=1 $(BIN)/pytest -m integration -q
test-contract:
$(BIN)/pytest -m contract -q
migrate:
$(BIN)/alembic upgrade head
migrate-down:
$(BIN)/alembic downgrade base
seed:
$(BIN)/python scripts/seed.py
seed-edgar:
$(BIN)/python scripts/seed_edgar.py
eval:
$(BIN)/lexscribe eval run --suite mna_v1 --provider fake --output runs/local-$(shell date +%s).json
SCALE ?= small
bench:
mkdir -p bench/results
$(BIN)/python bench/bench.py --scale $(SCALE)
bench-legacy:
bash bench.sh
bench-eval:
mkdir -p eval/runs
$(BIN)/lexscribe eval run --suite mna_v1 --provider fake --output eval/runs/$(shell date -u +%Y%m%dT%H%M%SZ).json
# Compare a freshly produced bench JSON against a committed baseline.
# Override BASELINE/NEW on the command line, e.g.:
# make bench-regress BASELINE=bench/results/baseline_small.json NEW=bench/results/<run>.json
BASELINE ?= bench/results/baseline_$(SCALE).json
NEW ?=
THRESHOLD ?= 0.30
bench-regress:
@if [ -z "$(NEW)" ]; then \
echo "usage: make bench-regress BASELINE=<file> NEW=<file> [THRESHOLD=0.30]"; \
exit 2; \
fi
$(BIN)/python bench/regress.py --baseline $(BASELINE) --new $(NEW) --threshold $(THRESHOLD)
clean:
find . -type d -name __pycache__ -prune -exec rm -rf {} +
find . -type d -name .pytest_cache -prune -exec rm -rf {} +
find . -type d -name .mypy_cache -prune -exec rm -rf {} +
find . -type d -name .ruff_cache -prune -exec rm -rf {} +
find . -type d -name '*.egg-info' -prune -exec rm -rf {} +