Skip to content

Commit

Permalink
Switch to using fast cached_property implementation in propcache (#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 3, 2024
1 parent 58f786f commit 0f29fd3
Show file tree
Hide file tree
Showing 81 changed files with 116 additions and 82 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_old-cython.txt"
Expand All @@ -234,7 +234,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"
Expand All @@ -248,7 +248,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"
Expand All @@ -262,7 +262,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;protobuf;pydantic;pymicro-vad;yarl
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtac"
2 changes: 1 addition & 1 deletion homeassistant/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from __future__ import annotations

from datetime import datetime, timedelta
from functools import cached_property
import secrets
from typing import Any, NamedTuple
import uuid

import attr
from attr import Attribute
from attr.setters import validate
from propcache import cached_property

from homeassistant.const import __version__
from homeassistant.data_entry_flow import FlowResult
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/airgradient/update.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Airgradient Update platform."""

from datetime import timedelta
from functools import cached_property

from propcache import cached_property

from homeassistant.components.update import UpdateDeviceClass, UpdateEntity
from homeassistant.core import HomeAssistant
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/alarm_control_panel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from __future__ import annotations

from datetime import timedelta
from functools import cached_property, partial
from functools import partial
import logging
from typing import Any, Final, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import asyncio
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from functools import cached_property, partial
from functools import partial
import logging
from typing import Any, Protocol, cast

from propcache import cached_property
import voluptuous as vol

from homeassistant.components import websocket_api
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

from datetime import timedelta
from enum import StrEnum
from functools import cached_property, partial
from functools import partial
import logging
from typing import Literal, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/button/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from datetime import timedelta
from enum import StrEnum
from functools import cached_property
import logging
from typing import final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from dataclasses import asdict
from datetime import datetime, timedelta
from enum import IntFlag
from functools import cached_property, partial
from functools import partial
import logging
import os
from random import SystemRandom
Expand All @@ -18,6 +18,7 @@

from aiohttp import hdrs, web
import attr
from propcache import cached_property
import voluptuous as vol

from homeassistant.components import websocket_api
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/climate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import asyncio
from datetime import timedelta
import functools as ft
from functools import cached_property
import logging
from typing import Any, Literal, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from datetime import timedelta
from enum import IntFlag, StrEnum
import functools as ft
from functools import cached_property
import logging
from typing import Any, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/date/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from __future__ import annotations

from datetime import date, timedelta
from functools import cached_property
import logging
from typing import final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/datetime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from __future__ import annotations

from datetime import UTC, datetime, timedelta
from functools import cached_property
import logging
from typing import final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/device_tracker/config_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from __future__ import annotations

import asyncio
from functools import cached_property
from typing import final

from propcache import cached_property

from homeassistant.components import zone
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/device_tracker/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import asyncio
from collections.abc import Callable, Coroutine, Sequence
from datetime import datetime, timedelta
from functools import cached_property
import hashlib
from types import ModuleType
from typing import Any, Final, Protocol, final

import attr
from propcache import cached_property
import voluptuous as vol

from homeassistant import util
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/dlna_dms/dms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dataclasses import dataclass
from enum import StrEnum
import functools
from functools import cached_property
from typing import Any, cast

from async_upnp_client.aiohttp import AiohttpSessionRequester
Expand All @@ -17,6 +16,7 @@
from async_upnp_client.exceptions import UpnpActionError, UpnpConnectionError, UpnpError
from async_upnp_client.profiles.dlna import ContentDirectoryErrorCode, DmsDevice
from didl_lite import didl_lite
from propcache import cached_property

from homeassistant.components import ssdp
from homeassistant.components.media_player import BrowseError, MediaClass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/doorbird/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from collections import defaultdict
from dataclasses import dataclass
from functools import cached_property
from http import HTTPStatus
import logging
from typing import Any
Expand All @@ -16,6 +15,7 @@
DoorBirdScheduleEntryOutput,
DoorBirdScheduleEntrySchedule,
)
from propcache import cached_property

from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/event/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
from dataclasses import asdict, dataclass
from datetime import datetime, timedelta
from enum import StrEnum
from functools import cached_property
import logging
from typing import Any, Self, final

from propcache import cached_property

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from datetime import timedelta
from enum import IntFlag
import functools as ft
from functools import cached_property
import logging
import math
from typing import Any, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ffmpeg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from __future__ import annotations

import asyncio
from functools import cached_property
import re

from haffmpeg.core import HAFFmpeg
from haffmpeg.tools import IMAGE_JPEG, FFVersion, ImageFrame
from propcache import cached_property
import voluptuous as vol

from homeassistant.const import (
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fints/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

from collections import namedtuple
from datetime import timedelta
from functools import cached_property
import logging
from typing import Any

from fints.client import FinTS3PinTanClient
from fints.models import SEPAAccount
from propcache import cached_property
import voluptuous as vol

from homeassistant.components.sensor import (
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from __future__ import annotations

from collections.abc import Callable, Iterator
from functools import cached_property, lru_cache, partial
from functools import lru_cache, partial
import logging
import os
import pathlib
from typing import Any, TypedDict

from aiohttp import hdrs, web, web_urldispatcher
import jinja2
from propcache import cached_property
import voluptuous as vol
from yarl import URL

Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/geo_location/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from __future__ import annotations

from datetime import timedelta
from functools import cached_property
import logging
from typing import Any, final

from propcache import cached_property

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import HomeAssistant
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

from functools import cached_property
import logging
from typing import Any, Final

Expand All @@ -17,6 +16,7 @@
)
from aiohomekit.model.services import Service, ServicesTypes
from aiohomekit.utils import clamp_enum_to_char
from propcache import cached_property

from homeassistant.components.climate import (
ATTR_HVAC_MODE,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from __future__ import annotations

from functools import cached_property
from typing import Any

from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import Service, ServicesTypes
from propcache import cached_property

from homeassistant.components.cover import (
ATTR_POSITION,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from __future__ import annotations

from functools import cached_property
from typing import Any

from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import Service, ServicesTypes
from propcache import cached_property

from homeassistant.components.fan import (
DIRECTION_FORWARD,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from __future__ import annotations

from functools import cached_property
from typing import Any

from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import Service, ServicesTypes
from propcache import cached_property

from homeassistant.components.humidifier import (
DEFAULT_MAX_HUMIDITY,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from __future__ import annotations

from functools import cached_property
from typing import Any

from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import Service, ServicesTypes
from propcache import cached_property

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/humidifier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

from datetime import timedelta
from enum import StrEnum
from functools import cached_property, partial
from functools import partial
import logging
from typing import Any, final

from propcache import cached_property
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
Expand Down
Loading

0 comments on commit 0f29fd3

Please sign in to comment.