From 9c039a17ea232a23a3a55936d44b66366738020b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 16 May 2023 01:26:17 -0500 Subject: [PATCH] Bump guppy3 to 3.1.3 (#93124) --- homeassistant/components/profiler/__init__.py | 5 ----- .../components/profiler/manifest.json | 6 +---- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/profiler/test_init.py | 22 ------------------- 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/homeassistant/components/profiler/__init__.py b/homeassistant/components/profiler/__init__.py index f558b7301c5..ba5f25a1c02 100644 --- a/homeassistant/components/profiler/__init__.py +++ b/homeassistant/components/profiler/__init__.py @@ -403,11 +403,6 @@ async def _async_generate_memory_profile(hass: HomeAssistant, call: ServiceCall) # Imports deferred to avoid loading modules # in memory since usually only one part of this # integration is used at a time - if sys.version_info >= (3, 11): - raise HomeAssistantError( - "Memory profiling is not supported on Python 3.11. Please use Python 3.10." - ) - from guppy import hpy # pylint: disable=import-outside-toplevel start_time = int(time.time() * 1000000) diff --git a/homeassistant/components/profiler/manifest.json b/homeassistant/components/profiler/manifest.json index 81eb77537fb..1b33c778843 100644 --- a/homeassistant/components/profiler/manifest.json +++ b/homeassistant/components/profiler/manifest.json @@ -5,9 +5,5 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/profiler", "quality_scale": "internal", - "requirements": [ - "pyprof2calltree==1.4.5", - "guppy3==3.1.2;python_version<'3.11'", - "objgraph==3.5.0" - ] + "requirements": ["pyprof2calltree==1.4.5", "guppy3==3.1.3", "objgraph==3.5.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 219f3c728c8..6357efbf5a0 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -856,7 +856,7 @@ gspread==5.5.0 gstreamer-player==1.1.2 # homeassistant.components.profiler -guppy3==3.1.2;python_version<'3.11' +guppy3==3.1.3 # homeassistant.components.iaqualink h2==4.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 99b4d4f82fa..25f47998dce 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -660,7 +660,7 @@ growattServer==1.3.0 gspread==5.5.0 # homeassistant.components.profiler -guppy3==3.1.2;python_version<'3.11' +guppy3==3.1.3 # homeassistant.components.iaqualink h2==4.1.0 diff --git a/tests/components/profiler/test_init.py b/tests/components/profiler/test_init.py index ca998f25f5f..6f61b45518b 100644 --- a/tests/components/profiler/test_init.py +++ b/tests/components/profiler/test_init.py @@ -3,7 +3,6 @@ from datetime import timedelta from functools import lru_cache import os from pathlib import Path -import sys from unittest.mock import patch from lru import LRU # pylint: disable=no-name-in-module @@ -64,9 +63,6 @@ async def test_basic_usage(hass: HomeAssistant, tmp_path: Path) -> None: await hass.async_block_till_done() -@pytest.mark.skipif( - sys.version_info >= (3, 11), reason="not yet available on python 3.11" -) async def test_memory_usage(hass: HomeAssistant, tmp_path: Path) -> None: """Test we can setup and the service is registered.""" test_dir = tmp_path / "profiles" @@ -98,24 +94,6 @@ async def test_memory_usage(hass: HomeAssistant, tmp_path: Path) -> None: await hass.async_block_till_done() -@pytest.mark.skipif(sys.version_info < (3, 11), reason="still works on python 3.10") -async def test_memory_usage_py311(hass: HomeAssistant) -> None: - """Test raise an error on python3.11.""" - 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.11. Please use Python 3.10.", - ): - await hass.services.async_call( - DOMAIN, SERVICE_MEMORY, {CONF_SECONDS: 0.000001}, blocking=True - ) - - async def test_object_growth_logging( hass: HomeAssistant, caplog: pytest.LogCaptureFixture ) -> None: