mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Block dependencies that depend on enum34 (#8698)
* Block dependencies that depend on enum34 * Remove uninstalling enum34 * Update validation script * Add constraints to tox.ini * Upgrade yeelight to version that uses enum-compat * Disable sensor.skybeacon * Lint
This commit is contained in:
parent
a0530d8b9c
commit
e49b970665
@ -29,8 +29,7 @@ COPY requirements_all.txt requirements_all.txt
|
|||||||
# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
|
# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
|
||||||
# See PR #8103 for more info.
|
# See PR #8103 for more info.
|
||||||
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
|
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
|
||||||
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet && \
|
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet
|
||||||
pip3 uninstall -y enum34
|
|
||||||
|
|
||||||
# Copy source
|
# Copy source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -22,7 +22,7 @@ from homeassistant.components.light import (
|
|||||||
Light, PLATFORM_SCHEMA)
|
Light, PLATFORM_SCHEMA)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
REQUIREMENTS = ['yeelight==0.3.0']
|
REQUIREMENTS = ['yeelight==0.3.2']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA
|
|||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_NAME, CONF_MAC, TEMP_CELSIUS, STATE_UNKNOWN, EVENT_HOMEASSISTANT_STOP)
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -39,6 +39,10 @@ CONNECT_TIMEOUT = 30
|
|||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Set up the Skybeacon sensor."""
|
"""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)
|
name = config.get(CONF_NAME)
|
||||||
mac = config.get(CONF_MAC)
|
mac = config.get(CONF_MAC)
|
||||||
_LOGGER.debug("Setting up...")
|
_LOGGER.debug("Setting up...")
|
||||||
@ -136,6 +140,7 @@ class Monitor(threading.Thread):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Thread that keeps connection alive."""
|
"""Thread that keeps connection alive."""
|
||||||
|
# pylint: disable=import-error
|
||||||
import pygatt
|
import pygatt
|
||||||
from pygatt.backends import Characteristic
|
from pygatt.backends import Characteristic
|
||||||
from pygatt.exceptions import (
|
from pygatt.exceptions import (
|
||||||
|
@ -9,3 +9,6 @@ aiohttp==2.2.4
|
|||||||
async_timeout==1.2.1
|
async_timeout==1.2.1
|
||||||
chardet==3.0.4
|
chardet==3.0.4
|
||||||
astral==1.4
|
astral==1.4
|
||||||
|
|
||||||
|
# Breaks Python 3.6 and is not needed for our supported Pythons
|
||||||
|
enum34==1000000000.0.0
|
||||||
|
@ -584,9 +584,6 @@ pyfoscam==1.2
|
|||||||
# homeassistant.components.ifttt
|
# homeassistant.components.ifttt
|
||||||
pyfttt==0.3
|
pyfttt==0.3
|
||||||
|
|
||||||
# homeassistant.components.sensor.skybeacon
|
|
||||||
pygatt==3.1.1
|
|
||||||
|
|
||||||
# homeassistant.components.remote.harmony
|
# homeassistant.components.remote.harmony
|
||||||
pyharmony==1.0.16
|
pyharmony==1.0.16
|
||||||
|
|
||||||
@ -983,7 +980,7 @@ yahoo-finance==1.4.0
|
|||||||
yahooweather==0.8
|
yahooweather==0.8
|
||||||
|
|
||||||
# homeassistant.components.light.yeelight
|
# homeassistant.components.light.yeelight
|
||||||
yeelight==0.3.0
|
yeelight==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.light.yeelightsunflower
|
# homeassistant.components.light.yeelightsunflower
|
||||||
yeelightsunflower==0.0.8
|
yeelightsunflower==0.0.8
|
||||||
|
@ -88,6 +88,10 @@ URL_PIN = ('https://home-assistant.io/developers/code_review_platform/'
|
|||||||
|
|
||||||
CONSTRAINT_PATH = os.path.join(os.path.dirname(__file__),
|
CONSTRAINT_PATH = os.path.join(os.path.dirname(__file__),
|
||||||
'../homeassistant/package_constraints.txt')
|
'../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):
|
def explore_module(package, explore_children):
|
||||||
@ -223,25 +227,25 @@ def write_test_requirements_file(data):
|
|||||||
def write_constraints_file(data):
|
def write_constraints_file(data):
|
||||||
"""Write constraints to a file."""
|
"""Write constraints to a file."""
|
||||||
with open(CONSTRAINT_PATH, 'w+', newline="\n") as req_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):
|
def validate_requirements_file(data):
|
||||||
"""Validate if requirements_all.txt is up to date."""
|
"""Validate if requirements_all.txt is up to date."""
|
||||||
with open('requirements_all.txt', 'r') as req_file:
|
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):
|
def validate_requirements_test_file(data):
|
||||||
"""Validate if requirements_all.txt is up to date."""
|
"""Validate if requirements_all.txt is up to date."""
|
||||||
with open('requirements_test_all.txt', 'r') as req_file:
|
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):
|
def validate_constraints_file(data):
|
||||||
"""Validate if constraints is up to date."""
|
"""Validate if constraints is up to date."""
|
||||||
with open(CONSTRAINT_PATH, 'r') as req_file:
|
with open(CONSTRAINT_PATH, 'r') as req_file:
|
||||||
return data == ''.join(req_file)
|
return data + CONSTRAINT_BASE == req_file.read()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
2
tox.ini
2
tox.ini
@ -15,6 +15,7 @@ commands =
|
|||||||
py.test --timeout=30 --duration=10 --cov --cov-report= {posargs}
|
py.test --timeout=30 --duration=10 --cov --cov-report= {posargs}
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements_test_all.txt
|
-r{toxinidir}/requirements_test_all.txt
|
||||||
|
-c{toxinidir}/homeassistant/package_constraints.txt
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
@ -22,6 +23,7 @@ ignore_errors = True
|
|||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements_all.txt
|
-r{toxinidir}/requirements_all.txt
|
||||||
-r{toxinidir}/requirements_test.txt
|
-r{toxinidir}/requirements_test.txt
|
||||||
|
-c{toxinidir}/homeassistant/package_constraints.txt
|
||||||
commands =
|
commands =
|
||||||
flake8
|
flake8
|
||||||
pylint homeassistant
|
pylint homeassistant
|
||||||
|
@ -29,8 +29,7 @@ COPY requirements_all.txt requirements_all.txt
|
|||||||
# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
|
# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
|
||||||
# See PR #8103 for more info.
|
# See PR #8103 for more info.
|
||||||
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
|
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
|
||||||
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet && \
|
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet
|
||||||
pip3 uninstall -y enum34
|
|
||||||
|
|
||||||
# BEGIN: Development additions
|
# BEGIN: Development additions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user