Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update guppy3 to 3.1.4 #102400

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions homeassistant/components/profiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,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, 12):
raise HomeAssistantError(
"Memory profiling is not supported on Python 3.12. Please use Python 3.11."
)

from guppy import hpy # pylint: disable=import-outside-toplevel

start_time = int(time.time() * 1000000)
Expand Down
6 changes: 1 addition & 5 deletions homeassistant/components/profiler/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.3;python_version<'3.12'",
"objgraph==3.5.0"
]
"requirements": ["pyprof2calltree==1.4.5", "guppy3==3.1.4", "objgraph==3.5.0"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ gspread==5.5.0
gstreamer-player==1.1.2

# homeassistant.components.profiler
guppy3==3.1.3;python_version<'3.12'
guppy3==3.1.4

# homeassistant.components.iaqualink
h2==4.1.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ growattServer==1.3.0
gspread==5.5.0

# homeassistant.components.profiler
guppy3==3.1.3;python_version<'3.12'
guppy3==3.1.4

# homeassistant.components.iaqualink
h2==4.1.0
Expand Down
22 changes: 0 additions & 22 deletions tests/components/profiler/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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
Expand Down Expand Up @@ -64,9 +63,6 @@ def _mock_path(filename: str) -> str:
await hass.async_block_till_done()


@pytest.mark.skipif(
sys.version_info >= (3, 12), reason="not yet available on Python 3.12"
)
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"
Expand Down Expand Up @@ -98,24 +94,6 @@ def _mock_path(filename: str) -> str:
await hass.async_block_till_done()


@pytest.mark.skipif(sys.version_info < (3, 12), reason="still works on python 3.11")
async def test_memory_usage_py312(hass: HomeAssistant, tmp_path: Path) -> 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.12. Please use Python 3.11.",
):
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:
Expand Down
Loading