|
| 1 | +"""README Quick start contract: clone-first vs full rebuild (pathlib-only).""" |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +from pathlib import Path |
| 6 | + |
| 7 | +REPO_ROOT = Path(__file__).resolve().parents[1] |
| 8 | +README = REPO_ROOT / "README.md" |
| 9 | + |
| 10 | + |
| 11 | +def _quick_start_through_documentation() -> str: |
| 12 | + """Slice from ``## Quick start`` up to the next H2.""" |
| 13 | + text = README.read_text(encoding="utf-8") |
| 14 | + start = text.index("## Quick start") |
| 15 | + end = text.index("\n## ", start + 1) |
| 16 | + return text[start:end] |
| 17 | + |
| 18 | + |
| 19 | +def test_readme_quick_start_local_first_contract() -> None: |
| 20 | + section = _quick_start_through_documentation() |
| 21 | + |
| 22 | + assert "Python 3.13" in section |
| 23 | + |
| 24 | + assert "cp .env.example .env" in section |
| 25 | + assert "Copy-Item .env.example .env" in section |
| 26 | + |
| 27 | + assert "MISTRAL_API_KEY" in section |
| 28 | + assert "your own Mistral key" in section |
| 29 | + assert "not claimed free" in section |
| 30 | + assert "free-tier" not in section.lower() |
| 31 | + assert "$0" not in section |
| 32 | + |
| 33 | + assert "9 SQLite DBs" in section |
| 34 | + assert "prebuilt Chroma" in section |
| 35 | + assert "No download or reindex is needed for the first run" in section |
| 36 | + |
| 37 | + assert "uv run python scripts/download_data.py chinook" in section |
| 38 | + assert "uv run python scripts/download_data.py bird-mini-dev" in section |
| 39 | + assert "uv run python scripts/build_index.py --db all" in section |
| 40 | + |
| 41 | + assert "required for embeddings" in section |
| 42 | + assert "GITHUB_TOKEN" in section |
| 43 | + assert "GROQ_API_KEY" in section |
| 44 | + assert "Ollama" in section |
| 45 | + |
| 46 | + assert "Postgres is optional" in section |
| 47 | + assert "SQLite-only" in section |
| 48 | + |
| 49 | + assert "uv sync --extra dev --extra ui" in section |
| 50 | + assert "uv run streamlit run app/streamlit_app.py" in section |
0 commit comments