Fix pip checking if zip files are installed

This commit is contained in:
Paulus Schoutsen 2015-09-08 19:49:27 -07:00
parent 3520255b7c
commit 326d23de38
10 changed files with 36 additions and 26 deletions

View File

@ -33,8 +33,8 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_START,
DOMAIN = "modbus" DOMAIN = "modbus"
DEPENDENCIES = [] DEPENDENCIES = []
REQUIREMENTS = ['https://github.com/bashwork/pymodbus/archive/' + REQUIREMENTS = ['https://github.com/bashwork/pymodbus/archive/'
'd7fc4f1cc975631e0a9011390e8017f64b612661.zip'] 'd7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0']
# Type of network # Type of network
MEDIUM = "type" MEDIUM = "type"

View File

@ -44,8 +44,10 @@ from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
# update this requirement to upstream as soon as it supports python3 # update this requirement to upstream as soon as it supports python3
REQUIREMENTS = ['http://github.com/mala-zaba/Adafruit_Python_DHT/archive/' + REQUIREMENTS = ['http://github.com/mala-zaba/Adafruit_Python_DHT/archive/'
'4101340de8d2457dd194bca1e8d11cbfc237e919.zip'] '4101340de8d2457dd194bca1e8d11cbfc237e919.zip'
'#Adafruit_DHT==1.1.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = { SENSOR_TYPES = {
'temperature': ['Temperature', ''], 'temperature': ['Temperature', ''],

View File

@ -35,8 +35,9 @@ ATTR_NODE_ID = "node_id"
ATTR_CHILD_ID = "child_id" ATTR_CHILD_ID = "child_id"
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['https://github.com/theolind/pymysensors/archive/' + REQUIREMENTS = ['https://github.com/theolind/pymysensors/archive/'
'35b87d880147a34107da0d40cb815d75e6cb4af7.zip'] '35b87d880147a34107da0d40cb815d75e6cb4af7.zip'
'#pymysensors==0.2']
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):

View File

