-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
MAINT Pin the ruff version on CI linters #29359
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
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
The linter is now green (by using the older ruff version) and the comment was updated/edited to point the link to the correct output but the summary of the linting error in the comment was not updated accordingly. It seems we have a bug in the linter commenting workflow. The workflow can probably be fixed in a follow-up PR to avoid delaying the merge of the ruff version pinning itself. EDIT: looking at https://github.com/scikit-learn/scikit-learn/actions/runs/9702145595/job/26777339235 I think I understand: the github actions linting workflow is fixed by this PR but not yet in production because this PR has not been merged by this PR yet. |
Thanks for this! I was about to open an issue :) (apologies if this was asked before but I couldn't find the conversation) Do you think the contributing guide (here step 5) should also be updated to install the pinned version of ruff? |
Thanks! I noticed this morning that the CI was red on I am wondering why For completeness, ruff 0.4.10 was giving no error, ruff 0.5.0 started complaining and we use 0.2.1 in our min_dependencies, so we could bump it if we want. Note also that |
@EdAbati feel free to open a PR, as I said I am not sure why ruff was left unpinned, but if there was no particularly good reason we may as well mention the version to use ... There are a few different moving pieces and unfortunately it is not that easy to keep everything in sync ... |
If you do so, please feel free to also bump the ruff version to 0.4.10 in Later we can do a follow-up PR with 0.5.0 + the required fixes in the code base. |
I thought we use pre-commit (or strongly recommend using it) to take care of these "different versions of linter X gives different results" problem? Could we also use pre-commit (or the versions it installs) in our CI? The fact that different versions of the same linter give different results is something that annoys me with "modern" linters. If we can find a way to make this problem as rare as possible, I am for it. |
My understanding about the current situation:
Also you could maybe imagine using lock files for the linter versions, but actually |
Ruff recently started to complain on PRs for files unrelated to the changed files so I suppose this is because of a change introduce on a new version.
Let's pin it to a specific version to avoid this kind of disruption.