From 386ed4bc16cbf08f2fa770ea37e8246bcfac8aef Mon Sep 17 00:00:00 2001 From: guirem Date: Wed, 29 Jan 2020 15:07:09 +0100 Subject: [PATCH] improve pip module management --- resources/requirements.txt | 9 +++++++++ resources/update.sh | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 resources/requirements.txt create mode 100755 resources/update.sh diff --git a/resources/requirements.txt b/resources/requirements.txt new file mode 100644 index 0000000..d3f3cba --- /dev/null +++ b/resources/requirements.txt @@ -0,0 +1,9 @@ +setuptools +requests>=2.21.0 +protobuf +zeroconf>=0.24.4 +click +bs4 +six +tqdm +websocket-client \ No newline at end of file diff --git a/resources/update.sh b/resources/update.sh new file mode 100755 index 0000000..565e0d5 --- /dev/null +++ b/resources/update.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +pip3cmd=$(compgen -ac | grep -E '^pip-?3' | sort -r | head -1) +if [[ -z $pip3cmd ]]; then # pip3 not found + if python3 -m pip -V 2>&1 | grep -q -i "^pip " ; then # but try other way + pip3cmd="python3 -m pip" +fi + +if [[ ! -z $pip3cmd ]]; then # pip3 found + echo "-- Updating requirements :" + echo $($pip3cmd install -r requirements.txt) +else + echo "" + echo "Error: Cound not found pip3 program to update python dependencies !" +fi