#!/usr/bin/env bash
# ================================================================
# TEST - Python Virtual Environment einrichten
# ================================================================

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setenv.sh"

if [ ! -d "$DXFMAKRO/.venv" ]; then
    echo "Initialisiere Python virtual environment..."
    python3 -m venv "$DXFMAKRO/.venv" --upgrade-deps
    echo "Erfolgreich."

    source "$DXFMAKRO/.venv/bin/activate"
    echo "Installiere erforderliche Python Packages..."
    pip install -r "$DXFMAKRO/requirements.txt" -q
    echo "Erfolgreich."
    deactivate
else
    echo "Erforderliche Python Packages bereits installiert!"
fi
