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

Pre-commit auto-updates break ruff #8877

Closed
CaedenPH opened this issue Jul 22, 2023 · 2 comments · Fixed by #8879
Closed

Pre-commit auto-updates break ruff #8877

CaedenPH opened this issue Jul 22, 2023 · 2 comments · Fixed by #8879
Labels
awaiting triage Awaiting triage from a maintainer

Comments

@CaedenPH
Copy link
Contributor

CaedenPH commented Jul 22, 2023

What would you like to share?

In these failing tests, algorithms that have not been touched are broken due to the latest pre-commit update (5aefc00)

https://github.com/TheAlgorithms/Python/actions/runs/5629561962/job/15254651560?pr=8875

Perhaps the reason of this error is that when the pre-commit pull request is made, the pre-commit file is changed, however the tests run from the old .pre-commit-config, not the new, changed one. This can be shown in the pr #8878, where the tests supposedly fail, when reverting the commit

@CaedenPH
Copy link
Contributor Author

@cclauss I don't think this should be closed. This issue raises the point that this is not just the first time that this has happened, but that it seems that the autoupdates pass the tests but then break pull requests. This is still very much a problem, but I can't reopen this issue because you closed it

@cclauss
Copy link
Member

cclauss commented Jul 22, 2023

Ruff is not alone... We do not pin any of our dependencies. We do this on purpose because we are not building a single application and reproducible builds are not important here. Instead, we are an "active community" with "well-tested" algorithms where we want our tests + CI to inform us when an upgrade to any dependency breaks our code.

This helps us understand breakage and contribute new issues and fixes to those dependencies. I know of at least one instance where kind of work has led to paid positions for active contributors to this repo.

The special issue with ruff is that we run it two different ways and those two can be out-of-sync on ruff versions.

  • .github/workflows/ruff.yml is designed to run superfast (~5 sec) and provide GitHub Annotations to contributors.
  • .pre-commit-config.yaml is designed to run automatically both locally and in CI without added --format=github

This means that when creating a pull request to fix the former, a contributor must also update the version in the latter.

Do you have a better solution that does not sacrifice the goals above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage Awaiting triage from a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@cclauss @CaedenPH and others