-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
76 lines (61 loc) · 2.04 KB
/
Copy pathjustfile
File metadata and controls
76 lines (61 loc) · 2.04 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
set shell := ["bash", "-euo", "pipefail", "-c"]
set quiet
set fallback
set positional-arguments
set default-list
uv_dev := "uv run --extra=dev"
# Run ruff format
[group('linting')]
format *args=".":
{{ uv_dev }} ruff format "$@"
# Run ruff check
[group('linting')]
check *args=".":
{{ uv_dev }} ruff check "$@"
# Format Django templates with djangofmt.
[group('linting')]
djangofmt *args="":
-{{ uv_dev }} djangofmt {{ args }} .
[group('linting')]
djangofmt-check:
just djangofmt
git diff --exit-code -- '*.html' || (echo "HTML templates are not formatted. Run 'just djangofmt' to fix." && exit 1)
# Run all formatters and linters
[group('linting')]
[parallel]
fmt: format (check "--fix") djangofmt && fmt-done
[private]
fmt-done:
echo '{{ GREEN }}Formatting complete{{ NORMAL }}'
# Run all code quality checks
[group('linting')]
fmt-check: (format "--check") check djangofmt-check && check-done
[private]
check-done:
echo '{{ GREEN }}All checks passed{{ NORMAL }}'
# Run tests (installs pretalx if not already present)
[group('tests')]
test *args: ensure-pretalx
{{ uv_dev }} pytest "$@"
# Install pretalx from git
[group('development')]
install-pretalx:
uv pip install "pretalx[dev] @ git+https://github.com/pretalx/pretalx@main"
# Install a local editable copy of pretalx (for development)
[group('development')]
install-pretalx-local path:
uv pip install -e "{{ path }}[dev]"
# Ensure pretalx is importable, installing it from git if needed
[private]
ensure-pretalx:
{{ uv_dev }} python -c "import pretalx" 2>/dev/null || just install-pretalx
# Generate locale files
[group('development')]
[script('bash')]
localegen: ensure-pretalx
module=$(find . -maxdepth 1 -type d -name 'pretalx_*' -not -name '*.egg-info' | head -1)
{{ uv_dev }} django-admin makemessages --add-location file -i build -i dist -i "*egg*" $(find "$module/locale/" -mindepth 1 -maxdepth 1 -type d -printf "-l %f " 2>/dev/null)
# Compile locale files
[group('development')]
localecompile: ensure-pretalx
{{ uv_dev }} django-admin compilemessages