-include ~/bin/generic.mk

.PHONY: test test-all build check publish-test publish clean

## Run lint and unit tests for Python 3.11
test:
	tox

## Run lint and unit tests for all supported Python versions (pre-publish)
test-all:
	tox -e lint,py311,py312,py313,py314

## Build source distribution and wheel
build: clean
	python -m build .

## Validate distribution artifacts
check:
	python -m twine check dist/*

## Upload to TestPyPI
publish-test: test-all build check
	python -m twine upload --repository testpypi dist/*

## Upload to PyPI
publish: test-all build check
	python -m twine upload dist/*

## Remove build artifacts
clean:
	rm -rf dist/ build/ src/*.egg-info
