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

Adopt isort #1064

Merged
merged 4 commits into from
Aug 15, 2022
Merged

Adopt isort #1064

merged 4 commits into from
Aug 15, 2022

Conversation

coretl
Copy link
Collaborator

@coretl coretl commented Aug 5, 2022

Adopt isort for import ordering, run as a plugin to flake8 using flake8-isort. Adopt in a single commit as per black. Put that commit in .git-blame-ignore-revs so it can be ignored

Run as a plugin to flake8. Upper bound to flake8 while flake8-isort
releases a fix
All relative imports of the top level ophyd package in packages that are
themselves imported in the top level ophyd pacakge are changed to
point to the relevant subpackages.

E.g. if ophyd/__init__.py imports quadem, but quadem imports signal from
ophyd, and signal is alphabetically after quadem, then it won't be there

The fix is to import Signal from .signal instead of from ..
@coretl
Copy link
Collaborator Author

coretl commented Aug 5, 2022

@coretl
Copy link
Collaborator Author

coretl commented Aug 5, 2022

Note the changes I had to make in 6e503c9 as a result of ophyd/__init__.py imports being re-ordered (otherwise you get a circular import error). If these are too invasive I can back out and tell isort to ignore imports in ophyd/__init__.py

@coretl coretl mentioned this pull request Aug 5, 2022
@coretl coretl merged commit 2fa3d6d into master Aug 15, 2022
@coretl coretl deleted the isort branch August 15, 2022 08:27
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.

None yet

2 participants