-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
68 lines (55 loc) · 1.45 KB
/
justfile
File metadata and controls
68 lines (55 loc) · 1.45 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
set positional-arguments
set dotenv-load
set shell := ["bash", "-cue"]
root_dir := `git rev-parse --show-toplevel`
flake_dir := root_dir / "tools/nix"
# Manage container images.
mod image 'tools/just/image.just'
# Manage nix flakes
mod nix 'tools/just/nix.just'
# local IP of the host
host := `ip route get 1 | sed -En 's/^.*src ([0-9.]*) .*$/\1/p'`
[private]
default:
just --unsorted --list --no-aliases
alias dev := develop
# Enter a development shell.
develop:
just nix::develop default
# Set up python environment.
setup:
@echo "🔧 Setting up python environment"
uv sync --all-extras --group dev
uv run pre-commit install
# Run all quality checks.
check: setup
@echo "🚀 Validating lock file"
uv lock --check
@echo "🚀 Running all pre-commit hooks"
uv run pre-commit run -a
alias fmt := format
# Format code.
format *args: setup
@echo "🚀 Formatting python code"
uv run ruff format {{args}}
# Run unit tests.
test *args: setup
@echo "🚀 Testing code: Running pytest"
@uv run pytest {{args}}
# Build documentation.
docs: setup
@echo "📖 Building documentation"
uv sync --frozen --group docs
uv run sphinx-build docs/ docs/_build
# Start server-side services.
deploy:
S3_PUBLIC_URL="http://{{host}}:9000" \
docker compose \
--profile local \
-f tools/deploy/compose.yaml \
up \
--build \
--force-recreate
# Generate changelog
changelog *args:
@git-cliff -l -c pyproject.toml {{args}}