Comment out requirements that break on certain platforms

This commit is contained in:
Paulus Schoutsen
2015-11-17 00:28:22 -08:00
parent 377d2c6e5a
commit e92fe149fe
2 changed files with 17 additions and 3 deletions

View File

@@ -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__':