@ -26,7 +26,7 @@ from homeassistant.const import (TEMP_CELCIUS)
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/archive/' + REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/archive/' +
'ec7a1aaddf8270db6e5da1c13d58c1547effd7cf.zip'] 'ec7a1aaddf8270db6e5da1c13d58c1547effd7cf.zip#RFXtrx==0.15']
DATA_TYPES = OrderedDict([ DATA_TYPES = OrderedDict([
('Temperature', TEMP_CELCIUS), ('Temperature', TEMP_CELCIUS),

View File

@ -17,8 +17,9 @@ from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['https://github.com/rkabadi/temper-python/archive/' + REQUIREMENTS = ['https://github.com/rkabadi/temper-python/archive/'
'3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip'] '3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip'
'#temperusb==1.2.3']
# pylint: disable=unused-argument # pylint: disable=unused-argument

View File

@ -44,8 +44,8 @@ from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD,\
DEFAULT_USERNAME = 'admin' DEFAULT_USERNAME = 'admin'
DEFAULT_PASSWORD = '1234' DEFAULT_PASSWORD = '1234'
DEVICE_DEFAULT_NAME = 'Edimax Smart Plug' DEVICE_DEFAULT_NAME = 'Edimax Smart Plug'
REQUIREMENTS = ['https://github.com/rkabadi/pyedimax/archive/' + REQUIREMENTS = ['https://github.com/rkabadi/pyedimax/archive/'
'365301ce3ff26129a7910c501ead09ea625f3700.zip'] '365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1']
# setup logger # setup logger
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -62,9 +62,9 @@ DISCOVER_SWITCHES = 'verisure.switches'
DEPENDENCIES = [] DEPENDENCIES = []
REQUIREMENTS = [ REQUIREMENTS = [
'https://github.com/persandstrom/python-verisure/archive/' + 'https://github.com/persandstrom/python-verisure/archive/'
'9873c4527f01b1ba1f72ae60f7f35854390d59be.zip' '9873c4527f01b1ba1f72ae60f7f35854390d59be.zip#python-verisure==0.2.6'
] ]
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -16,8 +16,9 @@ from homeassistant.const import (
DOMAIN = "wink" DOMAIN = "wink"
DEPENDENCIES = [] DEPENDENCIES = []
REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/' + REQUIREMENTS = ['https://github.com/balloob/python-wink/archive/'
'c2b700e8ca866159566ecf5e644d9c297f69f257.zip'] 'c2b700e8ca866159566ecf5e644d9c297f69f257.zip'
'#python-wink==0.1']
DISCOVER_LIGHTS = "wink.lights" DISCOVER_LIGHTS = "wink.lights"
DISCOVER_SWITCHES = "wink.switches" DISCOVER_SWITCHES = "wink.switches"

View File

@ -5,6 +5,7 @@ import pkg_resources
import subprocess import subprocess
import sys import sys
import threading import threading
from urllib.parse import urlparse
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
INSTALL_LOCK = threading.Lock() INSTALL_LOCK = threading.Lock()
@ -36,7 +37,11 @@ def check_package_exists(package, target=None):
"""Check if a package exists. """Check if a package exists.
Returns True when the requirement is met. Returns True when the requirement is met.
Returns False when the package is not installed or doesn't meet req.""" Returns False when the package is not installed or doesn't meet req."""
req = pkg_resources.Requirement.parse(package) try:
req = pkg_resources.Requirement.parse(package)
except ValueError:
# This is a zip file
req = pkg_resources.Requirement.parse(urlparse(package).fragment)
if target: if target:
work_set = pkg_resources.WorkingSet([target]) work_set = pkg_resources.WorkingSet([target])

View File

@ -77,10 +77,10 @@ python-forecastio==1.3.3
PyMata==2.07a PyMata==2.07a
# Rfxtrx sensor (sensor.rfxtrx) # Rfxtrx sensor (sensor.rfxtrx)
https://github.com/Danielhiversen/pyRFXtrx/archive/ec7a1aaddf8270db6e5da1c13d58c1547effd7cf.zip https://github.com/Danielhiversen/pyRFXtrx/archive/ec7a1aaddf8270db6e5da1c13d58c1547effd7cf.zip#RFXtrx==0.15
# Mysensors # Mysensors
https://github.com/theolind/pymysensors/archive/35b87d880147a34107da0d40cb815d75e6cb4af7.zip https://github.com/theolind/pymysensors/archive/35b87d880147a34107da0d40cb815d75e6cb4af7.zip#pymysensors==0.2
# Netgear (device_tracker.netgear) # Netgear (device_tracker.netgear)
pynetgear==0.3 pynetgear==0.3
@ -92,33 +92,33 @@ netdisco==0.3
pywemo==0.3 pywemo==0.3
# Wink (*.wink) # Wink (*.wink)
https://github.com/balloob/python-wink/archive/c2b700e8ca866159566ecf5e644d9c297f69f257.zip https://github.com/balloob/python-wink/archive/c2b700e8ca866159566ecf5e644d9c297f69f257.zip#python-wink==0.1
# Slack notifier (notify.slack) # Slack notifier (notify.slack)
slacker==0.6.8 slacker==0.6.8
# Temper sensors (sensor.temper) # Temper sensors (sensor.temper)
https://github.com/rkabadi/temper-python/archive/3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip https://github.com/rkabadi/temper-python/archive/3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip#temperusb==1.2.3
# PyEdimax # PyEdimax
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
# RPI-GPIO platform (*.rpi_gpio) # RPI-GPIO platform (*.rpi_gpio)
# Uncomment for Raspberry Pi # Uncomment for Raspberry Pi
# RPi.GPIO ==0.5.11 # RPi.GPIO==0.5.11
# Adafruit temperature/humidity sensor # Adafruit temperature/humidity sensor
# uncomment on a Raspberry Pi / Beaglebone # uncomment on a Raspberry Pi / Beaglebone
# http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip # http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
# PAHO MQTT Binding (mqtt) # PAHO MQTT Binding (mqtt)
paho-mqtt==1.1 paho-mqtt==1.1
# PyModbus (modbus) # PyModbus (modbus)
https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0
# Verisure (verisure) # Verisure (verisure)
https://github.com/persandstrom/python-verisure/archive/9873c4527f01b1ba1f72ae60f7f35854390d59be.zip https://github.com/persandstrom/python-verisure/archive/9873c4527f01b1ba1f72ae60f7f35854390d59be.zip#python-verisure==0.2.6
# Python tools for interacting with IFTTT Maker Channel (ifttt) # Python tools for interacting with IFTTT Maker Channel (ifttt)
pyfttt==0.3 pyfttt==0.3