fix: remove 18 unused heavy deps — Docker image ~4GB → ~800MB

Removed packages never imported or only in try/except:
- crewai (pulls torch ~2GB), mem0ai, langgraph, langchain-*
- camel-tools, weasyprint, statsforecast (zero imports)
- pandas, paramiko, psycopg2-binary (zero imports in app/)
- pytest/factory-boy (testing only), celery-redbeat (workers only)

454 routes, 40/40 tests pass.

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
This commit is contained in:
Claude 2026-04-26 00:20:43 +00:00
parent 209c35759c
commit 10ff390ef9
No known key found for this signature in database

View File

@ -3,82 +3,58 @@ fastapi==0.115.5
uvicorn[standard]==0.32.1 uvicorn[standard]==0.32.1
pydantic>=2.10.0,<3 pydantic>=2.10.0,<3
pydantic-settings>=2.10.1,<3 pydantic-settings>=2.10.1,<3
pydantic-extra-types[phonenumbers]>=2.0.0 # Saudi phone validation (+966) pydantic-extra-types[phonenumbers]>=2.0.0
python-multipart==0.0.12 python-multipart==0.0.12
# === Database === # === Database ===
sqlalchemy==2.0.36 sqlalchemy==2.0.36
asyncpg==0.30.0 asyncpg==0.30.0
psycopg2-binary==2.9.10
alembic==1.14.0 alembic==1.14.0
pgvector==0.3.6 pgvector==0.3.6
# === AI / LLM Providers === # === AI / LLM Providers ===
litellm>=1.74.0,<2 # httpx>=0.28 compatible (older litellm capped httpx<0.28) litellm>=1.74.0,<2
instructor>=1.14.0 # Structured LLM outputs via Pydantic models instructor>=1.14.0
groq==0.12.0 groq==0.12.0
openai>=2.8.0,<3 # litellm 1.8x+ requires openai>=2.8; mem0ai 1.x supports it openai>=2.8.0,<3
langchain==0.3.28
langchain-groq==0.2.1
langchain-community==0.3.28
langchain-anthropic==0.2.0
langgraph==0.2.53
crewai>=0.95.0,<1 # aligns with litellm/langchain stack; 0.80 pulled incompatible crewai-tools
mem0ai>=1.0.0,<2 # 0.1.x capped openai<2; incompatible with current litellm
# === Arabic NLP === # === Arabic NLP (lightweight) ===
camel-tools>=1.5.0 # Arabic morphology, NER, dialect detection (NYU Abu Dhabi) pyarabic>=0.6.15
pyarabic>=0.6.15 # Arabic text normalization, diacritics removal
# === WhatsApp Business API === # === WhatsApp Business API ===
pywa>=3.0.0 # Direct WhatsApp Cloud API (async, webhooks, templates) pywa>=3.0.0
twilio==9.3.7 # Twilio fallback twilio==9.3.7
# === Communication === # === Communication ===
httpx>=0.28.1,<0.29.0 httpx>=0.28.1,<0.29.0
resend>=2.0.0 # Transactional email API (free tier, FastAPI-native) resend>=2.0.0
# === Saudi-specific === # === Saudi-specific ===
hijridate>=2.4.0 # Hijri-Gregorian calendar (Umm al-Qura, official Saudi) hijridate>=2.4.0
phonenumbers>=8.13.0 # Saudi phone number validation and formatting phonenumbers>=8.13.0
# === PDF Generation (Arabic RTL) ===
weasyprint>=60.0 # HTML/CSS to PDF with Arabic RTL support
# === Security === # === Security ===
PyJWT[crypto]>=2.8.0 # JWT (replaces abandoned python-jose) PyJWT[crypto]>=2.8.0
passlib[bcrypt]==1.7.4 passlib[bcrypt]==1.7.4
bcrypt>=4.0.1,<5 bcrypt>=4.0.1,<5
slowapi>=0.1.9 # API rate limiting with Redis backend slowapi>=0.1.9
# === Caching & Performance === # === Caching ===
redis==5.2.0 redis==5.2.0
fastapi-cache2>=0.2.1 # Response caching with Redis backend fastapi-cache2>=0.2.1
celery-redbeat>=2.2.0 # Dynamic Celery Beat scheduler (Redis-backed)
# === Monitoring & Logging === # === Monitoring & Logging ===
sentry-sdk[fastapi]>=2.0.0 # Error tracking + performance monitoring sentry-sdk[fastapi]>=2.0.0
prometheus-fastapi-instrumentator>=7.0.0 # Prometheus metrics prometheus-fastapi-instrumentator>=7.0.0
structlog>=24.0.0 # Structured JSON logging with tenant context structlog>=24.0.0
# === Testing ===
pytest==8.3.4
pytest-asyncio==0.24.0 # Async test support — pinned for CI stability
pytest-cov==5.0.0 # Coverage reporting — pinned for stability
factory-boy>=3.3.0 # Test data factories for SQLAlchemy models
# === Forecasting ===
statsforecast>=1.7.0 # Fast statistical time-series forecasting
# === Data & Utilities === # === Data & Utilities ===
beautifulsoup4==4.12.3 beautifulsoup4==4.12.3
lxml==5.3.0 lxml==5.3.0
requests>=2.32.5,<3 requests>=2.32.5,<3
python-dateutil==2.9.0 python-dateutil==2.9.0
pandas==2.2.3 numpy>=1.26.2,<2
numpy>=1.26.2,<2 # camel-tools requires numpy<2; langchain needs >=1.26.2 on Py3.12
python-decouple==3.8 python-decouple==3.8
paramiko==3.5.0
qrcode==8.0 qrcode==8.0
Pillow==11.0.0 Pillow==11.0.0
xmltodict==0.14.2 xmltodict==0.14.2