#!/bin/bash
# Download all Python packages as wheel files for offline installation
# Run this on a machine with internet access

set -e

echo "📦 Downloading Python wheels for offline installation..."
echo ""

# Create wheels directory
mkdir -p wheels

# Download all dependencies including their dependencies
pip download \
    --dest wheels \
    --platform manylinux2014_x86_64 \
    --only-binary=:all: \
    --python-version 3.11 \
    -r requirements.txt

echo ""
echo "✅ Downloaded all wheels to ./wheels/"
echo ""
echo "Files downloaded:"
ls -lh wheels/
echo ""
echo "Next steps:"
echo "1. Commit the wheels directory: git add wheels/ && git commit -m 'Add offline Python wheels'"
echo "2. Push to Git: git push"
echo "3. The Dockerfile will install from local wheels (no PyPI access needed)"
