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