.PHONY: develop test rust-test py-test fmt-check clippy docs-check release-check

PYTHON ?= python3

develop:
	$(PYTHON) -m pip install -U pip maturin pytest
	$(PYTHON) -m maturin develop --features python

test: rust-test py-test

rust-test:
	cargo test --lib --features python

py-test:
	$(PYTHON) -m pytest -q

fmt-check:
	cargo fmt --check

clippy:
	cargo clippy --features python -- -D warnings

docs-check:
	mkdocs build --strict

release-check:
	rm -rf dist
	$(PYTHON) -m pip install -U maturin twine
	cargo fmt --check
	cargo clippy --features python -- -D warnings
	cargo test --lib --features python
	$(PYTHON) -m maturin develop --features python
	$(PYTHON) -m pytest -q tests
	$(PYTHON) -m maturin sdist --out dist
	$(PYTHON) -m maturin build --release --features python --out dist
	$(PYTHON) -m twine check dist/*
