-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
67 lines (52 loc) · 2.86 KB
/
Copy pathsetup.sh
File metadata and controls
67 lines (52 loc) · 2.86 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
#!/usr/bin/env bash
# setup.sh — create (or reuse) .venv and install all dependencies
# Run from the project root: bash setup.sh
set -euo pipefail
VENV=".venv"
PYTHON="${PYTHON:-python3}"
# ── Python version check ──────────────────────────────────────────────────────
PY_VERSION=$("$PYTHON" -c "import sys; print('%d.%d' % sys.version_info[:2])" 2>/dev/null) || {
echo "ERROR: python3 not found. Install Python 3.9 or later."
exit 1
}
PY_MAJOR=$(echo "$PY_VERSION" | cut -d. -f1)
PY_MINOR=$(echo "$PY_VERSION" | cut -d. -f2)
if [ "$PY_MAJOR" -lt 3 ] || { [ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 9 ]; }; then
echo "ERROR: Python $PY_VERSION found, but 3.9+ is required."
exit 1
fi
echo "Python $PY_VERSION OK"
# ── Create venv if missing ────────────────────────────────────────────────────
if [ ! -d "$VENV" ]; then
echo "Creating virtual environment at $VENV/ ..."
"$PYTHON" -m venv "$VENV"
else
echo "Reusing existing $VENV/"
fi
PIP="$VENV/bin/pip"
# ── Install dependencies ──────────────────────────────────────────────────────
echo ""
echo "Installing API dependencies (api/requirements.txt) ..."
"$PIP" install --quiet -r api/requirements.txt
echo "Installing chat dependencies (chat/requirements.txt) ..."
"$PIP" install --quiet -r chat/requirements.txt
echo ""
echo "All dependencies installed."
# ── Usage summary ─────────────────────────────────────────────────────────────
cat <<'EOF'
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
felund-core — setup complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Activate the venv:
source .venv/bin/activate
Run the chat TUI:
.venv/bin/python chat/felundchat.py
Run a specific CLI command:
.venv/bin/python chat/felundchat.py --help
.venv/bin/python chat/felundchat.py invite
.venv/bin/python chat/felundchat.py join --code <code>
Run the rendezvous API (optional):
.venv/bin/uvicorn api.rendezvous:app --reload
(set FELUND_API_BASE=http://localhost:8000 in the chat env)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF