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

Don't run flake8 twice in CI #15129

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Conversation

AlexWaygood
Copy link
Member

We now run flake8, black and isort on PRs using pre-commit.ci. This is faster than using tox on GitHub Actions, and for black and isort, it also autofixes PRs (and the check in CI fails if it can't autofix a PR).

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm good spot, but I'm not sure about this, since it's nice to have the guarantee that tox works. But don't feel strongly!

Edit: I guess we could remove flake8 from precommit, which is the slowest thing in the lint step

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Apr 25, 2023

Hm good spot, but I'm not sure about this, since it's nice to have the guarantee that tox works. But don't feel strongly!

Yeah. I wondered if we should maybe delete the lint tox environment altogether. Contributors now have the following options to run the lint checks locally, which is probably too many options:

Edit: I guess we could remove flake8 from precommit, which is the slowest thing in the lint step

People who have pre-commit set up locally will probably want to run flake8 as part of pre-commit. But if we want it run separately, we could possibly skip it for CI runs of pre-commit, like we do at typeshed, and run it separately using GitHub Actions: https://github.com/python/typeshed/blob/9abf620500644509a0ba656767e858ac2ef23dd6/.pre-commit-config.yaml#L41-L46

@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AlexWaygood AlexWaygood changed the title Don't do lint checks twice in CI Don't run flake8 twice in CI Apr 25, 2023
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 97e7f3e into python:master Apr 25, 2023
@AlexWaygood AlexWaygood deleted the double-ci branch April 25, 2023 18:23
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