-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
83 lines (62 loc) · 2.19 KB
/
justfile
File metadata and controls
83 lines (62 loc) · 2.19 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# paperjam — common developer commands
#
# Run `just` (no args) for the list. Requires `just` (https://just.systems).
default:
@just --list
# --- Build ---------------------------------------------------------------
# Build + install the Python extension into the current venv (release).
build:
uv run maturin develop --release
# Build + install the Python extension in debug mode (fast rebuild).
build-dev:
uv run maturin develop
# Build the whole Rust workspace.
build-rust:
cargo build --workspace
# Compile-check the wasm target (no linking).
build-wasm:
cargo check -p paperjam-wasm --target wasm32-unknown-unknown
# Build the Docusaurus docs site.
build-docs:
cd docs-site && npm ci && npm run build
# Render crate API docs into target/doc.
rustdoc:
cargo doc --workspace --no-deps
# --- Test ----------------------------------------------------------------
# Run the full Rust test suite.
test-rust:
cargo test --workspace
# Run the Python test suite (requires `just build` first).
test-py:
uv run pytest tests/python/ -v
# Run both Rust and Python test suites.
test: test-rust test-py
# Run the table-accuracy harness (slower, requires fixtures).
test-accuracy:
uv run pytest tests/python/ -m accuracy -v
# --- Lint / format -------------------------------------------------------
# Apply all autoformatters and run every pre-commit hook.
check:
pre-commit run --all-files
# Rust-only checks (fmt + clippy).
check-rust:
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
# Python-only checks (ruff + mypy).
check-py:
uv run ruff check py_src/ tests/
uv run ruff format --check py_src/ tests/
uv run mypy py_src/ tests/ examples/ --ignore-missing-imports
# Apply autoformatters (doesn't fail on remaining lint issues).
fmt:
cargo fmt --all
uv run ruff format py_src/ tests/
uv run ruff check --fix py_src/ tests/
# --- Clean ---------------------------------------------------------------
# Remove Rust build artifacts.
clean:
cargo clean
# Remove Rust build artifacts and Python caches.
clean-all: clean
rm -rf .pytest_cache .mypy_cache .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} +