-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Remove unnecessary functools.cached_property
backport
#114239
Conversation
) | ||
raise TypeError(msg) from None | ||
return val | ||
from functools import cached_property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do something similar to the deprecated const?
_DEPRECATED_SUPPORT_ALARM_ARM_VACATION: Final = DeprecatedConstantEnum( |
core/homeassistant/components/alarm_control_panel/const.py
Lines 74 to 78 in ff3a801
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals()) | |
__dir__ = partial( | |
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()] | |
) | |
__all__ = all_with_deprecated_constants(globals()) |
Importing and using a deprecated const will create a log entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be possible. For now I've copied the way from backports.enum
and added a new entry for the hass_imports
pylint plugin.
core/homeassistant/backports/enum.py
Lines 10 to 16 in 53944b2
from __future__ import annotations | |
from enum import StrEnum | |
__all__ = [ | |
"StrEnum", | |
] |
Would it be fine if we explore your idea after this is merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's fine to add it after this PR is merged. Maybe we can also add it for the enum one.
So we can remove the files et all after the deprecation period
Please hold off on merging until 2024.4 is released. I'm still doing testing with py3.11 until than and this would make it more difficult |
Support for 3.11 has been merged and removed today. Not sure how this PR would help with that? |
My test branch has reverts to keep py3.11 support so I can finish testing with Unfortunately this is the primary way I can catch blocking I/O in the event loop which is going to make issue a lot harder to debug after beta ends. We may end up with a time window between 3.11 and 3.13 support (which has python/cpython#106598) where these type of issues will be very difficult to debug so I'd like to fix as many as I can before than |
21567e7
to
4327992
Compare
Proposed change
The last support for Python 3.11 was removed in #114220. We can now also remove the backport for
functools.cached_property
.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: