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

Inline MQTT paho imports #29177

Merged
merged 5 commits into from Dec 2, 2019
Merged

Inline MQTT paho imports #29177

merged 5 commits into from Dec 2, 2019

Conversation

@balloob
Copy link
Member

balloob commented Nov 28, 2019

Description:

Some integrations rely optionally on MQTT (ie. OwnTracks, MySensors). These could no longer be imported because the MQTT imports would fail (mqtt is only an after_dependencies).

Related issue (if applicable): fixes #28464

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 the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@balloob balloob requested a review from home-assistant/core as a code owner Nov 28, 2019
@project-bot project-bot bot added this to Needs review in Dev Nov 28, 2019
@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Nov 28, 2019

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks!

@frenck

This comment has been minimized.

Copy link
Member

frenck commented Nov 28, 2019

Maybe we should explicitly add # pylint: disable=import-outside-toplevel to those lines?

This gives us the hint it was meant intentionally and makes enabling the rule in the future much easier.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 28, 2019

We may need to move this line too:

from hbmqtt.broker import Broker, BrokerException

@balloob

This comment has been minimized.

Copy link
Member Author

balloob commented Dec 1, 2019

Done & Done!

@MartinHjelmare MartinHjelmare moved this from Needs review to Review in progress in Dev Dec 1, 2019
@balloob

This comment has been minimized.

Copy link
Member Author

balloob commented Dec 1, 2019

Done!

Dev automation moved this from Review in progress to Reviewer approved Dec 2, 2019
@pvizeli

This comment has been minimized.

Copy link
Member

pvizeli commented Dec 2, 2019

Not sure if the better fix is to install also after_dependencies requirements. On docker, we have also most packages preinstall without getting an issue.

Now the mqtt after_dependencies work, but we need to make a list which integration can be an after_dependencies and there is no warranty that we don't run into the same issue on integration with different after_dependencies.

This PR feels not like a real bug fix. I can't approve this PR.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2019

Yeah, it's not optimal.

@balloob

This comment has been minimized.

Copy link
Member Author

balloob commented Dec 2, 2019

We install after_dependencies during check config.

The camera integration has stream as an after_dependencies, which doesn't easily install on all operating systems.

I want to go ahead and merge this, so that OwnTracks and MySensors can be used again.

We can come up with a better solution in the future.

@balloob balloob merged commit ffaa0e5 into dev Dec 2, 2019
10 of 11 checks passed
10 of 11 checks passed
codecov/patch 66.66% of diff hit (target 94.44%)
Details
CI #20191202.3 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/project 94.44% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Dec 2, 2019
@delete-merged-branch delete-merged-branch bot deleted the mqtt-imports branch Dec 2, 2019
@lock lock bot locked and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.