.PHONY: help install test lint format build clean publish-test publish

help:
	@echo "install       environnement de développement"
	@echo "test          suite de tests avec couverture"
	@echo "lint          flake8 + vérification du format"
	@echo "format        applique black"
	@echo "build         construit sdist et wheel"
	@echo "publish-test  publie sur TestPyPI"
	@echo "publish       publie sur PyPI"
	@echo "clean         supprime les artefacts de build"

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

test:
	pytest --cov=moore_g2p --cov-report=term-missing

lint:
	flake8 moore_g2p tests
	black --check moore_g2p tests

format:
	black moore_g2p tests

build: clean
	python -m build
	twine check dist/*

publish-test: build
	twine upload --repository testpypi dist/*

publish: build
	twine upload dist/*

clean:
	rm -rf build dist *.egg-info .pytest_cache .coverage htmlcov
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
