.PHONY: check cram FORCE

cram:
	uv run pytest tests/test_cram.py

# Re-record the TUI tour docs/tour.md embeds. Needs podman, and a GPU unless
# ARGS="--cpu"; CI has neither, so the cast is committed rather than built
# there. `make tour ARGS=--no-build` reuses the fixture image.
tour: FORCE
	uv run python scripts/tour.py $(ARGS)

test-matrix:
	uv run tox

check:
	uv run pre-commit run --all-files

cov:
	@rm -rf .coverage .coverage.*
	PYTHONUNBUFFERED=1 COVERAGE_PROCESS_START=$(shell pwd)/pyproject.toml COVERAGE_FILE=$(shell pwd)/.coverage uv run pytest

cov-report:
	COVERAGE_FILE=$(shell pwd)/.coverage uv run coverage combine --rcfile $(shell pwd)/pyproject.toml -a -q || true
	COVERAGE_FILE=$(shell pwd)/.coverage uv run coverage html -d cov --rcfile $(shell pwd)/pyproject.toml
	COVERAGE_FILE=$(shell pwd)/.coverage uv run coverage report
