-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
167 lines (124 loc) · 3.36 KB
/
justfile
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/env just --justfile
# 'justfile'
# just-repo: https://github.com/casey/just
# just-docs: https://just.systems/man/en/
@_default:
just --list --unsorted
# dev run build + tests
dev: develop test
# maturin develop
develop:
maturin develop
# maturin develop (shorthand)
mat:
maturin develop
# cargo test
cargo-test:
cargo test
# build
build: cargo-test
maturin build
# build release
build-release:
maturin build --release
# maturin develop release
dev-rel:
maturin develop --release
# run pytest
pytest:
pytest --benchmark-skip
# run pytest (printing captured output)
pytestv:
pytest --benchmark-skip -rP
# run all test
test: pytest
# test ry package
test-release: build-release
pytest
# benchmark ry python package
bench: build-release
pytest -vv
# ci rust checks
ci:
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test
# ===========================================================================
# FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT ~ FMT
# ===========================================================================
# cargo format
cargo-fmt:
cargo fmt --all
# cargo format check
cargo-fmtc:
cargo fmt --all -- --check
# ruff check sorting of '__all__'
sort-all-check:
ruff check . --select RUF022 --preview --output-format=full
# ruff sort '__all__'
sort-all:
ruff check . --select RUF022 --preview --output-format=full --fix
# ruff format
ruff-fmt:
ruff format .
ruff check --select "I" --show-fixes --fix .
# ruff format check
ruff-fmtc:
ruff format . --check
# python format black
black:
black python
# python format
fmtpy: sort-all ruff-fmt
# python format check
fmtcpy: sort-all-check ruff-fmtc
# justfile format
justfilefmt:
just --fmt --unstable
# justfile format check
justfilefmtc:
just --check --fmt --unstable
# format
fmt: cargo-fmt fmtpy justfilefmt
# format check
fmtc: cargo-fmtc fmtcpy justfilefmtc
# ==========================================================================
# LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT ~ LINT
# ==========================================================================
# run ruff linter
ruff:
ruff check .
# run ruff + fix
ruffix:
ruff --fix --show-fixes
# run clippy
clippy:
cargo clippy
# lint python and rust
lint: ruff clippy
# =====================================================================
# TYPECHECK ~ TYPECHECK ~ TYPECHECK ~ TYPECHECK ~ TYPECHECK ~ TYPECHECK
# =====================================================================
# run mypy type checker
mypy:
mypy python/ry tests/
# run pyright
pyright:
pyright
# =====================================================================
# PYTHON ~ PYTHON ~ PYTHON ~ PYTHON ~ PYTHON ~ PYTHON ~ PYTHON ~ PYTHON
# =====================================================================
# pip compile requirements
pip-compile:
uv pip compile requirements.dev.in -n > requirements.dev.txt
_gen_init:
python scripts/gen.py > python/ry/__init__.py
_gen-py: _gen_init fmtpy
# generate code tasks
gen: _gen-py
# =====================================================================
# docs
# =====================================================================
# generate cargo docs for all crates (in workspace)
cargo-doc:
cargo doc --no-deps --workspace