.PHONY: install test lint format benchmark clean help

help:  ## Show this help message
	@python -c "import re; [print(f'\033[36m{m[0]:<15}\033[0m {m[1]}') for m in sorted([re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line).groups() for line in open('$(MAKEFILE_LIST)') if re.match(r'^[a-zA-Z_-]+:.*?## .*$$', line)])]"

install: ## Install dependencies and pre-commit
	pip install -e ".[dev]"
	pre-commit install

test: ## Run tests with coverage
	pytest tests/ -v --cov=arnio --cov-report=term-missing

lint: ## Check linting
	ruff check .
	black --check .

format: ## Format code
	black .
	ruff check --fix .

benchmark: ## Run benchmarks
	python benchmarks/generate_data.py
	python benchmarks/benchmark_vs_pandas.py

clean: ## Remove build artifacts
	python -c "import shutil, os, glob; [shutil.rmtree(p, ignore_errors=True) for p in ['dist', 'build', '.pytest_cache'] + glob.glob('*.egg-info') + glob.glob('**/__pycache__', recursive=True)]; [os.remove(f) for f in glob.glob('**/*.pyc', recursive=True)]"
