-
Notifications
You must be signed in to change notification settings - Fork 198
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
isort
everything
#3421
isort
everything
#3421
Conversation
Can you make this enforced in CI? |
By enforced, I mean, fail in CI if stuff is not sorted - I don't mean "make bot commits to someone's PR branch". This is a big change to code style and stuff will fall out of order after one pull request if not enforced - see #3106 (review) on previous work PR |
I can see CI is failing with circular import problems:
I encountered this sort of stuff working on adding type checking a lot, and mostly the resolution was to use
in place of what previously had been:
because that first import syntax does not require an import to be completed, so is more tolerant of circular imports. |
What is the concern with having something like the pre-commit CI bot enabled so it can auto-fix and not become a hindrance for contributors? It works quite seamlessly in my experience. |
ed52660
to
a9bed98
Compare
I've cleaned up the PR and merged a fix for the circular import deps (#3424). |
.isort.cfg
Outdated
@@ -0,0 +1,3 @@ | |||
[settings] | |||
profile = black | |||
known_first_party = globus-compute-sdk, globus-compute-endpoint |
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.
this is not part of parsl?
@Andrew-S-Rosen to address this a bit more - I have a massive personal dislike for stuff that messes with someones branches: this turns "you made a push; then you made a fix; then you made a push again" into "your push doesn't work" which for the very junior developers that often contribute to parsl, that turns into "now it's my problem to teach you about git and how we robo-sabotaged your branch for you!". More experienced developers are quite capable of running this code (automatically if and when they want that) in their own dev environment, without needing the CI to be involved other than checking they did it right - although there are plenty of use cases where this doesn't matter (for example, any dev/demo branch that isn't immediately intended to be merged to |
Interesting. It has been my personal experience from working on other OSS projects that the exact opposite happens. When the CI gatekeeps based on lint checks, contributors get frustrated because they don't know or understand how to deal with pre-commit hooks and then try manually to fix the lint errors (with constant X's delaying progress). Ultimately, this leaves many PRs abandoned for silly reasons. When lint fixes are pushed automatically by a bot, there is less frustration (I have not seen contributors reporting any issues with just pulling the new changes). I help maintain a code pymatgen where there is a bot and a code ASE where there is not, and it's like night and day. But personally, I don't care much. Just sharing my own experiences. |
… and test requirements
Whitespace changes & removing dead comments
ok, I validated this PR like this:
and checked that that diff statement didn't output any difference |
Description
This PR should not make changes beyond sorting the imports. Now the changed import order can cause problems.
I'm adding an
.isort.cfg
file and updating the test-requirements.txt. I will add it to test actions and add a pre-commit config separatelyType of change
Choose which options apply, and delete the ones which do not apply.