2024-01-30 11:37:53 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
|
|
|
# SET ALL CONSTANTS
|
|
|
|
#=================================================
|
|
|
|
|
2020-04-20 15:32:01 +02:00
|
|
|
python_version="$(python3 -V | cut -d' ' -f2 | cut -d. -f1-2)"
|
2022-03-13 15:22:35 +01:00
|
|
|
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
|
|
|
# DEFINE ALL COMMON FONCTIONS
|
|
|
|
#=================================================
|
|
|
|
|
2024-01-30 16:48:42 +01:00
|
|
|
ynh_install_venv() {
|
|
|
|
if [ -f "$install_dir/venv/bin/python" ]; then
|
|
|
|
ynh_exec_as "$app" python3 -m venv "$install_dir/venv" --upgrade
|
|
|
|
else
|
|
|
|
ynh_exec_as "$app" python3 -m venv "$install_dir/venv"
|
|
|
|
fi
|
|
|
|
ynh_use_venv
|
2024-01-30 15:32:09 +01:00
|
|
|
|
|
|
|
ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir pip wheel
|
2024-01-30 16:48:42 +01:00
|
|
|
}
|
|
|
|
ynh_use_venv() {
|
|
|
|
venvpy="$install_dir/venv/bin/python3"
|
|
|
|
}
|
|
|
|
|
|
|
|
_install_pgadmin_pip() {
|
2024-01-30 18:40:43 +01:00
|
|
|
# ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir --ignore-installed "psycopg[c]"
|
2024-01-30 15:32:09 +01:00
|
|
|
|
2024-01-30 22:50:25 +01:00
|
|
|
# cp "$YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt" "$install_dir/requirements.txt"
|
2024-01-30 23:07:51 +01:00
|
|
|
# cp "$YNH_APP_BASEDIR/conf/requirements_orig.txt" "$install_dir/requirements.txt"
|
|
|
|
# ynh_exec_as "$app" "$venvpy" -m pip install --upgrade -r "$install_dir/requirements.txt"
|
|
|
|
ynh_exec_as "$app" "$venvpy" -m pip install --upgrade "pgadmin4==7.7"
|
2024-01-30 15:32:09 +01:00
|
|
|
}
|