-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Load requirements and dependencies from manifests. Fallback to current REQUIREMENTS
and DEPENDENCIES
#22717
Conversation
Will fix in the evening. Thanks for the feedback. |
aa627de
to
23580d8
Compare
Fix tests in helpers folder
Add - loader.set_component(self.hass, 'test_domain.platform', platform)
+ mock_entity_platform(self.hass, 'test_domain.platform', platform) |
ae23522
to
6820f45
Compare
@balloob I have to go, won't check in code for this PR today. Feel free to change whatever need |
Temp workaround to unblock CI tests
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think I got last one fixed. When it's green, let's merge |
"fixed" google tts. Now load google tts platform will setup google component as well. I add a shortcut in google component to allow test pass. However it may break the google component, e.g. google calendar and tts cannot configured together. We need reorg google tts to a separate folder, such as |
Breaking Change:
To developers: Setup entity platform will set up its component now despite DEPENDENCIES.
For example, if you have an integration
smart_home
, it has some connection management code insmart_home/__init__.py
and it provideslight
andsensor
. Insmart_home/light.py
, it hasDEPENDENCIES=['smart_home']
, it will usesmart_home/__init__.py
to manage its connection. So whenlight
domain set up its platform, it will loadsmart_home/light.py
, then as the dependencies's require,smart_home/__init__.py
will be load and itsasync_setup()
method will be called. The process is not changed, however, such dependencies pointed to its own component is not required anymore, because we will load and set up thesmart_home
component as long as you set upsmart_home/light.py
no matter DEPENDENCIES exists or not.On the other hand, let's say
smart_home/sensor.py
does not rely onsmart_home/__init__.py
, so there is no DEPENDENCIES insmart_home/sensor.py
. After this PR, the behavior changed, we will load and set up thesmart_home
component as long as you set upsmart_home/sensor.py
Such behavior change may break your component. As far as I know, following component will have problem after this PR merged
demo
google
telegram
Description:
Load requirements and dependencies from manifests (if present). If not, fallback to the current approach of reading
REQUIREMENTS
andDEPENDENCIES
from the module attribute.Related issue (if applicable): relates to #22700
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code does not interact with devices: