-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
63 lines (49 loc) · 1.37 KB
/
Makefile
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
56
57
58
59
60
61
62
63
.DEFAULT_GOAL := all
.PHONY: .uv # Check that uv is installed
.uv:
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
.PHONY: .pre-commit # Check that pre-commit is installed
.pre-commit:
@pre-commit -V || echo 'Please install pre-commit: https://pre-commit.com/'
.PHONY: install # Install the package, dependencies, and pre-commit for local development
install: .uv .pre-commit
uv sync --frozen --group lint
pre-commit install --install-hooks
.PHONY: sync # Update local packages and uv.lock
sync: .uv
uv sync --all-extras --all-packages --group lint --group docs
.PHONY: build-dev
build-dev:
uv run maturin develop --uv
.PHONY: build-prod
build-prod:
uv run maturin develop --release --uv
.PHONY: format
format:
uv run ruff format
uv run ruff check --fix --fix-only
cargo fmt
.PHONY: lint-python
lint-python:
uv run ruff format --check
uv run ruff check
.PHONY: lint-rust
lint-rust:
cargo fmt --version
cargo fmt --all -- --check
cargo clippy --version
cargo clippy -- -D warnings -A incomplete_features -W clippy::dbg_macro -W clippy::print_stdout
.PHONY: lint
lint: lint-python lint-rust
.PHONY: mypy
typecheck:
uv run mypy python
.PHONY: test
test:
uv run coverage run -m pytest
.PHONY: testcov
testcov: build-dev test
@echo "building coverage html"
@uv run coverage html
.PHONY: all
all: lint typecheck testcov