.PHONY: setup run lint test clean

VENV := .venv
PIP := $(VENV)/bin/pip
PY := $(VENV)/bin/python

setup: $(VENV)/bin/activate

$(VENV)/bin/activate:
	python3 -m venv $(VENV)
	$(PIP) install --upgrade pip
	$(PIP) install -e ".[dev]"

run: setup
	$(PY) -m tuimble

lint: setup
	$(VENV)/bin/ruff check src/ tests/
	$(VENV)/bin/ruff format --check src/ tests/

test: setup
	$(VENV)/bin/pytest -v

clean:
	rm -rf $(VENV) dist build *.egg-info .pytest_cache .ruff_cache
	find . -type d -name __pycache__ -exec rm -rf {} +
