-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (36 loc) · 1.35 KB
/
Makefile
File metadata and controls
49 lines (36 loc) · 1.35 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
CLIENT ?= partacademy
VENV := .venv
PY := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
.PHONY: venv install help cli clients show validate reports test test-fast check
venv:
python3 -m venv $(VENV)
install: venv
$(PIP) install -U pip
$(PIP) install -r requirements.txt
help: install
$(PY) -m app.cli --help
cli: help
clients: install
$(PY) -m app.cli clients
show: install
$(PY) -m app.cli show $(CLIENT)
validate: install
$(PY) -m app.cli validate $(CLIENT)
# Generate reports for a client (requires P1_START, P1_END, P2_START, P2_END)
# Example: make reports CLIENT=partacademy P1_START=2024-12-01 P1_END=2024-12-31 P2_START=2025-12-01 P2_END=2025-12-31
reports: install
@if [ -z "$(P1_START)" ] || [ -z "$(P1_END)" ] || [ -z "$(P2_START)" ] || [ -z "$(P2_END)" ]; then \
echo "Error: P1_START, P1_END, P2_START, P2_END must be set"; \
echo "Example: make reports CLIENT=partacademy P1_START=2024-12-01 P1_END=2024-12-31 P2_START=2025-12-01 P2_END=2025-12-31"; \
exit 1; \
fi
$(PY) -m app.cli analyze-sources $(CLIENT) $(P1_START) $(P1_END) $(P2_START) $(P2_END) --refresh
$(PY) -m app.cli analyze-pages $(CLIENT) $(P1_START) $(P1_END) $(P2_START) $(P2_END) --refresh
@echo "Reports generated in data_cache/$(CLIENT)/"
test: install
$(PY) -m pytest tests/ -v
test-fast: install
$(PY) -m pytest tests -q
check: test-fast
$(PY) -m app.cli --help