File size: 969 Bytes
00d1980
 
 
4bda333
00d1980
 
4bda333
 
 
 
00d1980
 
4bda333
 
00d1980
 
4bda333
 
 
 
00d1980
4bda333
 
00d1980
4bda333
 
 
 
00d1980
4bda333
00d1980
 
4bda333
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail

# Simple installer: crea un venv local y instala las dependencias en él.
# Uso: ./scripts/install_deps.sh

PYTHON_CMD=${PYTHON_CMD:-python3}
VENV_DIR=${VENV_DIR:-venv}

echo "Usando Python: $($PYTHON_CMD --version 2>&1)"

if [ ! -d "$VENV_DIR" ]; then
  echo "Creando entorno virtual en ./$VENV_DIR..."
  $PYTHON_CMD -m venv "$VENV_DIR"
fi

# Activar el entorno
# shellcheck disable=SC1091
source "$VENV_DIR/bin/activate"
echo "Entorno virtual activado: $(which python)"

echo "Actualizando pip, setuptools y wheel..."
python -m pip install --upgrade pip setuptools wheel

if [ -f requirements.txt ]; then
  echo "Instalando dependencias desde requirements.txt..."
  python -m pip install --no-cache-dir -r requirements.txt
  echo "Dependencias instaladas correctamente."
else
  echo "No se encontró requirements.txt; nada que instalar."
fi

echo "Listo. Para activar el entorno en nuevas shells: source $VENV_DIR/bin/activate"