# groth16py developer tasks. Python tooling is uv-based; the wheel bundles the `native`
# feature (circom compiler + wasmi) — all pure Rust, no protoc/clang/wasmer.
.PHONY: help test test-native dev pytest docs docs-rust docs-python wheel clean

help:
	@echo "test        - Rust crypto core tests (default features, fast)"
	@echo "test-native - Rust tests incl. in-process circom + wasmi + zkey"
	@echo "dev         - build the extension into a uv venv (maturin develop)"
	@echo "pytest      - run the Python test suite"
	@echo "docs        - build Rust + Python API docs"
	@echo "wheel       - build a release abi3 wheel for this platform"

test:
	cargo test

test-native:
	cargo test --features native

dev:
	uv venv
	uv pip install maturin pytest
	uv run maturin develop

pytest: dev
	uv run pytest -v

docs: docs-rust docs-python

docs-rust:
	cargo doc --features native --no-deps
	@echo "Rust docs: target/doc/groth16py/index.html"

docs-python:
	uv pip install pdoc
	uv run maturin develop
	uv run pdoc groth16py -o docs/python
	@echo "Python docs: docs/python/index.html"

wheel:
	uv pip install maturin
	uv run maturin build --release
	@echo "Wheel in target/wheels/"

clean:
	cargo clean
	rm -rf docs/ .pytest_cache/
