-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
107 lines (87 loc) · 2.45 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This doesn't do anything, but is a placeholder for a future feature
# see: https://github.com/casey/just/issues/2290
# set min-just-version := '1.38.0'
# Default command (list all commands)
default:
@just --list
# Benchmark code
[group('test')]
bench: bench-python bench-rust
# Benchmark Python code
[group('python')]
[group('test')]
bench-python *ARGS:
uv run --extra tests pytest -n0 --benchmark-enable --benchmark-only {{ ARGS }}
# Benchmark Rust code
[group('rust')]
[group('test')]
bench-rust *ARGS:
cargo bench {{ ARGS }}
# Build Python package(s)
[group('dev')]
build *ARGS:
uv build {{ ARGS }}
# Bump packages version
[group('dev')]
bump +ARGS="patch":
uv run bump-my-version {{ ARGS }}
# Check the code can compile
[group('rust')]
[group('test')]
check:
cargo check
# Clean build artifacts
[group('dev')]
clean:
cargo clean
rm -rf dist
# Force reloading CUDA after suspend, see: https://github.com/ami-iit/jaxsim/issues/50#issuecomment-2022483137
[group('dev')]
cuda-reload:
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm
# List JAX's devices
[group('python')]
[group('test')]
devices:
uv run python -c "import jax;print(jax.devices())"
# Install marutin import hook to automatically build differt_core
[group('dev')]
[working-directory('differt-core')]
hook-install:
uv run python -m maturin_import_hook site install --detect-uv
# Uninstall marutin import hook
[group('dev')]
[working-directory('differt-core')]
hook-uninstall:
uv run python -m maturin_import_hook site uninstall
# Build and install Python packages
[group('dev')]
install *ARGS:
uv sync {{ ARGS }}
# Build and install Python package(s) using 'profiling' profile
[group('dev')]
install-profiling *ARGS:
uv sync --config-settings=build-args='--profile profiling' --reinstall-package differt_core {{ ARGS }}
# Run code linters and formatters
[group('dev')]
lint:
uv run pre-commit run --all-files
alias fmt := lint
# Test code
[group('test')]
test: test-python test-rust
# Test Python code
[group('python')]
[group('test')]
test-python *ARGS:
uv run --extra tests pytest {{ ARGS }}
# Test Rust code
[group('rust')]
[group('test')]
test-rust *ARGS:
cargo test {{ ARGS }}
# Run jupyter-lab with a server that supports reconnecting to running sessions
[group('dev')]
remote-jupyter *ARGS:
uv run --extra remote-jupyter jupyverse --set kernels.require_yjs=true --set jupyterlab.server_side_execution=true --set auth.mode=noauth {{ ARGS }}