.PHONY: install lint test cov build artifacts serve render-demo publish-demo clean

install:
	python -m pip install -e ".[dev]"

lint:
	ruff check terra_incognita tests scripts

test:
	pytest -q -m "not network"

cov:
	pytest -q -m "not network" --cov=terra_incognita --cov-report=term-missing

build:
	python -m build

# Regenerate the task pack, baseline results and leaderboard data (deterministic).
artifacts:
	python scripts/build_artifacts.py

# Preview the leaderboard locally at http://localhost:8000/terra-incognita/
# (mirrors the /terra-incognita/ base path the demo is served under in production)
serve:
	rm -rf .demo-serve && mkdir -p .demo-serve/terra-incognita && cp -R leaderboard/. .demo-serve/terra-incognita/ && cd .demo-serve && python -m http.server 8000

# Re-render the README A/B replay GIF + PNG from the latest benchmark output (needs viz extra).
render-demo:
	python scripts/render_demo.py

# Publish the demo into the yodolabs.jp homepage app (serves /terra-incognita/).
publish-demo:
	scripts/publish_demo.sh

clean:
	rm -rf build dist *.egg-info .pytest_cache .ruff_cache .mypy_cache .coverage htmlcov
	find . -name __pycache__ -type d -prune -exec rm -rf {} +
