From 3af000b6a19f25167e253065ce6641a84b019da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 28 May 2024 23:40:50 +0200 Subject: [PATCH] Fix bookworm --- scripts/_common.sh | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index f7cb326..b377d6a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -36,22 +36,15 @@ myynh_setup_python_venv() { # Always recreate everything fresh with current python version ynh_secure_remove "$install_dir/venv" + chown -R "$app:$app" "$install_dir" + # Skip pip because of: https://github.com/YunoHost/issues/issues/1960 - python3 -m venv --without-pip "$install_dir/venv" + ynh_exec_as "$app" python3 -m venv --without-pip "$install_dir/venv" - chown -c -R "$app:" "$install_dir" - - # run source in a 'sub shell' - ( - set +o nounset - source "$install_dir/venv/bin/activate" - set -o nounset - set -x - ynh_exec_as $app $install_dir/venv/bin/python3 -m ensurepip - # using --no-cache-dir option because user doesn't have permission to write on cache directory (don't know if it's on purpose or not) - ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir --upgrade wheel pip setuptools - ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir -r "$install_dir/requirements.txt" - ) + ynh_exec_as $app $install_dir/venv/bin/python3 -m ensurepip + # using --no-cache-dir option because user doesn't have permission to write on cache directory (don't know if it's on purpose or not) + ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir --upgrade wheel pip setuptools + ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-cache-dir -r "$install_dir/requirements.txt" } myynh_setup_log_file() { @@ -78,4 +71,4 @@ myynh_fix_file_permissions() { chown -c -R "$app:" "$install_dir" chmod -c o-rwx "$install_dir" ) -} \ No newline at end of file +}