-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev
More file actions
executable file
·46 lines (40 loc) · 799 Bytes
/
Copy pathdev
File metadata and controls
executable file
·46 lines (40 loc) · 799 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage: ./dev <command> [args...]
Commands:
test [pytest-args...] Run tests (skips slow tests by default)
lint Run ruff check --fix and ruff format
EOF
}
if [ "$#" -lt 1 ]; then
usage
exit 1
fi
cmd="$1"
shift
case "$cmd" in
test)
has_mark=0
for arg in "$@"; do
if [[ "$arg" == "-m" ]] || [[ "$arg" == -m* ]] || [[ "$arg" == "--markexpr" ]] || [[ "$arg" == --markexpr=* ]]; then
has_mark=1
break
fi
done
if [ "$has_mark" -eq 1 ]; then
uv run pytest tests -n auto "$@"
else
uv run pytest tests -n auto -m "not slow" "$@"
fi
;;
lint)
uv run ruff check --fix .
uv run ruff format .
;;
*)
usage
exit 1
;;
esac