2025-05-05 04:43:13 -04:00
|
|
|
#!/usr/bin/env bash
|
[UPD] install : le venv d'outillage passe en Python 3.14.7
install_erplibre.sh bâtissait .venv.erplibre avec le python3 du système, quelle
que soit sa version : un 3.10 y donnait un venv que l'outillage ne sait pas
charger. Il délègue à install_venv.sh, qui obtient la version par mise, pyenv
ou la distribution, et rebâtit un venv hors service. Le PATCH ne borne que le
venv d'Odoo, dont le pyproject exige « >=3.12.10,<3.13 » : l'exiger ailleurs
écartait un Python de distribution d'un cran en retard — NixOS 25.11 livre
3.14.2 — et faisait compiler CPython pour rien. Le module NixOS déclare
désormais les DEUX Python, substitués depuis les fichiers de version.
Vérifié : 15 tests sur des venvs factices, conservés, rebâtis ou refusés selon
leur état, et un chemin sans pyvenv.cfg garde son contenu.
--- EN ---
install_erplibre.sh built .venv.erplibre with the system python3, whatever its
version: a 3.10 gave a venv the tooling cannot load. It delegates to
install_venv.sh, which obtains the version through mise, pyenv or the
distribution, and rebuilds a venv out of service. The PATCH bounds only Odoo's
venv, whose pyproject requires ">=3.12.10,<3.13": requiring it elsewhere turned
away a distribution Python one step behind — NixOS 25.11 ships 3.14.2 — and
compiled CPython for nothing. The NixOS module now declares BOTH Pythons,
substituted from the version files.
Checked: 15 tests on stub venvs, kept, rebuilt or refused by their state, and a
path without pyvenv.cfg keeps its content.
Assisted-by: Claude Opus 5
2026-09-24 13:31:32 -04:00
|
|
|
# © 2021-2026 TechnoLibre (http://www.technolibre.ca)
|
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
|
|
|
|
#
|
|
|
|
|
# Pose le venv d'OUTILLAGE d'ERPLibre, sans qu'une version d'Odoo soit
|
|
|
|
|
# choisie : chemin et version se lisent dans conf/, versionné, et non par
|
|
|
|
|
# env_var.sh, qui exige .python-odoo-version. Se lance depuis la racine du
|
|
|
|
|
# dépôt.
|
|
|
|
|
|
|
|
|
|
CONF_VENV="conf/python-erplibre-venv"
|
|
|
|
|
CONF_PYTHON_VERSION="conf/python-erplibre-version"
|
|
|
|
|
|
|
|
|
|
for conf_file in "${CONF_VENV}" "${CONF_PYTHON_VERSION}"; do
|
|
|
|
|
if [[ ! -f "${conf_file}" ]]; then
|
|
|
|
|
echo "Configuration introuvable : ${conf_file}"
|
|
|
|
|
echo " Ce script se lance depuis la racine du depot :"
|
|
|
|
|
echo " cd <racine du depot> && ./script/install/install_erplibre.sh"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# « xargs » retire espaces et retour de ligne autour de la valeur.
|
|
|
|
|
VENV_ERPLIBRE_PATH=$(xargs < "${CONF_VENV}")
|
|
|
|
|
PYTHON_ERPLIBRE_VERSION=$(xargs < "${CONF_PYTHON_VERSION}")
|
|
|
|
|
|
|
|
|
|
echo -e "Install ${VENV_ERPLIBRE_PATH} with ${PYTHON_ERPLIBRE_VERSION}"
|
|
|
|
|
if ! ./script/install/install_venv.sh \
|
|
|
|
|
"ERPLibre" "${VENV_ERPLIBRE_PATH}" "${PYTHON_ERPLIBRE_VERSION}"; then
|
|
|
|
|
echo "Echec de creation de ${VENV_ERPLIBRE_PATH}, arret."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Un venv rebâti n'a plus bin/repo ; install_git_repo.sh ne le pose que s'il
|
|
|
|
|
# manque. TODO s'en passe : seules les synchronisations de dépôts l'exigent,
|
|
|
|
|
# donc un échec (hors ligne) est signalé sans arrêter l'installation.
|
|
|
|
|
if ! ./script/install/install_git_repo.sh; then
|
|
|
|
|
echo "git-repo n'est pas pose dans ${VENV_ERPLIBRE_PATH} : 'repo sync' en a besoin."
|
|
|
|
|
echo " Rejouez quand le reseau le permet : ./script/install/install_git_repo.sh"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# el_pip_install vise le venv par son chemin : aucune activation n'est requise.
|
|
|
|
|
# shellcheck source=script/install/lib_pip_provider.sh
|
|
|
|
|
. ./script/install/lib_pip_provider.sh
|
|
|
|
|
if ! el_pip_install "${VENV_ERPLIBRE_PATH}" \
|
|
|
|
|
-r requirement/erplibre_require-ments.txt; then
|
|
|
|
|
echo "Echec d'installation des dependances Python dans ${VENV_ERPLIBRE_PATH}."
|
|
|
|
|
echo " Relancez : ./script/install/install_erplibre.sh"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Prettier ne sert qu'au formatage XML (« make format ») : son échec est
|
|
|
|
|
# signalé sans faire échouer une installation Python complète.
|
|
|
|
|
if ! npm install; then
|
|
|
|
|
echo "npm install a echoue : prettier et son greffon XML ne sont pas poses."
|
|
|
|
|
echo " ${VENV_ERPLIBRE_PATH} est utilisable ; seul 'make format' les reclame."
|
|
|
|
|
echo " Rejouez quand le reseau le permet : npm install"
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|