fix: auto-install python3-venv if missing
Some checks failed
Build and Push Docker Images / docker (push) Failing after 6s

This commit is contained in:
jeanotx32
2026-05-18 23:00:13 -04:00
parent 17e20b8ad6
commit f76a79fd1a

View File

@@ -61,9 +61,23 @@ check_root() {
fi
}
check_deps() {
command -v python3 &>/dev/null || error "Python 3 est requis : apt install python3 python3-venv"
command -v python3 &>/dev/null || error "Python 3 est requis : apt install python3"
command -v docker &>/dev/null || error "Docker est requis. Consultez https://docs.docker.com/engine/install/"
command -v curl &>/dev/null || error "curl est requis : apt install curl"
# Vérifie que le module venv est disponible, sinon l'installe
if ! python3 -m venv --help &>/dev/null; then
info "Module venv manquant — installation automatique..."
PY_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
if command -v apt-get &>/dev/null; then
apt-get install -y "python${PY_VER}-venv" || error "Impossible d'installer python${PY_VER}-venv"
elif command -v dnf &>/dev/null; then
dnf install -y python3 || error "Impossible d'installer python3 (venv inclus)"
else
error "Installez manuellement le module venv pour Python ${PY_VER}"
fi
success "python${PY_VER}-venv installé."
fi
}
# ─── Téléchargement des fichiers depuis le dépôt ─────────────────────────────