-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelop.sh
More file actions
executable file
·90 lines (79 loc) · 1.82 KB
/
develop.sh
File metadata and controls
executable file
·90 lines (79 loc) · 1.82 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
function help() {
echo -e "RapidQuery Project Management\n"
echo -e " build build source"
echo -e " test run mypy & python tests"
echo -e " clippy run rust tests (check, clippy)"
echo -e " fmt format rust & python codes"
echo -e " bench run benchmarks"
echo -e ""
echo -e "Uses debug mode on default, use -p command to switch to production mode"
}
function build() {
if [[ "$1" == "-p" ]]; then
echo "Building sources (production mode) ..."
UV_OFFLINE=1 maturin develop --uv --release
else
echo "Building sources (debug mode) ..."
UV_OFFLINE=1 maturin develop --uv
fi
}
function test() {
echo "Running tests ..."
pytest -s -vv
rm -rf .pytest_cache 2>/dev/null
}
function clippy() {
if [[ "$1" == "-p" ]]; then
echo "Running checks (production mode) ..."
cargo check --release
cargo clippy --release
ruff check .
mypy rapidquery --disable-error-code type-arg --strict
else
echo "Running checks (debug mode) ..."
cargo check
cargo clippy
ruff check .
mypy rapidquery --disable-error-code type-arg --strict
fi
}
function fmt() {
echo "Formatting codes ..."
cargo fmt
ruff format --line-length=100 .
ruff clean
}
function bench() {
echo "Running benchmark ..."
build -p
python3 benchmarks.py
}
case "${1:-help}" in
help)
help
;;
build)
shift
build $@
;;
test)
shift
test $@
;;
clippy)
shift
clippy $@
;;
fmt)
shift
fmt $@
;;
bench)
shift
bench $@
;;
*)
echo -e "Unknown command: $1. Use 'help' command to see help menu."
exit 1
;;
esac