################################################################################
#                                 chameleon-rf                                 #
#               Client software for Chameleon Lite/Ultra devices               #
#                              (C) 2026-  Mischif                              #
#          Released under version 1 of the Server Side Public License          #
################################################################################

.POSIX:

.PHONY: ci-test clean package release test

clean:
	rm -rf .coverage coverage.xml .eggs/ .hypothesis/ .mypy_cache/ .pytest_cache/ .ruff_cache/ */*egg-info/ dist/ build/
	find . -name __pycache__ -exec rm -rf {} +
	find . -name *.pyc -exec rm -rf {} +

test:
	pytest

ci-test:
	pytest --cov-report xml --hypothesis-profile ci

package:
	python -m build .

release: NEXT_VER ?= $(shell setuptools-scm --strip-dev)
release:
	towncrier build --version ${NEXT_VER} --yes
	git add CHANGELOG.md
	git commit -m "docs: Update CHANGELOG for v${NEXT_VER} release"
	git tag -m "Version ${NEXT_VER} release" v${NEXT_VER}
