Skip to content
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

Fix setup error for logbook #29908

Merged
merged 4 commits into from Dec 13, 2019

Conversation

springstan
Copy link
Member

Breaking Change:

Description:

Related issue (if applicable): fixes #29845

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@project-bot project-bot bot added this to Needs review in Dev Dec 13, 2019
@springstan
Copy link
Member Author

springstan commented Dec 13, 2019

I do not know why the logbook fails to setup when the imports are at the top for the homekit integration.
It seems to be unrelated but somehow moving them back resolves the mentioned issue.
Any insight or investigation in this issue is appreciated :)

@balloob
Copy link
Member

balloob commented Dec 13, 2019

Logbook imports homekit constants. In Python, importing homeassistant.components.homekit.const means we'll import homeassistant.components.homekit, homeassistant.components etc because each part of the module path is either a file or a variable in that module.

@balloob
Copy link
Member

balloob commented Dec 13, 2019

We shouldn't revert it but instead add homekit to the after_dependencies of Logbook. I've added a PR #29491 for 104 that will make sure that those requirements are installed too.

It's annoying because really we should turn it around, have homekit register itself with logbook on how to render its events.

@springstan
Copy link
Member Author

@balloob okay thanks for the clarification on this issue, will close it now.

@springstan springstan closed this Dec 13, 2019
Dev automation moved this from Needs review to Cancelled Dec 13, 2019
@springstan springstan reopened this Dec 13, 2019
Dev automation moved this from Cancelled to Incoming Dec 13, 2019
@springstan
Copy link
Member Author

It is probably the best to solve this error in one PR instead of splitting it into two and therefore I reopened this PR to solve this problem by adding homekit as a after dependency to logbook as suggested by @balloob.

@project-bot project-bot bot moved this from Incoming to Needs review in Dev Dec 13, 2019
@balloob
Copy link
Member

balloob commented Dec 13, 2019

I've opened #29913 to better explain the issue and list things to solve to get to a solution.

I will go ahead and approve this PR today because we can hot fix this to get 103 working.

@balloob balloob added this to the 0.103.1 milestone Dec 13, 2019
Dev automation moved this from Needs review to Reviewer approved Dec 13, 2019
@balloob
Copy link
Member

balloob commented Dec 13, 2019

I did add it to the milestone but really that can only work if we can also include #29491 , so tagged that one too.

@balloob balloob merged commit 6b32603 into home-assistant:dev Dec 13, 2019
Dev automation moved this from Reviewer approved to Done Dec 13, 2019
@lock lock bot locked and limited conversation to collaborators Dec 14, 2019
@springstan springstan deleted the fix-logbook-setup-error branch April 7, 2020 14:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Logbook component broken after 72f336a (bisected)
3 participants