mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-30 00:54:55 +02:00
Update logic to determine and set PyGObject version in pyproject.toml based on libgirepository apt package version
This commit is contained in:
parent
8870b62b17
commit
6789cb6ce4
@ -80,19 +80,35 @@ function tool_install {
|
|||||||
detected_distro "Debian based"
|
detected_distro "Debian based"
|
||||||
VERSION=$(cat /etc/debian_version)
|
VERSION=$(cat /etc/debian_version)
|
||||||
|
|
||||||
# https://github.com/AdnanHodzic/auto-cpufreq/pull/826
|
# install necessary libgirepository debian package dependencies
|
||||||
# install necessary debian dependencies
|
# https://github.com/AdnanHodzic/auto-cpufreq/pull/826#issuecomment-2794549837
|
||||||
sudo apt update
|
apt update
|
||||||
|
|
||||||
if apt-cache show libgirepository-2.0-dev > /dev/null 2>&1; then
|
if apt-cache show libgirepository-2.0-dev > /dev/null 2>&1; then
|
||||||
echo "Installing libgirepository-2.0-dev ..."
|
LIB_GI_REPO="libgirepository-2.0-dev"
|
||||||
sudo apt install -y libgirepository-2.0-dev
|
PYGOBJECT_VER="^3.50.0"
|
||||||
else
|
else
|
||||||
echo "Installing libgirepository1.0-dev..."
|
LIB_GI_REPO="libgirepository1.0-dev"
|
||||||
sudo apt install -y libgirepository1.0-dev
|
# pin PYGOBJECT_VER to libgirepository1.0-dev
|
||||||
|
# https://github.com/AdnanHodzic/auto-cpufreq/issues/813#issuecomment-2712543486
|
||||||
|
PYGOBJECT_VER="3.50.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $LIB_GI_REPO needs to be installed for version $VERSION
|
# Update PyGObject in pyproject.toml
|
||||||
|
# https://github.com/AdnanHodzic/auto-cpufreq/pull/826#issuecomment-2794549837
|
||||||
|
if [ -f ./pyproject.toml ]; then
|
||||||
|
if grep -q 'PyGObject *= *{[^}]*version *= *"' pyproject.toml; then
|
||||||
|
sed -i "s/\(PyGObject *= *{[^}]*version *= *\"\)[^\"]*\(.*\)/\1$PYGOBJECT_VER\2/" pyproject.toml
|
||||||
|
echo "PyGObject version updated to $PYGOBJECT_VER in pyproject.toml"
|
||||||
|
else
|
||||||
|
echo "Warning: Could not find PyGObject version entry in pyproject.toml!"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Error: pyproject.toml not found and PyGObject version not updated!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "$LIB_GI_REPO needs to be installed for version $VERSION"
|
||||||
echo '---- '
|
echo '---- '
|
||||||
apt install -y python3-dev python3-pip python3-venv python3-setuptools dmidecode \
|
apt install -y python3-dev python3-pip python3-venv python3-setuptools dmidecode \
|
||||||
"$LIB_GI_REPO" libcairo2-dev libgtk-3-dev gcc
|
"$LIB_GI_REPO" libcairo2-dev libgtk-3-dev gcc
|
||||||
|
@ -26,6 +26,8 @@ psutil = ">=6.0.0,<8.0.0"
|
|||||||
click = "^8.1.0"
|
click = "^8.1.0"
|
||||||
distro = "^1.8.0"
|
distro = "^1.8.0"
|
||||||
requests = "^2.32.3"
|
requests = "^2.32.3"
|
||||||
|
# PyObject version will be updated automatically for Debian based distro based on libgirepository
|
||||||
|
# apt package version: https://github.com/AdnanHodzic/auto-cpufreq/pull/826#issuecomment-2794549837
|
||||||
PyGObject = {version="3.50.0", optional=true}
|
PyGObject = {version="3.50.0", optional=true}
|
||||||
urwid = "^2.6.16"
|
urwid = "^2.6.16"
|
||||||
pyinotify = {git = "https://github.com/shadeyg56/pyinotify-3.12"}
|
pyinotify = {git = "https://github.com/shadeyg56/pyinotify-3.12"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user