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

Keep imports properly sorted with isort #128

Merged
merged 1 commit into from
Aug 31, 2021
Merged

Keep imports properly sorted with isort #128

merged 1 commit into from
Aug 31, 2021

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Aug 31, 2021

This PR adds the isort utility to the lint environment in tox as well as the flake8-isort plugin to the flake8 quality assurance testing. Since #127 was merged, this means that this check will be run on all PRs. As you can see by the big diff, there's quite a bit of cleanup it already did!

One thing to consider later (not for accepting this PR) is that there is a mix of absolute and relative imports. While I'm definitely going against the grain here, I think that packages should only be using relative imports, to remind you never to rely on being able to run python files in packages as scripts (instead, the solution is to pip install then use python -m ...)

@matentzn
Copy link
Collaborator

Great - so when I run "tox" now it will sort the imports automatically correctly?

@cthoyt
Copy link
Member Author

cthoyt commented Aug 31, 2021

Yes

@matentzn matentzn merged commit fd6f15f into master Aug 31, 2021
@matentzn matentzn deleted the isort branch August 31, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants