-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·64 lines (54 loc) · 1.61 KB
/
setup.sh
File metadata and controls
executable file
·64 lines (54 loc) · 1.61 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
#!/usr/bin/env bash
set -euo pipefail
error=0
# Check uv
if command -v uv &> /dev/null; then
echo "[OK] uv: $(uv --version)"
else
echo "[MISSING] uv - Install: https://docs.astral.sh/uv/getting-started/installation/"
error=1
fi
# Check direnv
if command -v direnv &> /dev/null; then
echo "[OK] direnv: $(direnv --version)"
else
echo "[MISSING] direnv - Install: https://direnv.net/docs/installation.html"
error=1
fi
# Check direnv uv integration
direnvrc="${XDG_CONFIG_HOME:-$HOME/.config}/direnv/direnvrc"
if [[ -f "$direnvrc" ]] && grep -q "use_uv" "$direnvrc"; then
echo "[OK] direnv uv integration"
else
echo "[MISSING] direnv uv integration"
echo " Add to $direnvrc:"
echo
echo ' use_uv() {'
echo ' [ -d .venv ] || uv venv'
echo ' source .venv/bin/activate'
echo ' [ -f uv.lock ] && uv sync'
echo ' }'
echo
error=1
fi
if [[ $error -eq 1 ]]; then
echo "Install/configure missing dependencies and run this script again."
exit 1
fi
echo
echo "All prerequisites found. Setting up project..."
# Install Python packages
uv sync
echo "[OK] Python packages installed"
# Copy workflow config template if it doesn't exist yet
if [[ ! -f workflow/config.yaml ]]; then
cp workflow/config.template.yaml workflow/config.yaml
echo "[OK] Created workflow/config.yaml from template (edit as needed)"
else
echo "[OK] workflow/config.yaml already exists"
fi
# Install pre-commit hooks
uv run pre-commit install
echo "[OK] Pre-commit hooks installed"
echo
echo "Setup complete. Run 'direnv allow' to enable automatic venv activation."