1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/bin/sh
set -eux
# install build dependencies
dnf -y install python3-setuptools python3 python3-gobject-base \
python3-dbus dbus-x11 util-linux \
upower NetworkManager ModemManager bluez libnotify polkit
if ! grep -q :el /etc/os-release; then
# skip iio-sensor-proxy: https://github.com/martinpitt/python-dbusmock/issues/241
dnf -y install power-profiles-daemon python3-pytest
else
dnf -y install python3-pip
pip install pytest
fi
if [ "$SKIP_STATIC_CHECKS" != "1" ]; then
dnf -y install python3-pylint python3-mypy python3-pip black
pip install ruff
fi
# systemd's tools otherwise fail on "not been booted with systemd"
mkdir -p /run/systemd/system
# run build and test as user
useradd build
su -s /bin/sh - build << EOF || { [ -z "$DEBUG" ] || sleep infinity; exit 1; }
set -ex
cd /source
export SKIP_STATIC_CHECKS="$SKIP_STATIC_CHECKS"
python3 -m unittest -v
python3 -m pytest -v
EOF
|