-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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 isort #5806
Use isort #5806
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5806 +/- ##
==========================================
+ Coverage 88.91% 88.93% +0.02%
==========================================
Files 162 162
Lines 10988 10992 +4
Branches 1797 1798 +1
==========================================
+ Hits 9770 9776 +6
+ Misses 938 937 -1
+ Partials 280 279 -1
|
@jxlil What do you think about making #5734 (comment) part of this pull request? Instead of adding isort to tox.ini, we could actually remove from tox.ini and CI jobs anything that we handle with pre-commit now, and have a single pre-commit CI job. |
@Gallaecio Sounds good. I will update this PR. |
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.
Sounds good. I will update this PR.
I was not just suggesting that you remove the tox entry for isort, but also add the pre-commit CI job, as described in #5734 (comment).
You don‘t have to do it, we can do it in a separate, later pull request, but then please add back the CI and tox configu you had. However we do it, after we merge this pull request we really want the CI to fail if any bad import sorting is introduced in the future.
.github/workflows/checks.yml
Outdated
@@ -32,6 +32,7 @@ jobs: | |||
|
|||
steps: | |||
- uses: actions/checkout@v3 | |||
- uses: pre-commit/action@v3.0.0 |
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.
I don't have much experience adding CI jobs. However I believe that this action should cause CI to fail if pre-commit
makes any changes.
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.
Great finding!
Uhh. Is this some problem with the pre-commit action itself? |
This problem is related to
In the logs I see that pre-commit uses Python |
The problem I see with the current CI approach is that it will run pre-commit for every check job. And also, we should remove the CI jobs that are not needed once we have a pre-commit CI job. Let me make some changes to the CI file myself… |
- repo: https://github.com/PyCQA/pylint | ||
rev: v2.15.6 | ||
hooks: | ||
- id: pylint | ||
args: [conftest.py, docs, extras, scrapy, setup.py, tests] |
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.
Done to address #5810, since otherwise we would be removing pylint from checks.yml in this pull request to re-add it when we remove pylint from pre-commit.
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.
Looks good to me, thanks!
Added isort to scrapy and sorted all imports.
Closes #5737, fixes #5810.