diff --git a/Dockerfile b/Dockerfile index a877f154037f561b9ef628f228bddc9fb35bae23..f0d5accdf3d3005750105c97b98402b8a67e0804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,8 +29,7 @@ COPY requirements_all.txt requirements_all.txt # Uninstall enum34 because some depenndecies install it but breaks Python 3.4+. # See PR #8103 for more info. RUN pip3 install --no-cache-dir -r requirements_all.txt && \ - pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet && \ - pip3 uninstall -y enum34 + pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet # Copy source COPY . . diff --git a/homeassistant/components/light/yeelight.py b/homeassistant/components/light/yeelight.py index 301a39775437b2908d410546ff056fffe0ff54d7..e286bf330a13a2bfb4eb1aea983152c28bd638a7 100644 --- a/homeassistant/components/light/yeelight.py +++ b/homeassistant/components/light/yeelight.py @@ -22,7 +22,7 @@ from homeassistant.components.light import ( Light, PLATFORM_SCHEMA) import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['yeelight==0.3.0'] +REQUIREMENTS = ['yeelight==0.3.2'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/sensor/skybeacon.py b/homeassistant/components/sensor/skybeacon.py index 0e8e2c6d2e9cfe2c7dc5b40b2c842b0f9b228d01..3c14625202ee5a4c7df16cc2330d0df34d361600 100644 --- a/homeassistant/components/sensor/skybeacon.py +++ b/homeassistant/components/sensor/skybeacon.py @@ -16,7 +16,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, CONF_MAC, TEMP_CELSIUS, STATE_UNKNOWN, EVENT_HOMEASSISTANT_STOP) -REQUIREMENTS = ['pygatt==3.1.1'] +# REQUIREMENTS = ['pygatt==3.1.1'] _LOGGER = logging.getLogger(__name__) @@ -39,6 +39,10 @@ CONNECT_TIMEOUT = 30 # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): """Set up the Skybeacon sensor.""" + _LOGGER.warning("This platform has been disabled due to having a " + "requirement depending on enum34.") + return + # pylint: disable=unreachable name = config.get(CONF_NAME) mac = config.get(CONF_MAC) _LOGGER.debug("Setting up...") @@ -136,6 +140,7 @@ class Monitor(threading.Thread): def run(self): """Thread that keeps connection alive.""" + # pylint: disable=import-error import pygatt from pygatt.backends import Characteristic from pygatt.exceptions import ( diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 63fcdc351eb798d78cdec1e4a974d5765dc1fe83..6d5fb25e5144140043bdb94de90a9f5a5a6c5932 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -9,3 +9,6 @@ aiohttp==2.2.4 async_timeout==1.2.1 chardet==3.0.4 astral==1.4 + +# Breaks Python 3.6 and is not needed for our supported Pythons +enum34==1000000000.0.0 diff --git a/requirements_all.txt b/requirements_all.txt index ec5829c1e665e6c5b840fb1e69366afe4f9685dd..26d1d4a19ac0c08f0f3757a231c24feb77c12b50 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -584,9 +584,6 @@ pyfoscam==1.2 # homeassistant.components.ifttt pyfttt==0.3 -# homeassistant.components.sensor.skybeacon -pygatt==3.1.1 - # homeassistant.components.remote.harmony pyharmony==1.0.16 @@ -983,7 +980,7 @@ yahoo-finance==1.4.0 yahooweather==0.8 # homeassistant.components.light.yeelight -yeelight==0.3.0 +yeelight==0.3.2 # homeassistant.components.light.yeelightsunflower yeelightsunflower==0.0.8 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 7e2f1d99f2a2bee6e503d258be84991473f13678..ba7a49cc7c05c5f0fdbc3d9ebb6161808c08271c 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -88,6 +88,10 @@ URL_PIN = ('https://home-assistant.io/developers/code_review_platform/' CONSTRAINT_PATH = os.path.join(os.path.dirname(__file__), '../homeassistant/package_constraints.txt') +CONSTRAINT_BASE = """ +# Breaks Python 3.6 and is not needed for our supported Pythons +enum34==1000000000.0.0 +""" def explore_module(package, explore_children): @@ -223,25 +227,25 @@ def write_test_requirements_file(data): def write_constraints_file(data): """Write constraints to a file.""" with open(CONSTRAINT_PATH, 'w+', newline="\n") as req_file: - req_file.write(data) + req_file.write(data + CONSTRAINT_BASE) def validate_requirements_file(data): """Validate if requirements_all.txt is up to date.""" with open('requirements_all.txt', 'r') as req_file: - return data == ''.join(req_file) + return data == req_file.read() def validate_requirements_test_file(data): """Validate if requirements_all.txt is up to date.""" with open('requirements_test_all.txt', 'r') as req_file: - return data == ''.join(req_file) + return data == req_file.read() def validate_constraints_file(data): """Validate if constraints is up to date.""" with open(CONSTRAINT_PATH, 'r') as req_file: - return data == ''.join(req_file) + return data + CONSTRAINT_BASE == req_file.read() def main(): diff --git a/tox.ini b/tox.ini index aede02462091afbcf1c76f9fdb20dd1f1eb59213..e3063af8f400ff4db40a11aedde1795d10468210 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ commands = py.test --timeout=30 --duration=10 --cov --cov-report= {posargs} deps = -r{toxinidir}/requirements_test_all.txt + -c{toxinidir}/homeassistant/package_constraints.txt [testenv:lint] basepython = python3 @@ -22,6 +23,7 @@ ignore_errors = True deps = -r{toxinidir}/requirements_all.txt -r{toxinidir}/requirements_test.txt + -c{toxinidir}/homeassistant/package_constraints.txt commands = flake8 pylint homeassistant diff --git a/virtualization/Docker/Dockerfile.dev b/virtualization/Docker/Dockerfile.dev index c92294ccd110afe4d7a2d52fd2657afedfac9a57..ca75fde041147e73a007748b8c29d080a02314ad 100644 --- a/virtualization/Docker/Dockerfile.dev +++ b/virtualization/Docker/Dockerfile.dev @@ -29,8 +29,7 @@ COPY requirements_all.txt requirements_all.txt # Uninstall enum34 because some depenndecies install it but breaks Python 3.4+. # See PR #8103 for more info. RUN pip3 install --no-cache-dir -r requirements_all.txt && \ - pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet && \ - pip3 uninstall -y enum34 + pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet # BEGIN: Development additions