1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00

Upgrade Python virtualenv in "restore"

This commit is contained in:
JensDiemer 2021-09-16 09:24:20 +02:00
parent ae1f3cdcf5
commit 955e7786b0

View file

@ -82,6 +82,23 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=40
ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# REINSTALL PYTHON VIRTUALENV
# Maybe the backup contains a other Python version
#=================================================
ynh_script_progression --message="Upgrade Python virtualenv..." --weight=10
python3 -m venv --upgrade "${final_path}/venv"
#run source in a 'sub shell'
(
set +o nounset
source "${final_path}/venv/bin/activate"
set -o nounset
ynh_exec_as $app $final_path/venv/bin/pip install --upgrade pip
ynh_exec_as $app $final_path/venv/bin/pip install -r "$final_path/requirements.txt"
)
#=================================================
# RESTORE THE PostgreSQL DATABASE
#=================================================