mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Revert "Update PyTurboJPEG to 2.2.0" (#168617)
This commit is contained in:
@@ -7,5 +7,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/camera",
|
||||
"integration_type": "entity",
|
||||
"quality_scale": "internal",
|
||||
"requirements": ["PyTurboJPEG==2.2.0"]
|
||||
"requirements": ["PyTurboJPEG==1.8.3"]
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
"integration_type": "system",
|
||||
"iot_class": "local_push",
|
||||
"quality_scale": "internal",
|
||||
"requirements": ["PyTurboJPEG==2.2.0", "av==16.0.1", "numpy==2.3.2"]
|
||||
"requirements": ["PyTurboJPEG==1.8.3", "av==16.0.1", "numpy==2.3.2"]
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ PyNaCl==1.6.2
|
||||
pyOpenSSL==26.0.0
|
||||
pyspeex-noise==1.0.2
|
||||
python-slugify==8.0.4
|
||||
PyTurboJPEG==2.2.0
|
||||
PyTurboJPEG==1.8.3
|
||||
PyYAML==6.0.3
|
||||
requests==2.33.1
|
||||
securetar==2026.4.1
|
||||
|
||||
Generated
+1
-1
@@ -44,7 +44,7 @@ pymicro-vad==1.0.1
|
||||
pyOpenSSL==26.0.0
|
||||
pyspeex-noise==1.0.2
|
||||
python-slugify==8.0.4
|
||||
PyTurboJPEG==2.2.0
|
||||
PyTurboJPEG==1.8.3
|
||||
PyYAML==6.0.3
|
||||
requests==2.33.1
|
||||
securetar==2026.4.1
|
||||
|
||||
Generated
+1
-1
@@ -96,7 +96,7 @@ PyTransportNSW==0.1.1
|
||||
|
||||
# homeassistant.components.camera
|
||||
# homeassistant.components.stream
|
||||
PyTurboJPEG==2.2.0
|
||||
PyTurboJPEG==1.8.3
|
||||
|
||||
# homeassistant.components.vicare
|
||||
PyViCare==2.59.0
|
||||
|
||||
Generated
+1
-1
@@ -93,7 +93,7 @@ PyTransportNSW==0.1.1
|
||||
|
||||
# homeassistant.components.camera
|
||||
# homeassistant.components.stream
|
||||
PyTurboJPEG==2.2.0
|
||||
PyTurboJPEG==1.8.3
|
||||
|
||||
# homeassistant.components.vicare
|
||||
PyViCare==2.59.0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Test img_util module."""
|
||||
|
||||
import logging
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
@@ -21,10 +22,6 @@ def _clear_turbojpeg_singleton():
|
||||
TurboJPEGSingleton.__instance = None
|
||||
|
||||
|
||||
def _reset_turbojpeg_singleton():
|
||||
TurboJPEGSingleton.__instance = TurboJPEG()
|
||||
|
||||
|
||||
def test_turbojpeg_singleton() -> None:
|
||||
"""Verify the instance always gives back the same."""
|
||||
_clear_turbojpeg_singleton()
|
||||
@@ -82,7 +79,9 @@ def test_scale_jpeg_camera_image() -> None:
|
||||
assert jpeg_bytes == EMPTY_16_12_JPEG
|
||||
|
||||
|
||||
def test_turbojpeg_load_failure() -> None:
|
||||
def test_turbojpeg_load_failure(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Handle libjpegturbo not being installed."""
|
||||
_clear_turbojpeg_singleton()
|
||||
with patch(
|
||||
@@ -90,10 +89,24 @@ def test_turbojpeg_load_failure() -> None:
|
||||
):
|
||||
TurboJPEGSingleton()
|
||||
assert TurboJPEGSingleton.instance() is False
|
||||
assert caplog.record_tuples == [
|
||||
(
|
||||
"homeassistant.components.camera.img_util",
|
||||
logging.ERROR,
|
||||
"Error loading libturbojpeg; Camera snapshot performance will be sub-optimal",
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def test_turbojpeg_load_success(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Handle libjpegturbo being installed."""
|
||||
_clear_turbojpeg_singleton()
|
||||
TurboJPEGSingleton()
|
||||
assert TurboJPEGSingleton.instance() is not None
|
||||
# Verify TurboJPEG was loaded successfully
|
||||
assert isinstance(TurboJPEGSingleton.instance(), TurboJPEG)
|
||||
assert caplog.record_tuples == []
|
||||
|
||||
|
||||
SCALE_TEST_EXPECTED = [
|
||||
|
||||
Reference in New Issue
Block a user