Comment out requirements that break on certain platforms
This commit is contained in:
@@ -9,6 +9,11 @@ import os
|
||||
import pkgutil
|
||||
import re
|
||||
|
||||
COMMENT_REQUIREMENTS = [
|
||||
'RPi.GPIO',
|
||||
'Adafruit_Python_DHT'
|
||||
]
|
||||
|
||||
|
||||
def explore_module(package, explore_children):
|
||||
module = importlib.import_module(package)
|
||||
@@ -35,6 +40,11 @@ def core_requirements():
|
||||
return re.findall(r"'(.*?)'", reqs_raw)
|
||||
|
||||
|
||||
def comment_requirement(req):
|
||||
""" Some requirements don't install on all systems. """
|
||||
return any(ign in req for ign in COMMENT_REQUIREMENTS)
|
||||
|
||||
|
||||
def main():
|
||||
if not os.path.isfile('requirements_all.txt'):
|
||||
print('Run this from HA root dir')
|
||||
@@ -69,7 +79,11 @@ def main():
|
||||
for req in sorted(requirements,
|
||||
key=lambda name: (len(name.split('.')), name)):
|
||||
print('#', req)
|
||||
print(pkg)
|
||||
|
||||
if comment_requirement(pkg):
|
||||
print('#', pkg)
|
||||
else:
|
||||
print(pkg)
|
||||
print()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user