From 1652b340fe53d2fd138d72f509a027a8fe3dc9b2 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sat, 12 Feb 2022 15:38:51 +0100 Subject: [PATCH] Update setup.py better detection of raspberry pi based cpu for RPi.GPIO --- setup.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e773530..99d5137 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,18 @@ from setuptools import setup, find_packages from cbpi import __version__ import platform +# read the contents of your README file +from os import popen + +localsystem = platform.system() +raspberrypi=False +if localsystem == "Linux": + command="cat /proc/cpuinfo | grep Raspberry" + model=popen(command).read() + if len(model) != 0: + raspberrypi=True + + setup(name='cbpi', version=__version__, description='CraftBeerPi', @@ -37,7 +49,7 @@ setup(name='cbpi', 'psutil==5.8.0', 'cbpi4ui', 'importlib_metadata'] + ( - ['RPi.GPIO==0.7.1a4'] if platform.uname()[1] == "raspberrypi" else [] ) + + ['RPi.GPIO==0.7.1a4'] if raspberrypi else [] ) + (['numpy==1.22.0'] if (int(platform.python_version_tuple()[1]) >= 9) and (int(platform.python_version_tuple()[0]) == 3) else ['numpy==1.20.3'] ) + (['pandas==1.4.0'] if (int(platform.python_version_tuple()[1]) >= 9) and (int(platform.python_version_tuple()[0]) == 3) else ['pandas==1.1.5'] ),