-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
43 lines (32 loc) · 1.7 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
.DEFAULT_GOAL := help
PYTHON ?= $(shell [ -x .venv/bin/python ] && printf '%s' .venv/bin/python || printf '%s' python3)
PYTEST ?= $(shell [ -x .venv/bin/pytest ] && printf '%s' .venv/bin/pytest || printf '%s' pytest)
MATURIN ?= $(shell [ -x .venv/bin/maturin ] && printf '%s' .venv/bin/maturin || printf '%s' maturin)
RUFF ?= $(shell [ -x .venv/bin/ruff ] && printf '%s' .venv/bin/ruff || printf '%s' ruff)
CARGO ?= cargo
.PHONY: help build develop fmt test itest compliance vet clean
help: ## List all available targets with descriptions
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-10s %s\n", $$1, $$2}'
build: ## Build a wheel/sdist with maturin
$(MATURIN) build
develop: ## Build and install the extension into the active Python environment
$(MATURIN) develop
fmt: ## Format Python sources with Ruff
$(RUFF) format .
test: develop ## Run default tests (excluding integration and compliance suites)
$(PYTEST) -m "not integration and not compliance"
itest: develop ## Run Python integration tests against real loopback nodes
$(PYTEST) tests/ -m integration -v
compliance: develop ## Run cross-language compliance tests against the Rust CLI
$(PYTEST) tests/test_compliance.py -m compliance -v
vet: ## Run all Python and Rust format and lint checks
$(RUFF) format --check .
$(RUFF) check .
$(CARGO) fmt --check
$(CARGO) clippy --all-targets -- -D warnings
clean: ## Remove generated build artefacts and local test caches
$(CARGO) clean
rm -rf .pytest_cache build dist htmlcov .maturin
rm -rf python/igc_net/__pycache__ tests/__pycache__
rm -f python/igc_net/*.so python/igc_net/*.pyd python/igc_net/*.dll python/igc_net/*.dylib
rm -rf python/igc_net/*.dSYM