Update guppy to 3.1.5 (#134646)

This commit is contained in:
Franck Nijhof 2025-01-04 13:24:33 +01:00 committed by GitHub
parent baa13debcc
commit 584439cade
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 3 additions and 29 deletions

View File

@ -436,10 +436,6 @@ async def _async_generate_memory_profile(hass: HomeAssistant, call: ServiceCall)
# Imports deferred to avoid loading modules # Imports deferred to avoid loading modules
# in memory since usually only one part of this # in memory since usually only one part of this
# integration is used at a time # integration is used at a time
if sys.version_info >= (3, 13):
raise HomeAssistantError(
"Memory profiling is not supported on Python 3.13. Please use Python 3.12."
)
from guppy import hpy # pylint: disable=import-outside-toplevel from guppy import hpy # pylint: disable=import-outside-toplevel
start_time = int(time.time() * 1000000) start_time = int(time.time() * 1000000)

View File

@ -7,7 +7,7 @@
"quality_scale": "internal", "quality_scale": "internal",
"requirements": [ "requirements": [
"pyprof2calltree==1.4.5", "pyprof2calltree==1.4.5",
"guppy3==3.1.4.post1;python_version<'3.13'", "guppy3==3.1.5",
"objgraph==3.5.0" "objgraph==3.5.0"
], ],
"single_config_entry": true "single_config_entry": true

View File

@ -1079,7 +1079,7 @@ gspread==5.5.0
gstreamer-player==1.1.2 gstreamer-player==1.1.2
# homeassistant.components.profiler # homeassistant.components.profiler
guppy3==3.1.4.post1;python_version<'3.13' guppy3==3.1.5
# homeassistant.components.iaqualink # homeassistant.components.iaqualink
h2==4.1.0 h2==4.1.0

View File

@ -920,7 +920,7 @@ growattServer==1.5.0
gspread==5.5.0 gspread==5.5.0
# homeassistant.components.profiler # homeassistant.components.profiler
guppy3==3.1.4.post1;python_version<'3.13' guppy3==3.1.5
# homeassistant.components.iaqualink # homeassistant.components.iaqualink
h2==4.1.0 h2==4.1.0

View File

@ -5,7 +5,6 @@ from functools import lru_cache
import logging import logging
import os import os
from pathlib import Path from pathlib import Path
import sys
from unittest.mock import patch from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory from freezegun.api import FrozenDateTimeFactory
@ -71,9 +70,6 @@ async def test_basic_usage(hass: HomeAssistant, tmp_path: Path) -> None:
await hass.async_block_till_done() await hass.async_block_till_done()
@pytest.mark.skipif(
sys.version_info >= (3, 13), reason="not yet available on Python 3.13"
)
async def test_memory_usage(hass: HomeAssistant, tmp_path: Path) -> None: async def test_memory_usage(hass: HomeAssistant, tmp_path: Path) -> None:
"""Test we can setup and the service is registered.""" """Test we can setup and the service is registered."""
test_dir = tmp_path / "profiles" test_dir = tmp_path / "profiles"
@ -105,24 +101,6 @@ async def test_memory_usage(hass: HomeAssistant, tmp_path: Path) -> None:
await hass.async_block_till_done() await hass.async_block_till_done()
@pytest.mark.skipif(sys.version_info < (3, 13), reason="still works on python 3.12")
async def test_memory_usage_py313(hass: HomeAssistant, tmp_path: Path) -> None:
"""Test raise an error on python3.13."""
entry = MockConfigEntry(domain=DOMAIN)
entry.add_to_hass(hass)
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert hass.services.has_service(DOMAIN, SERVICE_MEMORY)
with pytest.raises(
HomeAssistantError,
match="Memory profiling is not supported on Python 3.13. Please use Python 3.12.",
):
await hass.services.async_call(
DOMAIN, SERVICE_MEMORY, {CONF_SECONDS: 0.000001}, blocking=True
)
async def test_object_growth_logging( async def test_object_growth_logging(
hass: HomeAssistant, hass: HomeAssistant,
caplog: pytest.LogCaptureFixture, caplog: pytest.LogCaptureFixture,