Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
136 lines (108 loc) · 3.34 KB
/
Copy pathjustfile
File metadata and controls
136 lines (108 loc) · 3.34 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
set shell := ["bash", "-cu"]
default:
@just --list
extra-args := ""
py-version := "3.12"
publish-order := "radiate-error radiate-utils radiate-expr radiate-core radiate-selectors radiate-alters radiate-gp radiate-engines radiate-ui radiate"
# --------------------------
# Helpers
# --------------------------
help:
@echo -e "\033[1mAvailable commands:\033[0m"
@just --list
@echo
_require-uv:
@command -v uv >/dev/null 2>&1 || { \
echo "Error: missing uv command install uv before running this Justfile"; \
exit 1; \
}
python-info py=py-version: _require-uv
@echo "PYTHON = {{py}}"
@echo "{{py}}" > .python-version
# --------------------------
# Main commands
# --------------------------
sync py=py-version: python-info
@uv python install {{py}}
@uv python pin {{py}}
@uv venv .venv --clear
@uv pip install --upgrade --compile-bytecode \
-r py-radiate/requirements.txt
coverage: _require-uv
@uv run -m pytest -n auto \
--cov=py-radiate \
--cov-report=term-missing
lint: _require-uv
@uv run ruff check py-radiate examples
format: _require-uv
@uv run ruff format py-radiate examples
wheel py=py-version args=extra-args:
@uv run maturin build -i {{py}} -m py-radiate/Cargo.toml --release {{args}}
sdist py=py-version args=extra-args:
@uv run maturin build -i {{py}} -m py-radiate/Cargo.toml --release --sdist {{args}}
develop py=py-version:
@just sync {{py}}
@uv run maturin develop -m py-radiate/Cargo.toml --uv
release py=py-version:
@just sync {{py}}
@uv run maturin develop -m py-radiate/Cargo.toml --release --uv
# --------------------------
# Test commands
# --------------------------
test lang="":
@if [ "{{lang}}" = "py" ]; then \
just test-py; \
elif [ "{{lang}}" = "rs" ]; then \
just test-rs; \
elif [ -z "{{lang}}" ]; then \
just test-py && just test-rs; \
else \
echo "Error: unsupported language '{{lang}}'. Supported: py, rs"; \
exit 1; \
fi
test-py *args: _require-uv
@uv run -m pytest -n auto {{args}}
test-rs:
#!/usr/bin/env bash
if command -v cargo-nextest >/dev/null 2>&1; then
cargo nextest run
else
echo "nextest not found, falling back to standard cargo test..."
cargo test
fi
# Execute every user-guide Python snippet (docs/source/src/python) to catch doc drift
test-docs *args: _require-uv
@uv run -m pytest py-radiate/tests/docs -n auto {{args}}
# Strict mkdocs build — validates that all snippet (`--8<--`) includes resolve
docs-build: _require-uv
@uv run --with mkdocs-material mkdocs build --strict
publish dry="false":
#!/usr/bin/env bash
set -euo pipefail
for crate in {{publish-order}}; do
echo "==> publishing $crate"
if [ "{{dry}}" = "true" ]; then
cargo publish -p "$crate" --dry-run
else
cargo publish -p "$crate"
fi
done
publish-dry-run:
just publish true
# --------------------------
# Example commands
# --------------------------
example:
@uv run python tools/examples.py list
# --------------------------
# Cleaning
# --------------------------
clean:
@rm -rf .venv
@rm -rf dist/
@rm -rf target/
@rm -rf .pytest_cache
@rm -rf site
@rm -rf .coverage
@rm -rf examples/data/scratch
@just py-radiate/clean