-include ~/bin/generic.mk

.PHONY: build check publish-test publish clean

##
## Run tests
f2: testurl = https://alcm-b@bitbucket.org/alcm-b/refclone.git
f2:
	pyflakes ./refclone/ && py.test-3 --capture=no --verbose && \
	refclone $(testurl) --repohome=$$(mktemp -d /tmp/refclone/f2-XXX)

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

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

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

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

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