-
-
Notifications
You must be signed in to change notification settings - Fork 735
Add isort to pre-commit hooks, package resorting #4600
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
Conversation
Trying to wrap my head around the failures, which all seem to be based around the same failure:
Does this have to do with the ordering of the config imports in distributed/distributed/__init__.py Lines 1 to 4 in de60c90
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @charlesbluca!
Could I ask you coordinate with @jsignell over in dask/dask#7370 to make sure we use the same isort
settings in both dask
and distributed
?
Regarding the config errors, I think you're right that the location of from . import config
matters in distributed/__init__.py
as that's where distributed
adds it's configuration settings into Dask's config system.
.pre-commit-config.yaml
Outdated
rev: 5.7.0 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I ended up using the same general configuration from dask#7370 here.
Thanks for the review! Made alterations to keep |
One error (truncated) on windows 3.8 tests:
Is this a flaky test or could this be related to the import order somewhere in |
Hi @charlesbluca, I'm not a maintainer, but perhaps you could try to push an empty commit to see if that same test would fail again via, e.g.,
If it doesn't fail again, it could perhaps be labeled as |
That's a good idea @hristog - I actually might end up closing this PR and reopening after fetching from upstream as there are a lot of merge conflicts piling up - I will check if |
Opened up #4647 with a second attempt at this. |
This PR adds
isort
to the pre-commit hooks and attempts to resolve any resulting conflicts this would create. For the most part, not a lot of manual changes had to be made to do this:distributed/deploy/tests/test_local.py
, a separate import ofdistributed.utils_test.loop
was grouped with all other imports fromdistributed.utils_test
distributed/tests/test_client.py
, some additional flake8noqa
s were added to ignore imports marked as unuseddistributed/__init__.py
, thefrom . import config
is pinned at the top to ensure configuration is done properlyNot sure if
isort
should also be added to the CI.black distributed
/flake8 distributed