update for weasyprint

This commit is contained in:
wh1te909 2023-10-28 01:41:50 +00:00
parent 01c4a85bc0
commit 6ebce55be3
4 changed files with 48 additions and 13 deletions

View File

@ -595,7 +595,7 @@ def generate_chart(
traces: Optional[Dict[str, Any]] = None,
layout: Optional[Dict[str, Any]] = None,
) -> str:
### TODO figure out why plotly affects perf
# TODO figure out why plotly affects perf
import plotly.express as px
fig = getattr(px, type)(**options)

View File

@ -292,8 +292,8 @@ sudo make altinstall
cd ~
sudo rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz
print_green 'Installing redis git and weasyprint'
sudo apt install -y redis git weasyprint
print_green 'Installing redis and git'
sudo apt install -y redis git
print_green 'Installing postgresql'
@ -487,6 +487,19 @@ sudo chmod +x /usr/local/bin/nats-api
print_green 'Installing the backend'
# for weasyprint
if [[ "$osname" == "debian" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 2 ]; then
sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0
fi
elif [[ "$osname" == "ubuntu" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 3 ]; then
sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0
fi
fi
SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')
WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')

View File

@ -281,8 +281,8 @@ sudo make altinstall
cd ~
sudo rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz
print_green 'Installing redis, git and weasyprint'
sudo apt install -y redis git weasyprint
print_green 'Installing redis and git'
sudo apt install -y redis git
print_green 'Installing postgresql'
@ -444,6 +444,19 @@ sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${pgusername}"
gzip -d $tmp_dir/postgres/db*.psql.gz
PGPASSWORD=${pgpw} psql -h localhost -U ${pgusername} -d tacticalrmm -f $tmp_dir/postgres/db*.psql
# for weasyprint
if [[ "$osname" == "debian" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 2 ]; then
sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0
fi
elif [[ "$osname" == "ubuntu" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 3 ]; then
sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0
fi
fi
SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')
WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')

View File

@ -171,10 +171,24 @@ EOF
sudo systemctl daemon-reload
fi
osname=$(lsb_release -si)
osname=${osname^}
osname=$(echo "$osname" | tr '[A-Z]' '[a-z]')
# for weasyprint
if [[ "$osname" == "debian" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 2 ]; then
sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0
fi
elif [[ "$osname" == "ubuntu" ]]; then
count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l)
if ! [ "$count" -eq 3 ]; then
sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0
fi
fi
if [ ! -f /etc/apt/sources.list.d/nginx.list ]; then
osname=$(lsb_release -si)
osname=${osname^}
osname=$(echo "$osname" | tr '[A-Z]' '[a-z]')
codename=$(lsb_release -sc)
nginxrepo="$(
cat <<EOF
@ -228,11 +242,6 @@ if ! [[ $HAS_PY311 ]]; then
sudo rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz
fi
HAS_WEASYPRINT=$(dpkg -l | grep weasyprint)
if ! [[ $HAS_WEASYPRINT ]]; then
sudo apt install -y weasyprint
fi
arch=$(uname -m)
nats_server='/usr/local/bin/nats-server'