-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
87 lines (65 loc) · 2.25 KB
/
justfile
File metadata and controls
87 lines (65 loc) · 2.25 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
77
78
79
80
81
82
83
84
85
86
87
_default:
@just --list
# Create virtual environment and install Python
setup:
uv python install 3.14.2t
uv venv --python 3.14.2t --relocatable
# Clean build files
clean:
#!/usr/bin/env bash
rm -rf build/ .dist/ *.egg-info/ .venv/
find . -name "*.pyc" -delete
find . -name "__pycache__" -delete
find py -name "*.so" -delete
# Format code & check code
check:
#!/usr/bin/env bash
uv run black .
uv run ruff check . --preview --exclude etc --exclude playground
uv run mypy py
clang-format -i $(find cpp -name '*.cc') $(find cpp -name '*.hh')
# Build C++ extension and install dependencies
build:
uv pip install .[dev]
uv run python setup.py build_ext --inplace --with-tests
# Run unit tests only
test-unit:
uv run python setup.py run_cpp_tests
uv run pytest py/tests/test_config.py py/tests/test_watcher.py py/tests/test_www.py -v
# Run integration tests only
test-integration pattern="":
uv run pytest -sv --timeout 360 py/tests/integration -v -x {{ if pattern != "" { "-k '" + pattern + "'" } else { "" } }}
# Run all tests
test:
just test-unit
just test-integration
# Create a distributable package
package:
#!/usr/bin/env bash
set -e
version=$(grep '^version =' pyproject.toml | awk '{print $3}' | tr -d '"')
tarball="soir-${version}-{{arch()}}-{{os()}}.tar.gz"
rm -rf .dist
mkdir -p .dist/soir
cp -rL .venv .dist/soir
cp -R etc bin .dist/soir/
python_home=$(.venv/bin/python -c "import sys; print(sys.base_prefix)")
mkdir -p .dist/soir/.venv/lib
cp "$python_home"/lib/libpython3.14t.* .dist/soir/.venv/lib/ 2>/dev/null || true
.dist/soir/bin/soir --help > /dev/null
# There are multiple copies of the Python binary but we only need
# to keep one (win ~300m that way).
rm -f .dist/soir/.venv/bin/python?*
tar -czf "${tarball}" -C .dist soir
# Build Docker image (builder stage only, no www)
docker-build:
docker build --target builder -t soir:latest .
# Build Docker image for documentation website
www-docker-build:
docker build --target runtime-www -t soir-www:latest .
# Run documentation website via docker-compose
www-docker-up:
docker compose up -d
# Stop documentation website
www-docker-down:
docker compose down