-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
64 lines (52 loc) · 1.7 KB
/
justfile
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
set positional-arguments
set shell := ["bash", "-cue"]
root_dir := `git rev-parse --show-toplevel`
flake_dir := root_dir / "tools/nix"
output_dir := root_dir / ".output"
build_dir := output_dir / "build"
# Default target if you do not specify a target.
default:
just --list --unsorted
# Enter the default Nix development shell and execute the command `"$@`.
develop *args:
just nix-develop "default" "$@"
# Format the project.
format *args:
"{{root_dir}}/tools/scripts/setup-config-files.sh"
nix run --accept-flake-config {{flake_dir}}#treefmt -- "$@"
# Setup the project.
setup *args:
cd "{{root_dir}}" && ./tools/scripts/setup.sh
# Run commands over the ci development shell.
ci *args:
just nix-develop "ci" "$@"
## Nix Stuff ==================================================================
# Show all packages configured in the Nix `flake.nix`.
nix-list *args:
cd tools/nix && nix flake --no-pure-eval show
# Enter the Nix `devShell` with name `$1` and execute the command `${@:2}` (default command is '$SHELL')
[private]
nix-develop *args:
#!/usr/bin/env bash
set -eu
cd "{{root_dir}}"
shell="$1"; shift 1;
args=("$@") && [ "${#args[@]}" != 0 ] || args="$SHELL"
nix develop --no-pure-eval --accept-flake-config \
"{{flake_dir}}#$shell" --command "${args[@]}"
## ============================================================================
# Lint the project.
lint *args:
ruff check
# Build the project.
build *args:
uv build --out-dir "{{build_dir}}" "$@"
# Test the project.
test *args:
echo "TODO: Not implemented"
# Run an executable.
run *args:
uv run cli "$@"
# Run the Jupyter notebook.
notebook *args:
uv run python -m notebook "$@"