################################################################################
#                              py-hopscotch-dict                               #
#    Full-featured `dict` replacement with guaranteed constant-time lookups    #
#                            (C) 2017-2026  Mischif                            #
#                Released under Prosperity Public License 3.0.0                #
################################################################################

.POSIX:

.PHONY: ci-test clean docs 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 .

docs:
	git cliff -o

release: NEXT_VER ?= $(shell setuptools-scm --strip-dev)
release:
	git commit --allow-empty -m "Update CHANGELOG for v${NEXT_VER} release"
	git tag -m "Version ${NEXT_VER} release" v${NEXT_VER}
	git cliff -o
	git add CHANGELOG.md
	git commit --amend --no-edit
	git tag -f -m "Version ${NEXT_VER} release" v${NEXT_VER}
