mirror of
https://github.com/YunoHost-Apps/pyinventory_ynh.git
synced 2024-09-03 20:16:09 +02:00
Merge pull request #76 from YunoHost-Apps/debug-venv-error
Debug venv error
This commit is contained in:
commit
94dadaa1da
4 changed files with 25 additions and 8 deletions
|
@ -112,8 +112,8 @@ chown -R "$app:" "$final_path"
|
|||
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"
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --upgrade wheel pip
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --no-deps -r "$final_path/requirements.txt"
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -88,15 +88,15 @@ ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrade Python virtualenv..." --weight=10
|
||||
|
||||
python3 -m venv --upgrade "${final_path}/venv"
|
||||
python3 -m venv "${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"
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --upgrade wheel pip
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --no-deps -r "$final_path/requirements.txt"
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -87,7 +87,7 @@ ynh_add_systemd_config --service="$app" --template="pyinventory.service"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrade project via pip..." --weight=80
|
||||
|
||||
python3 -m venv --upgrade "${final_path}/venv"
|
||||
python3 -m venv "${final_path}/venv"
|
||||
cp ../conf/requirements.txt "$final_path/requirements.txt"
|
||||
chown -R "$app:" "$final_path"
|
||||
|
||||
|
@ -96,8 +96,8 @@ chown -R "$app:" "$final_path"
|
|||
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"
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --upgrade wheel pip
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install --no-deps -r "$final_path/requirements.txt"
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
|
17
test_requirements.sh
Executable file
17
test_requirements.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Test to create the python virtual env and install all requirements.
|
||||
# Note: Maybe you didn't have all OS packages installed ;)
|
||||
|
||||
set -e
|
||||
|
||||
final_path="./local_test"
|
||||
|
||||
set -x
|
||||
|
||||
mkdir -p "${final_path}/"
|
||||
python3 -m venv "${final_path}/venv"
|
||||
source "${final_path}/venv/bin/activate"
|
||||
|
||||
$final_path/venv/bin/pip install --upgrade wheel pip
|
||||
$final_path/venv/bin/pip install --no-deps -r "./conf/requirements.txt"
|
Loading…
Reference in a new issue