Update requirements.txt
Browse files- requirements.txt +88 -3
requirements.txt
CHANGED
|
@@ -1,3 +1,88 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ══════════════════════════════════════════════════════════════════
|
| 2 |
+
# requirements.txt — Phone Lookup Bot v2.0.0
|
| 3 |
+
# Target: Hugging Face ZeroGPU Space (Python 3.10+)
|
| 4 |
+
#
|
| 5 |
+
# Install: pip install -r requirements.txt
|
| 6 |
+
# ══════════════════════════════════════════════════════════════════
|
| 7 |
+
|
| 8 |
+
# ── Core web stack ────────────────────────────────────────────────
|
| 9 |
+
gradio>=5.0.0,<6.0.0 # Web UI + ASGI host.
|
| 10 |
+
# MUST be >=5.0 — app.py uses `ssr_mode=False`
|
| 11 |
+
# in demo.launch() (added in Gradio 5).
|
| 12 |
+
fastapi>=0.115.0,<1.0.0 # /webhook, /health, /admin/* route handlers.
|
| 13 |
+
starlette>=0.40.0 # StarletteRoute for runtime route injection.
|
| 14 |
+
uvicorn>=0.32.0 # ASGI server (also pulled in by gradio,
|
| 15 |
+
# pinned here for reproducible boots).
|
| 16 |
+
|
| 17 |
+
# ── Data engine ───────────────────────────────────────────────────
|
| 18 |
+
duckdb>=1.0.0,<2.0.0 # Parquet queries with `INSTALL httpfs`,
|
| 19 |
+
# `hf://datasets/…` reads, `CREATE SECRET`
|
| 20 |
+
# (HF token). DuckDB 1.0+ required for
|
| 21 |
+
# the `CREATE SECRET hf` syntax used in engine.py.
|
| 22 |
+
|
| 23 |
+
# ── HTTP ──────────────────────────────────────────────────────────
|
| 24 |
+
httpx>=0.27.0,<1.0.0 # Async client (TG messages, 850CR/IndData/ASUR×4)
|
| 25 |
+
# + sync client (webhook registration).
|
| 26 |
+
# Also used for multipart file uploads (sendDocument).
|
| 27 |
+
|
| 28 |
+
# ── Hugging Face ──────────────────────────────────────────────────
|
| 29 |
+
huggingface_hub>=0.26.0 # Needed for:
|
| 30 |
+
# • HfFolder shim (app.py line 1)
|
| 31 |
+
# • hf://datasets/… resolution via httpfs
|
| 32 |
+
# `get_token()` / `login()` / `logout()` at module
|
| 33 |
+
# level require >=0.22; we pin 0.26 for safety.
|
| 34 |
+
|
| 35 |
+
# ── Forms (admin login) ───────────────────────────────────────────
|
| 36 |
+
python-multipart>=0.0.9 # Required by Starlette's `await request.form()`
|
| 37 |
+
# in admin_panel.py /admin/login POST handler.
|
| 38 |
+
|
| 39 |
+
# ── Optional — provided by HF Spaces runtime, NOT installed locally ──
|
| 40 |
+
# spaces>=0.2.0 # @spaces.GPU decorator for ZeroGPU scanner.
|
| 41 |
+
# app.py has a local fallback shim so local dev
|
| 42 |
+
# works without it. Never `pip install` this
|
| 43 |
+
# outside HF Spaces — it will fail or conflict.
|
| 44 |
+
|
| 45 |
+
# ══════════════════════════════════════════════════════════════════
|
| 46 |
+
# NOTES
|
| 47 |
+
# ══════════════════════════════════════════════════════════════════
|
| 48 |
+
#
|
| 49 |
+
# Version pinning strategy
|
| 50 |
+
# ────────────────────────
|
| 51 |
+
# • Gradio is pinned to 5.x — the only major version that supports
|
| 52 |
+
# `ssr_mode=False` in demo.launch(). Gradio 6 may change this API;
|
| 53 |
+
# do NOT auto-upgrade.
|
| 54 |
+
# • DuckDB is pinned to 1.x — `CREATE SECRET hf (...)` and `hf://datasets/…`
|
| 55 |
+
# shorthand need DuckDB 1.0+. Do NOT auto-upgrade to 2.x without
|
| 56 |
+
# retesting every parquet query in engine.py.
|
| 57 |
+
# • httpx 0.27+ is required for `httpx.AsyncClient(timeout=…, follow_redirects=…)`
|
| 58 |
+
# signature parity across versions.
|
| 59 |
+
# • python-multipart is easy to forget — without it, the admin login
|
| 60 |
+
# form returns 500 "Form data requires python-multipart".
|
| 61 |
+
#
|
| 62 |
+
# Tested on
|
| 63 |
+
# ─────────
|
| 64 |
+
# Python 3.10.13
|
| 65 |
+
# gradio 5.0.1
|
| 66 |
+
# duckdb 1.1.2
|
| 67 |
+
# httpx 0.27.2
|
| 68 |
+
# huggingface_hub 0.26.2
|
| 69 |
+
# fastapi 0.115.4
|
| 70 |
+
# starlette 0.41.2
|
| 71 |
+
# uvicorn 0.32.0
|
| 72 |
+
# python-multipart 0.0.17
|
| 73 |
+
#
|
| 74 |
+
# Cross-checks for CI / reproducible builds
|
| 75 |
+
# ─────────────────────────────────────────
|
| 76 |
+
# gradio>=5.0.0,<6.0.0 ✓
|
| 77 |
+
# duckdb>=1.0.0,<2.0.0 ✓
|
| 78 |
+
# httpx>=0.27.0,<1.0.0 ✓
|
| 79 |
+
#
|
| 80 |
+
# Local development (without HF Spaces)
|
| 81 |
+
# ─────────────────────────────────────
|
| 82 |
+
# python -m venv .venv
|
| 83 |
+
# source .venv/bin/activate
|
| 84 |
+
# pip install -r requirements.txt
|
| 85 |
+
# BOT_TOKEN=xxx WEBHOOK_SECRET=yyy ADMIN_TOKEN=zzz python app.py
|
| 86 |
+
# → open http://localhost:7860 (Gradio UI)
|
| 87 |
+
# → open http://localhost:7860/health (health JSON)
|
| 88 |
+
# → open http://localhost:7860/admin (web admin, if ADMIN_TOKEN set)
|