[core] Drop Python 3.11 support (#17280)

This commit is contained in:
Jonathan Swoboda
2026-06-29 12:32:28 -04:00
committed by GitHub
parent 2778c62d07
commit b8690c8e31
16 changed files with 58 additions and 152 deletions
+2 -3
View File
@@ -19,7 +19,6 @@ from aioesphomeapi import (
_LOGGER = logging.getLogger(__name__)
T = TypeVar("T", bound=EntityInfo)
S = TypeVar("S", bound=EntityState)
@@ -58,7 +57,7 @@ async def wait_for_state(
return await asyncio.wait_for(future, timeout=timeout)
def find_entity(
def find_entity[T: EntityInfo](
entities: list[EntityInfo],
object_id_substring: str,
entity_type: type[T] | None = None,
@@ -86,7 +85,7 @@ def find_entity(
return None
def require_entity(
def require_entity[T: EntityInfo](
entities: list[EntityInfo],
object_id_substring: str,
entity_type: type[T] | None = None,
@@ -658,11 +658,6 @@ def test_get_python_env_executable_path_nt() -> None:
class TestTarExtractAllBranches:
@pytest.mark.skipif(
sys.version_info < (3, 12),
reason="patching os.name makes pathlib build a WindowsPath, which only "
"instantiates on POSIX in 3.12+",
)
def test_windows_drive_path_skipped(self, tmp_path: Path) -> None:
"""Windows-style drive path (C:/...) is skipped when os.name == 'nt'."""
info = tarfile.TarInfo(name="C:/secret.txt")
@@ -755,11 +750,6 @@ class TestTarExtractAllBranches:
class TestZipExtractAllBranches:
@pytest.mark.skipif(
sys.version_info < (3, 12),
reason="patching os.name makes pathlib build a WindowsPath, which only "
"instantiates on POSIX in 3.12+",
)
def test_windows_drive_path_skipped(self, tmp_path: Path) -> None:
"""Windows-style drive path (C:/...) is skipped when os.name == 'nt'."""
buf = _make_zip([("C:/secret.txt", "bad")])