-with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
- long_description = '\n' + f.read()
-
-# Load the package's __version__.py module as a dictionary.
-about = {}
-if not VERSION:
- # with open(os.path.join(here, NAME, '__version__.py')) as f:
- with open(os.path.join(here, 'src', '__version__.py')) as f:
- exec(f.read(), about)
-else:
- about['__version__'] = VERSION
-
-
-class UploadCommand(Command):
- """Support setup.py upload."""
-
- description = 'Build and publish the package.'
- user_options = []
-
- @staticmethod
- def status(s):
- """Prints things in bold."""
- print('\033[1m{0}\033[0m'.format(s))
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
+with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
+ long_description = "\n" + f.read()
+
+board_reqs = []
+platform_reqs = []
+if os.path.exists("/proc/device-tree/compatible"):
+ with open("/proc/device-tree/compatible", "rb") as f:
+ compat = f.read()
+ if b"nvidia,tegra" in compat:
+ board_reqs = ["Jetson.GPIO"]
+ # Pi 4 and Earlier
+ if (
+ b"brcm,bcm2835" in compat
+ or b"brcm,bcm2836" in compat
+ or b"brcm,bcm2837" in compat
+ or b"brcm,bcm2838" in compat
+ or b"brcm,bcm2711" in compat
+ ):
+ board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0"]
+ # Pi 5
+ if b"brcm,bcm2712" in compat:
+ board_reqs = ["rpi_ws281x>=4.0.0", "rpi-lgpio"]
+ if (
+ b"ti,am335x" in compat
+ ): # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
+ board_reqs = ["Adafruit_BBIO"]
+
+if platform.system() == "Linux" and platform.machine() != "mips":
+ platform_reqs = ["sysv_ipc>=1.1.0"]