PYTHON ?= python
SOURCE ?= ../reference/nycflights13
STATE ?= state/pipeline.sqlite
OUTPUT ?= output
RULES ?= quality/rules.yaml
REPORT ?= evidence/validation_report.json
HOST ?= 127.0.0.1
PORT ?= 8000

.PHONY: rebuild test validate evidence dashboard clean

rebuild:
	rm -rf $(OUTPUT) state
	$(PYTHON) -m airlife_etl ingest --source $(SOURCE) --state $(STATE) --output $(OUTPUT) --months all

test:
	$(PYTHON) -m pytest -q

validate:
	$(PYTHON) -m airlife_etl validate --state $(STATE) --dataset $(OUTPUT)/flights.parquet --rules $(RULES) --report $(REPORT)

evidence:
	$(PYTHON) scripts/build_evidence.py

dashboard:
	$(PYTHON) -m airlife_etl dashboard --state $(STATE) --host $(HOST) --port $(PORT)

clean:
	rm -rf $(OUTPUT) state evidence .pytest_cache
