install:  ## installer les dépendances
	uv sync
	uv run pre-commit install
.PHONY: build

build: locales ## construire le package
	uv build -f dist
.PHONY: build

publish:build ## publier le package sur pypi.org
	uv publish
.PHONY: publish

format: ## Formatage des sources avec Ruff et Prettier
	uv run ruff check --fix
	uv run ruff format ./
.PHONY: format

locales:  ## Generate Gettext files
	@uv run python manage.py makemessages --ignore .venv --ignore "*.txt" --ignore dist --ignore manage.py --locale=en --no-wrap
	@sed -i.bak '/#, fuzzy/d' 	modshib/locale/en/LC_MESSAGES/django.po && rm modshib/locale/en/LC_MESSAGES/django.po.bak
	@echo "Compiling translation files"
	@uv run python manage.py compilemessages -v 0
.PHONY: locales

help: ## Montrer cette aide
	@echo "\nChoisissez une commande. Les choix sont:\n"
	@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[0;36m%-12s\033[m %s\n", $$1, $$2}'
	@echo ""
.PHONY: help
