mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
Improve updater
This commit is contained in:
parent
5c83d5ab55
commit
6c283e63d1
2 changed files with 13 additions and 5 deletions
9
.github/workflows/updater.sh
vendored
9
.github/workflows/updater.sh
vendored
|
@ -47,6 +47,15 @@ fi
|
|||
# Replace new version in _common.sh
|
||||
sed -i "s/^app_version=.*/app_version=$upstream_version/" scripts/_common.sh
|
||||
|
||||
# Replace python required version
|
||||
py_required_major=$(curl -Ls https://pypi.org/pypi/$app/json | jq -r .info.requires_python | cut -d '=' -f 2 | rev | cut -d"." -f2- | rev)
|
||||
py_required_minor=$(curl -s "https://www.python.org/ftp/python/" | grep ">$py_required_major" | cut -d '/' -f 2 | cut -d '>' -f 2 | sort -rV | head -n 1)
|
||||
sed -i "s/^py_required_version=.*/py_required_version=$py_required_minor/" scripts/_common.sh
|
||||
|
||||
# Replace pip required version
|
||||
pip_required=$(curl -Ls https://pypi.org/pypi/$app/json | jq -r .info.requires_dist[] | grep "pip") #"pip (<23.1,>=21.0)"
|
||||
sed -i "s/^pip_required=.*/pip_required=$pip_required/" scripts/_common.sh
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
# Release to install
|
||||
app_version=2023.3.1
|
||||
|
||||
# Requirements (Major.Minor.Patch)
|
||||
# PY_VERSION=$(curl -s "https://www.python.org/ftp/python/" | grep ">3.9" | tail -n1 | cut -d '/' -f 2 | cut -d '>' -f 2)
|
||||
# Pyhton 3.9.2 will be shiped with bullseye
|
||||
# Requirements
|
||||
py_required_version=3.10.9
|
||||
pip_required=""
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
@ -125,7 +124,7 @@ myynh_install_homeassistant () {
|
|||
ynh_exec_as $app "$install_dir/bin/python3" -m ensurepip
|
||||
|
||||
# install last version of pip
|
||||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade pip
|
||||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade "$pip_required"
|
||||
|
||||
# install last version of wheel
|
||||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade wheel
|
||||
|
@ -137,7 +136,7 @@ myynh_install_homeassistant () {
|
|||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade mysqlclient
|
||||
|
||||
# install Home Assistant
|
||||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade $app==$app_version
|
||||
ynh_exec_as $app "$install_dir/bin/pip3" --cache-dir "$data_dir/.cache" install --upgrade "$app==$app_version"
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue