From d1c4b36398ee14b8e395a454ee02288fe1b8907d Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Wed, 31 Mar 2021 01:21:30 -0600 Subject: [PATCH 1/4] Add dependencies to setup.py --- RaspberryPi_JetsonNano/python/setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RaspberryPi_JetsonNano/python/setup.py b/RaspberryPi_JetsonNano/python/setup.py index 8305abf..aa427cc 100644 --- a/RaspberryPi_JetsonNano/python/setup.py +++ b/RaspberryPi_JetsonNano/python/setup.py @@ -6,5 +6,11 @@ setup( author='Waveshare', package_dir={'': 'lib'}, packages=['waveshare_epd'], + install_requires=[ + 'RPi.GPIO', + 'spidev', + 'Pillow', + 'numpy' + ], ) From 8bb4c14351e72026217707a6618495b5d508e320 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Wed, 31 Mar 2021 07:58:48 -0600 Subject: [PATCH 2/4] Detect platform --- RaspberryPi_JetsonNano/python/setup.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/RaspberryPi_JetsonNano/python/setup.py b/RaspberryPi_JetsonNano/python/setup.py index aa427cc..c15d1b4 100644 --- a/RaspberryPi_JetsonNano/python/setup.py +++ b/RaspberryPi_JetsonNano/python/setup.py @@ -1,16 +1,19 @@ import sys from setuptools import setup + +dependencies = ['Pillow', 'numpy'] + +if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'): + dependencies.extend(['RPi.GPIO', 'spidev']) +else: + dependencies.extend(['Jetson.GPIO', 'smbus']) + setup( name='waveshare-epd', description='Waveshare e-Paper Display', author='Waveshare', package_dir={'': 'lib'}, packages=['waveshare_epd'], - install_requires=[ - 'RPi.GPIO', - 'spidev', - 'Pillow', - 'numpy' - ], + install_requires=dependencies, ) From 8e8a9f235d2ddc560d7487560dfb6e4621ed58a7 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Wed, 31 Mar 2021 12:10:38 -0600 Subject: [PATCH 3/4] Add missing import --- RaspberryPi_JetsonNano/python/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RaspberryPi_JetsonNano/python/setup.py b/RaspberryPi_JetsonNano/python/setup.py index c15d1b4..405374b 100644 --- a/RaspberryPi_JetsonNano/python/setup.py +++ b/RaspberryPi_JetsonNano/python/setup.py @@ -1,12 +1,12 @@ -import sys +import sys, os from setuptools import setup dependencies = ['Pillow', 'numpy'] if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'): - dependencies.extend(['RPi.GPIO', 'spidev']) + dependencies += ['RPi.GPIO', 'spidev'] else: - dependencies.extend(['Jetson.GPIO', 'smbus']) + dependencies += ['Jetson.GPIO', 'smbus'] setup( name='waveshare-epd', From e3b09f3db0a5f63553e0f57741db4ca959cb5044 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Thu, 1 Apr 2021 14:02:13 -0600 Subject: [PATCH 4/4] Remove smbus module --- RaspberryPi_JetsonNano/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RaspberryPi_JetsonNano/python/setup.py b/RaspberryPi_JetsonNano/python/setup.py index 405374b..3f619d3 100644 --- a/RaspberryPi_JetsonNano/python/setup.py +++ b/RaspberryPi_JetsonNano/python/setup.py @@ -6,7 +6,7 @@ dependencies = ['Pillow', 'numpy'] if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'): dependencies += ['RPi.GPIO', 'spidev'] else: - dependencies += ['Jetson.GPIO', 'smbus'] + dependencies += ['Jetson.GPIO'] setup( name='waveshare-epd',