-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (40 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
55 lines (40 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.DEFAULT_GOAL := help
.PHONY: help install lint format typecheck test cov parity fixtures check docs docs-build build clean
POETRY ?= poetry
RUN := $(POETRY) run
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
install: ## Install all dependency groups and the pre-commit hooks
$(POETRY) install --with dev,docs
$(RUN) pre-commit install
lint: ## Run the linter
$(RUN) ruff check .
format: ## Apply formatting and autofixes
$(RUN) ruff check --fix .
$(RUN) ruff format .
typecheck: ## Run mypy in strict mode
$(RUN) mypy
test: ## Run the test suite
$(RUN) pytest
cov: ## Run the test suite with a coverage report
$(RUN) pytest --cov=setqca --cov-report=term-missing --cov-report=html
parity: ## Run only the R QCA parity tests (no R needed; fixtures are committed)
$(RUN) pytest -m parity
fixtures: ## Regenerate the R QCA golden fixtures (requires R and the QCA package)
Rscript validation/r/generate_fixtures.R validation/fixtures/r_qca.json
check: ## Run the full quality gate, as CI does
$(RUN) ruff check .
$(RUN) ruff format --check .
$(RUN) mypy
$(RUN) pytest --cov=setqca
docs: ## Serve the documentation locally with live reload
$(RUN) mkdocs serve
docs-build: ## Build the documentation as CI does
$(RUN) mkdocs build --strict
build: ## Build the sdist and wheel
$(POETRY) build
clean: ## Remove build, test and cache artefacts
rm -rf dist build site htmlcov .coverage .coverage.* coverage.xml
rm -rf .pytest_cache .mypy_cache .ruff_cache .hypothesis
find . -type d -name __pycache__ -prune -exec rm -rf {} +