Remove uvloop from default install and warn about stream+shell_command (#25929)

* Add warning about uvloop and shell_command

* Remove uvloop from docker files"

* Add ffmpeg
This commit is contained in:
Paulus Schoutsen 2019-08-15 14:11:39 -07:00 committed by GitHub
parent 6d1d95394c
commit 9b3aa9bbd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View File

@ -26,7 +26,7 @@ RUN virtualization/Docker/setup_docker_prereqs
# Install hass component dependencies
COPY requirements_all.txt requirements_all.txt
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython tensorflow
pip3 install --no-cache-dir mysqlclient psycopg2 cchardet cython tensorflow
# Copy source
COPY . .

View File

@ -4,6 +4,11 @@ import threading
import voluptuous as vol
try:
import uvloop
except ImportError:
uvloop = None
from homeassistant.auth.util import generate_secret
import homeassistant.helpers.config_validation as cv
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_FILENAME
@ -38,7 +43,7 @@ SERVICE_RECORD_SCHEMA = STREAM_SERVICE_SCHEMA.extend(
vol.Optional(CONF_LOOKBACK, default=0): int,
}
)
DATA_UVLOOP_WARN = "stream_uvloop_warn"
# Set log level to error for libav
logging.getLogger("libav").setLevel(logging.ERROR)
@ -49,6 +54,21 @@ def request_stream(hass, stream_source, *, fmt="hls", keepalive=False, options=N
if DOMAIN not in hass.config.components:
raise HomeAssistantError("Stream integration is not set up.")
if DATA_UVLOOP_WARN not in hass.data:
hass.data[DATA_UVLOOP_WARN] = True
# Warn about https://github.com/home-assistant/home-assistant/issues/22999
if (
uvloop is not None
and isinstance(hass.loop, uvloop.Loop)
and (
"shell_command" in hass.config.components
or "ffmpeg" in hass.config.components
)
):
_LOGGER.warning(
"You are using UVLoop with stream and shell_command. This is known to cause issues. Please uninstall uvloop."
)
if options is None:
options = {}

View File

@ -28,7 +28,7 @@ RUN virtualization/Docker/setup_docker_prereqs
COPY requirements_all.txt requirements_all.txt
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython
pip3 install --no-cache-dir mysqlclient psycopg2 cchardet cython
# BEGIN: Development additions