.PHONY: help install test lint format clean migrate

help:
	@echo "POTE Development Commands"
	@echo "========================="
	@echo "install    Install dependencies in venv"
	@echo "test       Run tests with pytest"
	@echo "lint       Run linters (ruff, mypy)"
	@echo "format     Auto-format code (black, ruff)"
	@echo "migrate    Run Alembic migrations"
	@echo "clean      Remove build artifacts and cache files"

install:
	python3 -m venv venv
	./venv/bin/pip install --upgrade pip
	./venv/bin/pip install -e ".[dev,analytics]"

test:
	./venv/bin/pytest tests/ -v --cov=pote --cov-report=term-missing

lint:
	./venv/bin/ruff check src/ tests/
	./venv/bin/mypy src/

format:
	./venv/bin/black src/ tests/
	./venv/bin/ruff check --fix src/ tests/

migrate:
	./venv/bin/alembic upgrade head

clean:
	rm -rf build/ dist/ *.egg-info .pytest_cache/ .coverage htmlcov/
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name '*.pyc' -delete

