forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
87 lines (67 loc) · 2.05 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
default:
@just --list
### Common
# Format all of our code
format: toml-format py-format
cargo fmt --all
# Lint all of our code
lint: toml-lint py-lint
cargo cranky
scripts/lint.py
### Python
# Set up a Pythonvirtual environment for development
py-dev-env:
#!/usr/bin/env bash
echo "Setting up Python virtual environment in venv"
# set -euxo pipefail
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -r rerun_py/requirements-build.txt
venv/bin/pip install -r rerun_py/requirements-lint.txt
echo "Do 'source venv/bin/activate' to use the virtual environment!"
# Build and install the package into the venv
py-build:
#!/usr/bin/env bash
unset CONDA_PREFIX && \
source venv/bin/activate && \
maturin develop \
-m rerun_py/Cargo.toml \
--extras="tests"
# Run autoformatting
py-format:
black --config rerun_py/pyproject.toml .
blackdoc .
isort .
pyupgrade --py37-plus `find rerun_py/rerun/ -name "*.py" -type f`
# Run linting
py-lint:
black --check --config rerun_py/pyproject.toml --diff .
blackdoc --check .
isort --check .
mypy --no-warn-unused-ignore
flake8
# Run fast unittests
py-test:
python -m pytest rerun_py/tests/unit/
# Run all examples
py-run-all:
fd main.py | xargs -I _ sh -c "echo _ && python3 _"
### Rust
# Generate and open the documentation for Rerun and all of its Rust dependencies.
#
# `--keep-going` makes sure we don't to abort the build process in case of errors.
# This is an unstable flag, available only on nightly.
rs-doc:
cargo +nightly doc --all --open --keep-going --all-features -Zunstable-options
### TOML
# Format .toml files
toml-format:
taplo fmt
# Lint .toml files
toml-lint:
taplo fmt --check
### Misc
# Update the design_tokens.json used to style the GUI.
# See https://rerun-design-guidelines.netlify.app/tokens for their meanings.
download-design-tokens:
curl https://rerun-design-guidelines.netlify.app/api/tokens | jq > crates/re_viewer/data/design_tokens.json