mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
Stop using a subshell, just call venv directly.
This commit is contained in:
parent
f5a173962e
commit
bd787c37d2
1 changed files with 8 additions and 15 deletions
|
@ -34,7 +34,7 @@ ynh_restore_file --origin_path="/opt/kepubify/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
chown -R $app: $install_dir
|
chown -R "$app:" "$install_dir"
|
||||||
chmod 740 $install_dir
|
chmod 740 $install_dir
|
||||||
|
|
||||||
#Use venv to install pip requirements - Inspired from https://github.com/YunoHost-Apps/pyinventory_ynh/blob/master/scripts/install
|
#Use venv to install pip requirements - Inspired from https://github.com/YunoHost-Apps/pyinventory_ynh/blob/master/scripts/install
|
||||||
|
@ -45,21 +45,14 @@ if [ -d "${install_dir}/venv" ] ; then
|
||||||
ynh_secure_remove "${install_dir}/venv"
|
ynh_secure_remove "${install_dir}/venv"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pushd "$install_dir"
|
||||||
# Skip pip because of: https://github.com/YunoHost/issues/issues/1960
|
# 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 -R "$app:" "$install_dir"
|
ynh_exec_as "$app" venv/bin/python3 -m ensurepip
|
||||||
|
ynh_exec_as "$app" venv/bin/pip3 install --upgrade wheel pip setuptools
|
||||||
#run source in a 'sub shell'
|
ynh_exec_as "$app" venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/requirements.txt"
|
||||||
(
|
ynh_exec_as "$app" venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/optional-requirements.txt"
|
||||||
cd "$install_dir"
|
popd
|
||||||
set +o nounset
|
|
||||||
source "venv/bin/activate"
|
|
||||||
set -o nounset
|
|
||||||
ynh_exec_as $app venv/bin/python3 -m ensurepip
|
|
||||||
ynh_exec_as $app venv/bin/pip3 install --upgrade wheel pip setuptools
|
|
||||||
ynh_exec_as $app venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/requirements.txt"
|
|
||||||
ynh_exec_as $app venv/bin/pip3 install --no-cache-dir --upgrade -r "$install_dir/optional-requirements.txt"
|
|
||||||
)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
|
|
Loading…
Add table
Reference in a new issue