From f24b0241ea9edb58a78f0fc3e8d54525c0676de3 Mon Sep 17 00:00:00 2001 From: Jonathan Neufeld Date: Tue, 16 Feb 2021 10:07:22 -0800 Subject: [PATCH] Updated dependency requirements, added install script (and an angry rant) --- README.md | 12 ++++++++++-- b9robot.py | 2 +- install.sh | 14 ++++++++++++++ requirements.txt | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100755 install.sh diff --git a/README.md b/README.md index 2e08a99..18f436c 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,16 @@ A configurable Python daemon that dictates system notification messages audibly ## Prerequisites 1. Festival speech engine -2. Python 3.5 -3. All other dependencies are recorded in `requirements.txt`. To install run `pip -r requirements.txt` from the repository root. +2. Python 3.6 +3. Pip +4. VirtualEnv +5. All other dependencies are recorded in `requirements.txt`. To install run `pip -r requirements.txt` from the repository root. + +# Install +There is an install script that has been tested on Ubuntu 20.04 (Focal). For other distributions I'm afraid you're on your own. + +## Rant +I wasn't prepared for the absolute dependency hell that Python has become and I am still shocked that a custom install script is necessary for something so simple. This is my first (and last) Python project I will invest time in. Nobody has time for playing endless games of depedency whack-a-mole. # Configuration To configure this daemon see the sample configuration file enclosed in this repository. Place the configuration file at `/etc/b9robot/mappings.yaml` even if that means moving and renaming the bundled `mappings.example.yaml`. You can edit this configuration and send the _hang-up_ (`HUP`) signal to b9robot to automatically reload the configuration upon receipt of the next notification. diff --git a/b9robot.py b/b9robot.py index 279a74f..b479f65 100755 --- a/b9robot.py +++ b/b9robot.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.5 +#!/usr/bin/env python import gi diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..5ab58af --- /dev/null +++ b/install.sh @@ -0,0 +1,14 @@ +#!/bin/sh -e + +sudo apt -y install libsm6 libxrender1 libfontconfig1 python3.6-dev +cd `dirname $0` +virtualenv --python `which python3.6` . +. bin/activate +wget https://files.pythonhosted.org/packages/56/bb/905529e614a391170089578b0f4ec763a9f90d625f3996560ac57baae752/pyfestival-0.5.tar.gz -O pyfestival.tar.gz +tar zxf pyfestival.tar.gz +cd pyfestival-* +./setup.py install +cd .. +rm -fR pyfestival-* pyfestival.tar.gz +pip install -r requirements.txt +sed -i -e '1iimport _festival' -e '1,6{/^try:$/,/^[[:space:]]*import _festival/{d}}' lib/python3.6/site-packages/festival.py diff --git a/requirements.txt b/requirements.txt index 1cc47ce..4353662 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ beautifulsoup4 == 4.9.3 lxml == 4.6.2 cronyo == 0.4.2 dbus-python == 1.2.16 -opencv_python == 4.4.0.42 +opencv-python-headless == 4.4.0.42 pyfestival == 0.5 pygobject == 3.38.0 xlib == 0.21