From 77f38e33e58320f876535d7138b4e4cf9e7ee37d Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 23 Jul 2023 00:03:44 +0200 Subject: [PATCH] Import names from typing instead of typing_extensions [3.11] (#97065) --- homeassistant/backports/enum.py | 4 +--- homeassistant/backports/functools.py | 4 +--- homeassistant/components/counter/__init__.py | 2 +- homeassistant/components/esphome/domain_data.py | 4 +--- homeassistant/components/event/__init__.py | 4 +--- homeassistant/components/hassio/issues.py | 4 +--- homeassistant/components/input_boolean/__init__.py | 3 +-- homeassistant/components/input_button/__init__.py | 3 +-- homeassistant/components/input_datetime/__init__.py | 3 +-- homeassistant/components/input_number/__init__.py | 2 +- homeassistant/components/input_select/__init__.py | 3 +-- homeassistant/components/input_text/__init__.py | 2 +- homeassistant/components/integration/sensor.py | 3 +-- homeassistant/components/light/__init__.py | 3 +-- homeassistant/components/media_player/__init__.py | 3 +-- homeassistant/components/met/__init__.py | 3 +-- homeassistant/components/minio/minio_helper.py | 2 +- homeassistant/components/number/__init__.py | 3 +-- homeassistant/components/recorder/db_schema.py | 3 +-- homeassistant/components/sensor/__init__.py | 4 +--- homeassistant/components/stream/worker.py | 3 +-- homeassistant/components/template/binary_sensor.py | 3 +-- homeassistant/components/timer/__init__.py | 2 +- homeassistant/components/tuya/base.py | 3 +-- homeassistant/components/utility_meter/sensor.py | 3 +-- homeassistant/components/weather/__init__.py | 4 +--- homeassistant/components/yeelight/scanner.py | 2 +- homeassistant/components/zha/button.py | 3 +-- homeassistant/components/zha/core/device.py | 3 +-- homeassistant/components/zha/entity.py | 4 +--- homeassistant/components/zha/number.py | 3 +-- homeassistant/components/zha/select.py | 3 +-- homeassistant/components/zha/sensor.py | 3 +-- homeassistant/components/zha/switch.py | 3 +-- homeassistant/components/zone/__init__.py | 3 +-- homeassistant/config_entries.py | 4 +--- homeassistant/core.py | 2 +- homeassistant/data_entry_flow.py | 3 +-- homeassistant/helpers/check_config.py | 3 +-- homeassistant/helpers/httpx_client.py | 3 +-- homeassistant/helpers/restore_state.py | 4 +--- homeassistant/helpers/selector.py | 3 +-- homeassistant/util/timeout.py | 4 +--- tests/components/recorder/db_schema_30.py | 3 +-- tests/components/recorder/db_schema_32.py | 3 +-- 45 files changed, 45 insertions(+), 94 deletions(-) diff --git a/homeassistant/backports/enum.py b/homeassistant/backports/enum.py index 178859ecbe7..33cafe3b1dd 100644 --- a/homeassistant/backports/enum.py +++ b/homeassistant/backports/enum.py @@ -2,9 +2,7 @@ from __future__ import annotations from enum import Enum -from typing import Any - -from typing_extensions import Self +from typing import Any, Self class StrEnum(str, Enum): diff --git a/homeassistant/backports/functools.py b/homeassistant/backports/functools.py index c7ab0d08693..ddcbab7dfc0 100644 --- a/homeassistant/backports/functools.py +++ b/homeassistant/backports/functools.py @@ -3,9 +3,7 @@ from __future__ import annotations from collections.abc import Callable from types import GenericAlias -from typing import Any, Generic, TypeVar, overload - -from typing_extensions import Self +from typing import Any, Generic, Self, TypeVar, overload _T = TypeVar("_T") _R = TypeVar("_R") diff --git a/homeassistant/components/counter/__init__.py b/homeassistant/components/counter/__init__.py index 6f3d48fc1bb..f946f29bdaa 100644 --- a/homeassistant/components/counter/__init__.py +++ b/homeassistant/components/counter/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations import logging +from typing import Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/esphome/domain_data.py b/homeassistant/components/esphome/domain_data.py index 3203964fdc1..bf7c5d9c969 100644 --- a/homeassistant/components/esphome/domain_data.py +++ b/homeassistant/components/esphome/domain_data.py @@ -2,9 +2,7 @@ from __future__ import annotations from dataclasses import dataclass, field -from typing import cast - -from typing_extensions import Self +from typing import Self, cast from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant diff --git a/homeassistant/components/event/__init__.py b/homeassistant/components/event/__init__.py index 48bb2fd1726..a98a3fa6c3f 100644 --- a/homeassistant/components/event/__init__.py +++ b/homeassistant/components/event/__init__.py @@ -4,9 +4,7 @@ from __future__ import annotations from dataclasses import asdict, dataclass from datetime import datetime, timedelta import logging -from typing import Any, final - -from typing_extensions import Self +from typing import Any, Self, final from homeassistant.backports.enum import StrEnum from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/hassio/issues.py b/homeassistant/components/hassio/issues.py index 0bbd89aab86..8bd47faef08 100644 --- a/homeassistant/components/hassio/issues.py +++ b/homeassistant/components/hassio/issues.py @@ -4,9 +4,7 @@ from __future__ import annotations import asyncio from dataclasses import dataclass, field import logging -from typing import Any, TypedDict - -from typing_extensions import NotRequired +from typing import Any, NotRequired, TypedDict from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect diff --git a/homeassistant/components/input_boolean/__init__.py b/homeassistant/components/input_boolean/__init__.py index 33cb4b9e576..a074b3b9b65 100644 --- a/homeassistant/components/input_boolean/__init__.py +++ b/homeassistant/components/input_boolean/__init__.py @@ -2,9 +2,8 @@ from __future__ import annotations import logging -from typing import Any +from typing import Any, Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/input_button/__init__.py b/homeassistant/components/input_button/__init__.py index 8a1f0785435..c04b18b0c25 100644 --- a/homeassistant/components/input_button/__init__.py +++ b/homeassistant/components/input_button/__init__.py @@ -2,9 +2,8 @@ from __future__ import annotations import logging -from typing import cast +from typing import Self, cast -from typing_extensions import Self import voluptuous as vol from homeassistant.components.button import SERVICE_PRESS, ButtonEntity diff --git a/homeassistant/components/input_datetime/__init__.py b/homeassistant/components/input_datetime/__init__.py index 8762769194f..81882137fad 100644 --- a/homeassistant/components/input_datetime/__init__.py +++ b/homeassistant/components/input_datetime/__init__.py @@ -3,9 +3,8 @@ from __future__ import annotations import datetime as py_datetime import logging -from typing import Any +from typing import Any, Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/input_number/__init__.py b/homeassistant/components/input_number/__init__.py index 061b388ace5..197a35246d2 100644 --- a/homeassistant/components/input_number/__init__.py +++ b/homeassistant/components/input_number/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from contextlib import suppress import logging +from typing import Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/input_select/__init__.py b/homeassistant/components/input_select/__init__.py index 2c5a1c87f29..e1354cb26a5 100644 --- a/homeassistant/components/input_select/__init__.py +++ b/homeassistant/components/input_select/__init__.py @@ -2,9 +2,8 @@ from __future__ import annotations import logging -from typing import Any, cast +from typing import Any, Self, cast -from typing_extensions import Self import voluptuous as vol from homeassistant.components.select import ( diff --git a/homeassistant/components/input_text/__init__.py b/homeassistant/components/input_text/__init__.py index efd58e38e72..096e7cbb105 100644 --- a/homeassistant/components/input_text/__init__.py +++ b/homeassistant/components/input_text/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations import logging +from typing import Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/integration/sensor.py b/homeassistant/components/integration/sensor.py index af4248e5e3b..e4ae3cde883 100644 --- a/homeassistant/components/integration/sensor.py +++ b/homeassistant/components/integration/sensor.py @@ -4,9 +4,8 @@ from __future__ import annotations from dataclasses import dataclass from decimal import Decimal, DecimalException, InvalidOperation import logging -from typing import Any, Final +from typing import Any, Final, Self -from typing_extensions import Self import voluptuous as vol from homeassistant.components.sensor import ( diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 0c3a711a738..0f49ab605a7 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -8,9 +8,8 @@ from datetime import timedelta from enum import IntFlag import logging import os -from typing import Any, cast, final +from typing import Any, Self, cast, final -from typing_extensions import Self import voluptuous as vol from homeassistant.backports.enum import StrEnum diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index f9c68e2b1f0..36512620e51 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -12,14 +12,13 @@ import hashlib from http import HTTPStatus import logging import secrets -from typing import Any, Final, TypedDict, final +from typing import Any, Final, Required, TypedDict, final from urllib.parse import quote, urlparse from aiohttp import web from aiohttp.hdrs import CACHE_CONTROL, CONTENT_TYPE from aiohttp.typedefs import LooseHeaders import async_timeout -from typing_extensions import Required import voluptuous as vol from yarl import URL diff --git a/homeassistant/components/met/__init__.py b/homeassistant/components/met/__init__.py index 32b095230d9..16bfc93f715 100644 --- a/homeassistant/components/met/__init__.py +++ b/homeassistant/components/met/__init__.py @@ -6,10 +6,9 @@ from datetime import timedelta import logging from random import randrange from types import MappingProxyType -from typing import Any +from typing import Any, Self import metno -from typing_extensions import Self from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( diff --git a/homeassistant/components/minio/minio_helper.py b/homeassistant/components/minio/minio_helper.py index a5068e1a47b..7edb11797eb 100644 --- a/homeassistant/components/minio/minio_helper.py +++ b/homeassistant/components/minio/minio_helper.py @@ -8,10 +8,10 @@ from queue import Queue import re import threading import time +from typing import Self from urllib.parse import unquote from minio import Minio -from typing_extensions import Self from urllib3.exceptions import HTTPError _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/number/__init__.py b/homeassistant/components/number/__init__.py index 24c44b901a1..aa3566c5a95 100644 --- a/homeassistant/components/number/__init__.py +++ b/homeassistant/components/number/__init__.py @@ -8,9 +8,8 @@ from datetime import timedelta import inspect import logging from math import ceil, floor -from typing import Any, final +from typing import Any, Self, final -from typing_extensions import Self import voluptuous as vol from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/recorder/db_schema.py b/homeassistant/components/recorder/db_schema.py index 0743864aaf7..c99aadb8caa 100644 --- a/homeassistant/components/recorder/db_schema.py +++ b/homeassistant/components/recorder/db_schema.py @@ -5,7 +5,7 @@ from collections.abc import Callable from datetime import datetime, timedelta import logging import time -from typing import Any, cast +from typing import Any, Self, cast import ciso8601 from fnv_hash_fast import fnv1a_32 @@ -33,7 +33,6 @@ from sqlalchemy.engine.interfaces import Dialect from sqlalchemy.ext.compiler import compiles from sqlalchemy.orm import DeclarativeBase, Mapped, aliased, mapped_column, relationship from sqlalchemy.types import TypeDecorator -from typing_extensions import Self from homeassistant.const import ( MAX_LENGTH_EVENT_EVENT_TYPE, diff --git a/homeassistant/components/sensor/__init__.py b/homeassistant/components/sensor/__init__.py index e8303c12c10..4d76c803da6 100644 --- a/homeassistant/components/sensor/__init__.py +++ b/homeassistant/components/sensor/__init__.py @@ -11,9 +11,7 @@ import logging from math import ceil, floor, log10 import re import sys -from typing import Any, Final, cast, final - -from typing_extensions import Self +from typing import Any, Final, Self, cast, final from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/stream/worker.py b/homeassistant/components/stream/worker.py index caa3d974d04..c237a820e58 100644 --- a/homeassistant/components/stream/worker.py +++ b/homeassistant/components/stream/worker.py @@ -8,11 +8,10 @@ import datetime from io import SEEK_END, BytesIO import logging from threading import Event -from typing import Any, cast +from typing import Any, Self, cast import attr import av -from typing_extensions import Self from homeassistant.core import HomeAssistant diff --git a/homeassistant/components/template/binary_sensor.py b/homeassistant/components/template/binary_sensor.py index 923b6167851..61df78307f0 100644 --- a/homeassistant/components/template/binary_sensor.py +++ b/homeassistant/components/template/binary_sensor.py @@ -5,9 +5,8 @@ from dataclasses import dataclass from datetime import datetime, timedelta from functools import partial import logging -from typing import Any +from typing import Any, Self -from typing_extensions import Self import voluptuous as vol from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/timer/__init__.py b/homeassistant/components/timer/__init__.py index 3752f9c9cb5..228e2071b4a 100644 --- a/homeassistant/components/timer/__init__.py +++ b/homeassistant/components/timer/__init__.py @@ -4,8 +4,8 @@ from __future__ import annotations from collections.abc import Callable from datetime import datetime, timedelta import logging +from typing import Self -from typing_extensions import Self import voluptuous as vol from homeassistant.const import ( diff --git a/homeassistant/components/tuya/base.py b/homeassistant/components/tuya/base.py index 2658f50edad..998e5a55e63 100644 --- a/homeassistant/components/tuya/base.py +++ b/homeassistant/components/tuya/base.py @@ -5,10 +5,9 @@ import base64 from dataclasses import dataclass import json import struct -from typing import Any, Literal, overload +from typing import Any, Literal, Self, overload from tuya_iot import TuyaDevice, TuyaDeviceManager -from typing_extensions import Self from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import DeviceInfo, Entity diff --git a/homeassistant/components/utility_meter/sensor.py b/homeassistant/components/utility_meter/sensor.py index f52b78b5a52..db03a1ccf2e 100644 --- a/homeassistant/components/utility_meter/sensor.py +++ b/homeassistant/components/utility_meter/sensor.py @@ -5,10 +5,9 @@ from dataclasses import dataclass from datetime import datetime, timedelta from decimal import Decimal, DecimalException, InvalidOperation import logging -from typing import Any +from typing import Any, Self from croniter import croniter -from typing_extensions import Self import voluptuous as vol from homeassistant.components.sensor import ( diff --git a/homeassistant/components/weather/__init__.py b/homeassistant/components/weather/__init__.py index c63db816711..89bd601fdae 100644 --- a/homeassistant/components/weather/__init__.py +++ b/homeassistant/components/weather/__init__.py @@ -7,9 +7,7 @@ from dataclasses import dataclass from datetime import timedelta import inspect import logging -from typing import Any, Final, Literal, TypedDict, final - -from typing_extensions import Required +from typing import Any, Final, Literal, Required, TypedDict, final from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( diff --git a/homeassistant/components/yeelight/scanner.py b/homeassistant/components/yeelight/scanner.py index dc4283b4a76..7c6bbd2d2ee 100644 --- a/homeassistant/components/yeelight/scanner.py +++ b/homeassistant/components/yeelight/scanner.py @@ -7,12 +7,12 @@ import contextlib from datetime import datetime from ipaddress import IPv4Address import logging +from typing import Self from urllib.parse import urlparse import async_timeout from async_upnp_client.search import SsdpSearchListener from async_upnp_client.utils import CaseInsensitiveDict -from typing_extensions import Self from homeassistant import config_entries from homeassistant.components import network, ssdp diff --git a/homeassistant/components/zha/button.py b/homeassistant/components/zha/button.py index 010c0f63e27..b3b6e7f0483 100644 --- a/homeassistant/components/zha/button.py +++ b/homeassistant/components/zha/button.py @@ -4,9 +4,8 @@ from __future__ import annotations import abc import functools import logging -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self import zigpy.exceptions from zigpy.zcl.foundation import Status diff --git a/homeassistant/components/zha/core/device.py b/homeassistant/components/zha/core/device.py index 51ab65e3318..1455173b27c 100644 --- a/homeassistant/components/zha/core/device.py +++ b/homeassistant/components/zha/core/device.py @@ -8,9 +8,8 @@ from enum import Enum import logging import random import time -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self from zigpy import types import zigpy.device import zigpy.exceptions diff --git a/homeassistant/components/zha/entity.py b/homeassistant/components/zha/entity.py index 97258a77e2b..43f487f61d4 100644 --- a/homeassistant/components/zha/entity.py +++ b/homeassistant/components/zha/entity.py @@ -5,9 +5,7 @@ import asyncio from collections.abc import Callable import functools import logging -from typing import TYPE_CHECKING, Any - -from typing_extensions import Self +from typing import TYPE_CHECKING, Any, Self from homeassistant.const import ATTR_NAME from homeassistant.core import CALLBACK_TYPE, Event, callback diff --git a/homeassistant/components/zha/number.py b/homeassistant/components/zha/number.py index 29d6cafe3c8..807a5e73d00 100644 --- a/homeassistant/components/zha/number.py +++ b/homeassistant/components/zha/number.py @@ -3,9 +3,8 @@ from __future__ import annotations import functools import logging -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self import zigpy.exceptions from zigpy.zcl.foundation import Status diff --git a/homeassistant/components/zha/select.py b/homeassistant/components/zha/select.py index 27b71484f3e..e6f2f6ab482 100644 --- a/homeassistant/components/zha/select.py +++ b/homeassistant/components/zha/select.py @@ -4,9 +4,8 @@ from __future__ import annotations from enum import Enum import functools import logging -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self from zigpy import types from zigpy.zcl.clusters.general import OnOff from zigpy.zcl.clusters.security import IasWd diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index d13dd871865..49ba46038f9 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -5,9 +5,8 @@ import enum import functools import numbers import sys -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self from zigpy import types from homeassistant.components.climate import HVACAction diff --git a/homeassistant/components/zha/switch.py b/homeassistant/components/zha/switch.py index 451d96a122b..f975cc5116d 100644 --- a/homeassistant/components/zha/switch.py +++ b/homeassistant/components/zha/switch.py @@ -3,9 +3,8 @@ from __future__ import annotations import functools import logging -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Self -from typing_extensions import Self import zigpy.exceptions from zigpy.zcl.clusters.general import OnOff from zigpy.zcl.foundation import Status diff --git a/homeassistant/components/zone/__init__.py b/homeassistant/components/zone/__init__.py index 35d835c8f16..8d04987d4fa 100644 --- a/homeassistant/components/zone/__init__.py +++ b/homeassistant/components/zone/__init__.py @@ -4,9 +4,8 @@ from __future__ import annotations from collections.abc import Callable import logging from operator import attrgetter -from typing import Any, cast +from typing import Any, Self, cast -from typing_extensions import Self import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index a1c09b8815f..6fa80406e61 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -11,9 +11,7 @@ import functools import logging from random import randint from types import MappingProxyType -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from typing_extensions import Self +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast from . import data_entry_flow, loader from .backports.enum import StrEnum diff --git a/homeassistant/core.py b/homeassistant/core.py index 6ea03e85c43..8bb30f5d57d 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -31,6 +31,7 @@ from typing import ( Any, Generic, ParamSpec, + Self, TypeVar, cast, overload, @@ -38,7 +39,6 @@ from typing import ( from urllib.parse import urlparse import async_timeout -from typing_extensions import Self import voluptuous as vol import yarl diff --git a/homeassistant/data_entry_flow.py b/homeassistant/data_entry_flow.py index 6f125ce359a..c0a5860529e 100644 --- a/homeassistant/data_entry_flow.py +++ b/homeassistant/data_entry_flow.py @@ -7,9 +7,8 @@ import copy from dataclasses import dataclass import logging from types import MappingProxyType -from typing import Any, TypedDict +from typing import Any, Required, TypedDict -from typing_extensions import Required import voluptuous as vol from .backports.enum import StrEnum diff --git a/homeassistant/helpers/check_config.py b/homeassistant/helpers/check_config.py index ba69a76fbdd..a580c013cd0 100644 --- a/homeassistant/helpers/check_config.py +++ b/homeassistant/helpers/check_config.py @@ -5,9 +5,8 @@ from collections import OrderedDict import logging import os from pathlib import Path -from typing import NamedTuple +from typing import NamedTuple, Self -from typing_extensions import Self import voluptuous as vol from homeassistant import loader diff --git a/homeassistant/helpers/httpx_client.py b/homeassistant/helpers/httpx_client.py index 93b199b1db5..ed02f8a710e 100644 --- a/homeassistant/helpers/httpx_client.py +++ b/homeassistant/helpers/httpx_client.py @@ -3,10 +3,9 @@ from __future__ import annotations from collections.abc import Callable import sys -from typing import Any +from typing import Any, Self import httpx -from typing_extensions import Self from homeassistant.const import APPLICATION_NAME, EVENT_HOMEASSISTANT_CLOSE, __version__ from homeassistant.core import Event, HomeAssistant, callback diff --git a/homeassistant/helpers/restore_state.py b/homeassistant/helpers/restore_state.py index ab3b93cf3c4..4dd71a584ec 100644 --- a/homeassistant/helpers/restore_state.py +++ b/homeassistant/helpers/restore_state.py @@ -4,9 +4,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from datetime import datetime, timedelta import logging -from typing import Any, cast - -from typing_extensions import Self +from typing import Any, Self, cast from homeassistant.const import ATTR_RESTORED, EVENT_HOMEASSISTANT_STOP from homeassistant.core import HomeAssistant, State, callback, valid_entity_id diff --git a/homeassistant/helpers/selector.py b/homeassistant/helpers/selector.py index c7087918cf0..b97f781eaf3 100644 --- a/homeassistant/helpers/selector.py +++ b/homeassistant/helpers/selector.py @@ -4,10 +4,9 @@ from __future__ import annotations from collections.abc import Callable, Mapping, Sequence from enum import IntFlag from functools import cache -from typing import Any, Generic, Literal, TypedDict, TypeVar, cast +from typing import Any, Generic, Literal, Required, TypedDict, TypeVar, cast from uuid import UUID -from typing_extensions import Required import voluptuous as vol from homeassistant.backports.enum import StrEnum diff --git a/homeassistant/util/timeout.py b/homeassistant/util/timeout.py index 9d9f5d986a0..6c1de55748f 100644 --- a/homeassistant/util/timeout.py +++ b/homeassistant/util/timeout.py @@ -8,9 +8,7 @@ from __future__ import annotations import asyncio import enum from types import TracebackType -from typing import Any - -from typing_extensions import Self +from typing import Any, Self from .async_ import run_callback_threadsafe diff --git a/tests/components/recorder/db_schema_30.py b/tests/components/recorder/db_schema_30.py index 40417752719..55bee20df56 100644 --- a/tests/components/recorder/db_schema_30.py +++ b/tests/components/recorder/db_schema_30.py @@ -9,7 +9,7 @@ from collections.abc import Callable from datetime import datetime, timedelta import logging import time -from typing import Any, TypedDict, cast, overload +from typing import Any, Self, TypedDict, cast, overload import ciso8601 from fnv_hash_fast import fnv1a_32 @@ -34,7 +34,6 @@ from sqlalchemy import ( from sqlalchemy.dialects import mysql, oracle, postgresql, sqlite from sqlalchemy.orm import aliased, declarative_base, relationship from sqlalchemy.orm.session import Session -from typing_extensions import Self from homeassistant.components.recorder.const import SupportedDialect from homeassistant.const import ( diff --git a/tests/components/recorder/db_schema_32.py b/tests/components/recorder/db_schema_32.py index 03a71697227..660a2a54d4b 100644 --- a/tests/components/recorder/db_schema_32.py +++ b/tests/components/recorder/db_schema_32.py @@ -9,7 +9,7 @@ from collections.abc import Callable from datetime import datetime, timedelta import logging import time -from typing import Any, TypedDict, cast, overload +from typing import Any, Self, TypedDict, cast, overload import ciso8601 from fnv_hash_fast import fnv1a_32 @@ -34,7 +34,6 @@ from sqlalchemy import ( from sqlalchemy.dialects import mysql, oracle, postgresql, sqlite from sqlalchemy.orm import aliased, declarative_base, relationship from sqlalchemy.orm.session import Session -from typing_extensions import Self from homeassistant.components.recorder.const import SupportedDialect from homeassistant.const import (