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
merged 4 commits into from Mar 21, 2019

Conversation

Projects
None yet
4 participants
@balloob
Copy link
Member

commented Mar 21, 2019

Description:

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 = fil.parent.name
    to_find = f"homeassistant.components.{domain}"
    to_replace = "."

    with open(fil) as fp:
        content = fp.read()

    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
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
Hound No violations found. Woof!
Python 3.5 - lints Python 3.5 - lints
Details
Python 3.5 - tests Python 3.5 - tests
Details
Python 3.6 - tests Python 3.6 - tests
Details
Python 3.7 - tests Python 3.7 - tests
Details
Pyton 3.5 - typing Pyton 3.5 - typing
Details
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

Closed

Use relative imports for ESPHome #22157

0 of 9 tasks complete

@balloob balloob referenced this pull request Apr 3, 2019

Merged

0.91.0 #22688

@zewelor zewelor referenced this pull request Apr 7, 2019

Merged

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.