-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·34 lines (29 loc) · 1.16 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.16 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
#!/bin/sh
# Repo-local venv + editable install, via uv. POSIX sh -- runs under bash and zsh. Flags:
# --tests also install pytest extra
# --bench also install benchmark extras (huggingface_hub, psutil)
#
# Needs uv (https://docs.astral.sh/uv/); `brew install uv` or the standalone installer.
cd "$(dirname "$0")" || exit 1
if ! command -v uv >/dev/null 2>&1; then
echo "setup.sh needs uv -- install it with 'brew install uv' or see https://docs.astral.sh/uv/"
exit 1
fi
# uv creates and manages .venv. `uv pip` finds .venv in the cwd without an active
# venv, but we activate so the pytest/cmake commands echoed below use it too.
if [ ! -d .venv ]; then
uv venv
fi
. .venv/bin/activate
extras=""
for arg in "$@"; do
case "$arg" in
--tests) extras="[test]" ;;
--bench) extras="[bench]" ;;
esac
done
uv pip install -e ".$extras"
echo ""
echo "Done. C++ tests: cmake -S . -B build -G Ninja -DSEQTREE_TESTS=ON; cmake --build build; ctest --test-dir build"
echo " Python tests: pytest tests/python"
echo " Benchmarks: python bench/bench.py (1M tier: env RUN_BENCHMARK=1 python bench/bench.py --sizes 1000000 --queries 1000000)"