Files
27-combi/verify_setup.sh

77 lines
2.0 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# Quick verification script to check if everything is ready
echo "=== DeFi Collateral Simulation - Setup Verification ==="
echo ""
# Check Python
echo -n "Checking Python 3... "
if command -v python3 &> /dev/null; then
PYTHON_VERSION=$(python3 --version 2>&1)
echo "✅ Found: $PYTHON_VERSION"
else
echo "❌ NOT FOUND"
echo " Please install Python 3.7 or higher"
exit 1
fi
# Check venv module
echo -n "Checking venv module... "
if python3 -m venv --help &> /dev/null; then
echo "✅ Available"
# Try to actually create a test venv to verify ensurepip works
if python3 -m venv /tmp/test_venv_$$ 2>/dev/null; then
rm -rf /tmp/test_venv_$$
echo " (ensurepip verified)"
else
PYTHON_VERSION=$(python3 --version 2>&1 | grep -oP '\d+\.\d+' | head -1)
echo "⚠️ Available but ensurepip may be missing"
echo " If venv creation fails, install: sudo apt install python${PYTHON_VERSION}-venv"
fi
else
echo "❌ NOT AVAILABLE"
echo " Install with: sudo apt-get install python3-venv"
exit 1
fi
# Check if generator script exists
echo -n "Checking generator script... "
if [ -f "generate_defi_simulation.py" ]; then
echo "✅ Found"
# Check syntax
echo -n "Checking Python syntax... "
if python3 -m py_compile generate_defi_simulation.py 2>/dev/null; then
echo "✅ Valid"
else
echo "❌ Syntax errors found"
exit 1
fi
else
echo "❌ NOT FOUND"
exit 1
fi
# Check if helper scripts exist
echo -n "Checking helper scripts... "
if [ -f "generate_excel.sh" ] && [ -f "generate_excel.bat" ]; then
echo "✅ Found"
else
echo "⚠️ Some helper scripts missing"
fi
# Check if venv already exists
if [ -d "venv" ]; then
echo " Virtual environment already exists (will be reused)"
else
echo " Virtual environment will be created on first run"
fi
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Ready to generate workbook! Run:"
echo " ./generate_excel.sh"
echo ""