-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmoke_install.sh
More file actions
49 lines (42 loc) · 1.73 KB
/
Copy pathsmoke_install.sh
File metadata and controls
49 lines (42 loc) · 1.73 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
#!/usr/bin/env bash
# Editable install smoke test (clean venv). Run from repo root:
# bash scripts/smoke_install.sh
# Or: bash scripts/smoke_install.sh /path/to/ai-failure-periodic-table
set -euo pipefail
ROOT="$(cd "${1:-.}" && pwd)"
TMP="${TMPDIR:-/tmp}/aift-smoke-$$"
cleanup() { rm -rf "$TMP"; }
trap cleanup EXIT
python3 -m venv "$TMP/venv"
# shellcheck source=/dev/null
source "$TMP/venv/bin/activate"
pip install -q -U pip build
(cd "$ROOT" && pip install -q -e ".[mcp]")
SMOKE_TEXT="The model fabricated a scientific citation that doesn't exist"
cd "$ROOT"
python -m src.cli --daily-driver "$SMOKE_TEXT" \
| python -c "import json,sys; d=json.load(sys.stdin); assert d.get('in_table') is True; print('smoke: --daily-driver OK')"
python -m src.cli --json "$SMOKE_TEXT" \
| python -c "import json,sys; d=json.load(sys.stdin); assert d.get('in_table') is True; print('smoke: --json OK')"
WHEEL_DIR="$TMP/wheels"
# Building on ExFAT/network volumes can litter AppleDouble files (._*) that break setuptools;
# stage a clean copy on the default temp filesystem (usually APFS) then build there.
BUILDSRC="$TMP/buildsrc"
rm -rf "$BUILDSRC"
mkdir -p "$BUILDSRC"
export COPYFILE_DISABLE=1
rsync -a \
--exclude '.git' \
--exclude '__pycache__' \
--exclude '*.pyc' \
--exclude '.pytest_cache' \
--exclude '._*' \
--exclude '.venv' \
"$ROOT/" "$BUILDSRC/"
(cd "$BUILDSRC" && python -m build --wheel --outdir "$WHEEL_DIR" >/dev/null)
pip uninstall -y ai-failure-periodic-table 2>/dev/null || true
pip install -q "$WHEEL_DIR"/*.whl "mcp>=1.2"
cd "$TMP"
python -m src.cli --json "$SMOKE_TEXT" \
| python -c "import json,sys; d=json.load(sys.stdin); assert d.get('in_table') is True; print('smoke: wheel --json OK')"
echo "smoke_install.sh: all OK"