.PHONY: help clean install install-dev test lint format type-check build upload upload-test

help:
	@echo "Available commands:"
	@echo "  make install         Install the package locally"
	@echo "  make install-dev     Install with development dependencies"
	@echo "  make test            Run tests"
	@echo "  make test-coverage   Run tests and generate HTML coverage report"
	@echo "  make test-verbose    Run tests with verbose output"
	@echo "  make lint            Run linting"
	@echo "  make format          Format code with black"
	@echo "  make type-check      Run type checking with mypy"
	@echo "  make build           Build distribution packages"
	@echo "  make upload-test     Upload to TestPyPI"
	@echo "  make upload          Upload to PyPI"
	@echo "  make clean           Clean build artifacts"

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

install:
	pip install -e .

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

test:
	pytest

test-coverage:
	pytest --cov-report=html
	@echo "Coverage report generated in htmlcov/index.html"

test-verbose:
	pytest -vv

lint:
	flake8 cloud_seeder/ tests/ --max-line-length=100

format:
	black cloud_seeder/ tests/

type-check:
	mypy cloud_seeder/

build: clean
	python -m build

upload-test: build
	python -m twine upload --repository testpypi dist/*

upload: build
	python -m twine upload dist/*