diff --git a/manifest.toml b/manifest.toml index 07e70f6..fffc486 100644 --- a/manifest.toml +++ b/manifest.toml @@ -48,4 +48,4 @@ ram.runtime = "50M" [resources.ports] [resources.apt] - packages = "python3, python3-venv" + packages = "python3, python3-dev, python3-pip, virtualenv" diff --git a/scripts/install b/scripts/install index e784878..9b23881 100755 --- a/scripts/install +++ b/scripts/install @@ -21,15 +21,12 @@ chown -R $app:www-data "$install_dir" #================================================= # SPECIFIC SETUP #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=2 - -ynh_exec_warn_less python3 -m pip install pipenv - ynh_script_progression --message="Installing LibreTranslate..." --weight=2 +ynh_exec_as $app virtualenv --python=python3 --system-site-packages "$install_dir/venv" + pushd $install_dir - mkdir -p .venv - PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install libretranslate==$libretranslate_version 2>&1 + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install libretranslate==$libretranslate_version popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9ef093e..a05afd2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,11 +38,10 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Installing LibreTranslate..." --weight=2 -ynh_exec_warn_less python3 -m pip install pipenv +ynh_exec_as $app virtualenv --python=python3 --system-site-packages "$install_dir/venv" pushd $install_dir - mkdir -p .venv - PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install libretranslate==$libretranslate_version 2>&1 + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install libretranslate==$libretranslate_version popd #=================================================