PYPI_REPOSITORY_URL ?= https://upload.pypi.org/legacy/
PYPI_TOKEN ?= $(TOKEN)

.PHONY: clean build_package check_package publish test

clean:
	rm -rf dist build *.egg-info

build_package: clean
	uvx --from build pyproject-build --installer uv

check_package: build_package
	uvx twine check dist/*

publish: check_package
	uvx twine upload \
		--repository-url "$(PYPI_REPOSITORY_URL)" \
		--username __token__ \
		--password "$(PYPI_TOKEN)" \
		dist/* \
		--verbose

test:
	uv run pytest
