Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
88 lines (73 loc) · 2.22 KB
/
Copy pathjustfile
File metadata and controls
88 lines (73 loc) · 2.22 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
# List all available recipes
_default:
@just --list --unsorted
# Bootstrap dev environment: install pre-commit hooks and sync dependencies
[group('dev')]
bootstrap:
uv tool install pre-commit
uv sync
pre-commit install --install-hooks
# Run pre-commit hooks on all files
[group('dev')]
lint:
pre-commit run --all-files
# Run all checks before submitting a PR
[group('dev')]
pre-mr-check: lint typecheck-all mypy-self stubtest ext-test test
# Remove mypy cache
[group('dev')]
clean-cache:
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf .ruff_cache
# Run mypy on the internal python code.
[group('typecheck')]
mypy-self:
uv run mypy ext scripts mypy_django_plugin
uv run mypy --cache-dir=/dev/null --no-incremental django-stubs
# Run mypy on test cases (default), or on the given files
[group('typecheck')]
mypy *files="tests/assert_type":
uv run mypy {{ files }}
# Run pyright on test cases (default), or on the given files
[group('typecheck')]
pyright *files="tests/assert_type":
uv run pyright {{ files }}
# Run pyrefly on test cases (default), or on the given files
[group('typecheck')]
pyrefly *files="tests/assert_type":
uv run pyrefly check {{ files }}
# Run ty on test cases (default), or on the given files
[group('typecheck')]
ty *files="tests/assert_type":
uv run ty check {{ files }}
# Run all typecheckers on test cases (default), or on the given files
[group('typecheck')]
typecheck-all *files="tests/assert_type":
#!/usr/bin/env bash
failed=()
for checker in pyrefly ty pyright mypy; do
printf '=================================== %s ===================================\n' "$checker"
just "$checker" {{ files }} || failed+=("$checker")
done
[[ ${#failed[@]} -eq 0 ]] || { echo "Failed: ${failed[*]}"; exit 1; }
# Run pytest tests
[group('test')]
test +args="-n auto tests":
uv run pytest {{ args }}
# Run stubtest to check stubs match runtime
[group('test')]
stubtest *args:
uv run ./scripts/stubtest.sh {{ args }}
# Run django-stubs-ext tests
[group('test')]
ext-test:
uv run pytest ext
# Build all packages
[group('build')]
build:
uv build --all-packages
# Check that uv.lock is up to date
[group('build')]
lock-check:
uv lock --check