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

Use relative imports inside integrations #22235

merged 4 commits into from Mar 21, 2019


None yet
4 participants
Copy link

commented Mar 21, 2019


Use relative imports inside integrations

Related issue (if applicable): fixes home-assistant/architecture#180

Used this script, then isort on changed files and then some manual work afterwards to fix it:

import pathlib

path = pathlib.Path('./homeassistant/components/')

for fil in path.glob('*/*.py'):
    domain =
    to_find = f"homeassistant.components.{domain}"
    to_replace = "."

    with open(fil) as fp:
        content =

    with open(fil, 'w') as fp:
        fp.write(content.replace(to_find, to_replace))

balloob added some commits Mar 21, 2019

@balloob balloob merged commit 4b1de61 into dev Mar 21, 2019

7 of 9 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
continuous-integration/travis-ci/push The Travis CI build is in progress
Hound No violations found. Woof!
Python 3.5 - lints Python 3.5 - lints
Python 3.5 - tests Python 3.5 - tests
Python 3.6 - tests Python 3.6 - tests
Python 3.7 - tests Python 3.7 - tests
Pyton 3.5 - typing Pyton 3.5 - typing
cla-bot Everyone involved has signed the CLA

@ghost ghost removed the in progress label Mar 21, 2019

@delete-merged-branch delete-merged-branch bot deleted the relative-imports branch Mar 21, 2019

@balloob balloob referenced this pull request Mar 21, 2019


Use relative imports for ESPHome #22157

0 of 9 tasks complete

@balloob balloob referenced this pull request Apr 3, 2019


0.91.0 #22688

@zewelor zewelor referenced this pull request Apr 7, 2019


Use relative imports in yeelight #22839

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.