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

@ -105,7 +105,7 @@ blockchain==1.1.2
py-cpuinfo==0.1.6 py-cpuinfo==0.1.6
# homeassistant.components.sensor.dht # homeassistant.components.sensor.dht
http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0 # http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
# homeassistant.components.sensor.forecast # homeassistant.components.sensor.forecast
python-forecastio==1.3.3 python-forecastio==1.3.3
@ -118,7 +118,7 @@ pyowm==2.2.1
# homeassistant.components.sensor.rpi_gpio # homeassistant.components.sensor.rpi_gpio
# homeassistant.components.switch.rpi_gpio # homeassistant.components.switch.rpi_gpio
RPi.GPIO==0.5.11 # RPi.GPIO==0.5.11
# homeassistant.components.sensor.sabnzbd # homeassistant.components.sensor.sabnzbd
https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1 https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1

View File

@ -9,6 +9,11 @@ import os
import pkgutil import pkgutil
import re import re
COMMENT_REQUIREMENTS = [
'RPi.GPIO',
'Adafruit_Python_DHT'
]
def explore_module(package, explore_children): def explore_module(package, explore_children):
module = importlib.import_module(package) module = importlib.import_module(package)
@ -35,6 +40,11 @@ def core_requirements():
return re.findall(r"'(.*?)'", reqs_raw) 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(): def main():
if not os.path.isfile('requirements_all.txt'): if not os.path.isfile('requirements_all.txt'):
print('Run this from HA root dir') print('Run this from HA root dir')
@ -69,7 +79,11 @@ def main():
for req in sorted(requirements, for req in sorted(requirements,
key=lambda name: (len(name.split('.')), name)): key=lambda name: (len(name.split('.')), name)):
print('#', req) print('#', req)
print(pkg)
if comment_requirement(pkg):
print('#', pkg)
else:
print(pkg)
print() print()
if __name__ == '__main__': if __name__ == '__main__':