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
Merged

Conversation

@springstan
Copy link
Member

springstan commented Dec 13, 2019

Breaking Change:

Description:

  • caused by: #29560
  • fixed by moving imports back into the setup function of the homekit integration

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

springstan commented Dec 13, 2019

@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

This comment has been minimized.

Copy link
Member Author

springstan commented Dec 13, 2019

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.

springstan added 3 commits Dec 13, 2019
…into fix-logbook-setup-error
@project-bot project-bot bot moved this from Incoming to Needs review in Dev Dec 13, 2019
@balloob

This comment has been minimized.

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

This comment has been minimized.

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
12 checks passed
12 checks passed
CI #20191213.29 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 1301a4f...81776f9
Details
codecov/project 94.49% (target 90%)
Details
docs-missing Documentation ok.
Dev automation moved this from Reviewer approved to Done Dec 13, 2019
@lock lock bot locked and limited conversation to collaborators Dec 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
3 participants
You can’t perform that action at this time.