Separate requirements files: full and podcast-only modes

This commit is contained in:
ajaysi
2026-04-06 10:20:35 +05:30
parent 92a27270aa
commit 6ac880e61e
2 changed files with 57 additions and 79 deletions

View File

@@ -1,72 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
echo "🚀 Starting ALwrity Build Process..."
# 1. Update pip and essential build tools
python -m pip install --upgrade pip setuptools wheel
# Check if podcast-only mode is enabled
# 2. Install requirements based on mode
echo "📦 Checking ALWRITY_ENABLED_FEATURES..."
ENABLED_FEATURES="${ALWRITY_ENABLED_FEATURES:-all}"
if [[ "$ENABLED_FEATURES" == "podcast" ]]; then
echo "🔊 Podcast-only mode - installing minimal dependencies"
# Create minimal requirements on-the-fly
cat > requirements_min.txt << 'EOF'
fastapi>=0.115.14
starlette>=0.40.0,<0.47.0
sse-starlette<3.0.0
uvicorn>=0.24.0
uvicorn[standard]>=0.24.0
gunicorn>=21.0.0
python-multipart>=0.0.6
python-dotenv>=1.0.0
loguru>=0.7.2
tenacity>=8.2.3
pydantic>=2.5.2,<3.0.0
typing-extensions>=4.8.0
PyJWT>=2.8.0
cryptography>=41.0.0
fastapi-clerk-auth>=0.0.7
sqlalchemy>=2.0.25
stripe>=8.0.0
httpx>=0.27.2,<0.28.0
aiohttp>=3.9.0
openai>=1.3.0
google-genai>=1.0.0
exa-py==1.9.1
gtts>=2.4.0
pyttsx3>=2.90
markdown>=3.5.0
pandas>=2.0.0
numpy>=1.24.0
Pillow>=10.0.0
huggingface_hub>=1.1.4
moviepy==2.1.2
imageio>=2.31.0
imageio-ffmpeg>=0.4.9
pytest>=7.4.0
pytest-asyncio>=0.21.0
apscheduler>=3.10.0
redis>=5.0.0
schedule>=1.2.0
aiofiles>=23.2.0
requests>=2.31.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
psutil>=5.9.0
sentence-transformers>=2.2.2
google-api-python-client>=2.100.0
google-auth>=2.23.0
google-auth-oauthlib>=1.0.0
pydantic-settings>=2.0.0
python-dateutil>=2.8.0
jinja2>=3.1.0
EOF
python -m pip install --retries 10 --timeout 120 -r requirements_min.txt
if [[ "$ENABLED_FEATURES" == *"podcast"* ]]; then
echo "🔊 Podcast-only mode: Installing lean requirements..."
python -m pip install --no-cache-dir -r requirements-podcast.txt --only-binary :all: --retries 10 --timeout 120
else
echo "📦 Full mode - installing all dependencies"
python -m pip install --retries 10 --timeout 120 -r requirements.txt
echo "📦 Full mode: Installing all requirements..."
python -m pip install --no-cache-dir -r requirements.txt --only-binary :all: --retries 10 --timeout 120
# Download spaCy/NLTK models for full mode
echo "🧠 Installing spaCy and NLTK models..."
python -m spacy download en_core_web_sm
python -m nltk.downloader punkt_tab stopwords averaged_perceptron_tagger
fi
echo "✅ Build dependencies installed"
# 3. Clean up unnecessary build artifacts
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
rm -rf /root/.cache/pip 2>/dev/null || true
echo "✅ Build Complete!"

View File

@@ -1,4 +1,9 @@
# Core dependencies
# =====================================================
# ALwrity Podcast-Only Requirements
# Lean subset for podcast-only demo mode
# =====================================================
# Core Web Server
fastapi>=0.115.14
starlette>=0.40.0,<0.47.0
sse-starlette<3.0.0
@@ -14,39 +19,37 @@ tenacity>=8.2.3
pydantic>=2.5.2,<3.0.0
typing-extensions>=4.8.0
# Authentication
PyJWT>=2.8.0
cryptography>=41.0.0
# Auth & Database
fastapi-clerk-auth>=0.0.7
# Database
sqlalchemy>=2.0.25
# Payment
stripe>=8.0.0
# HTTP & API
httpx>=0.27.2,<0.28.0
# HTTP clients
httpx>=0.28.1
aiohttp>=3.9.0
requests>=2.31.0
# AI/ML (needed for podcast)
# AI - needed for podcast
openai>=1.3.0
google-genai>=1.0.0
exa-py==1.9.1
# Text processing (minimal)
markdown>=3.5.0
# Data processing (numpy needed for moviepy)
numpy>=1.24.0
# Image/media for podcast
Pillow>=10.0.0
huggingface_hub>=1.1.4
# TTS for podcast
gtts>=2.4.0
pyttsx3>=2.90
# Text processing
markdown>=3.5.0
# Data processing
pandas>=2.0.0
numpy>=1.24.0
# Image/audio processing
Pillow>=10.0.0
huggingface_hub>=1.1.4
# Video composition
moviepy==2.1.2
imageio>=2.31.0
@@ -55,3 +58,21 @@ imageio-ffmpeg>=0.4.9
# Testing
pytest>=7.4.0
pytest-asyncio>=0.21.0
# Task scheduling
apscheduler>=3.10.0
# Utilities
redis>=5.0.0
schedule>=1.2.0
aiofiles>=23.2.0
psutil>=5.9.0
# Google APIs
google-api-python-client>=2.100.0
google-auth>=2.23.0
google-auth-oauthlib>=1.0.0
# Other utilities
python-dateutil>=2.8.0
jinja2>=3.1.0