From 6bad6a92e0c3dd400dfb9a70f19e8e33eb1d216c Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 2 Jan 2023 23:10:38 +0100 Subject: [PATCH 1/2] reinstall pip depedencies --- scripts/restore | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/restore b/scripts/restore index 5673a15..a85bb32 100755 --- a/scripts/restore +++ b/scripts/restore @@ -92,6 +92,29 @@ chmod 740 $final_path ynh_script_progression --message="Reinstalling dependencies..." --weight=15 ynh_install_app_dependencies $PKG_DEPENDENCIES +#Use venv to install pip requirements - Inspired from https://github.com/YunoHost-Apps/pyinventory_ynh/blob/master/scripts/install +ynh_script_progression --message="Reinstalling pip requirements..." --weight=70 +# Always recreate everything fresh with current python version +# When reinstalling on a new yunohost, this is required +if [ -d "${final_path}/venv" ] ; then + ynh_secure_remove "${final_path}/venv" +fi + +# Skip pip because of: https://github.com/YunoHost/issues/issues/1960 +python3 -m venv --without-pip "${final_path}/venv" +chown -R "$app:" "$final_path" + +#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/python3 -m ensurepip + ynh_exec_as $app $final_path/venv/bin/pip3 install --upgrade wheel pip setuptools + ynh_exec_as $app $final_path/venv/bin/pip3 install --no-cache-dir --upgrade -r "$final_path/requirements.txt" + ynh_exec_as $app $final_path/venv/bin/pip3 install --no-cache-dir --upgrade -r "$final_path/optional-requirements.txt" +) + #================================================= # RESTORE SYSTEMD #================================================= From f3efb92e16ed468353106d51b078ff9111f4c9bd Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 2 Jan 2023 23:11:58 +0100 Subject: [PATCH 2/2] bump version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index f73a48c..9c0e4ad 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Browsing, reading and downloading eBooks using a Calibre database", "fr": "Explorer, lire et télécharger des eBooks à partir d'une base de données Calibre" }, - "version": "0.96.19~ynh7", + "version": "0.96.19~ynh8", "url": "https://github.com/janeczku/calibre-web", "upstream": { "version": "0.6.19",