You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main branch and some PRs synchronized with it are now failing with the following cython-lint error:
/home/vsts/work/1/s/sklearn/cluster/_hdbscan/_tree.pyx:786:19: unnecessary set + generator (just use a set comprehension)
Problems detected by cython-lint, please fix them
I think this is a consequence of the merge of #32489 but weirdly enough, that PR was green and, I cannot reproduce locally on the current main:
$ pre-commit run --files sklearn/cluster/_hdbscan/_tree.pyx
[INFO] Initializing environment for https://github.com/MarcoGorelli/cython-lint.
[INFO] Installing environment for https://github.com/MarcoGorelli/cython-lint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check yaml...........................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
ruff check...........................................(no files to check)Skipped
ruff format..........................................(no files to check)Skipped
mypy.................................................(no files to check)Skipped
cython-lint..............................................................Passed
prettier.............................................(no files to check)Skipped
codespell................................................................Passed
If I install the latest version of cython-lint from pip I can reproduce the problem by running the command manually:
cython-lint sklearn/cluster/_hdbscan/_tree.pyx
/Users/ogrisel/code/scikit-learn/sklearn/cluster/_hdbscan/_tree.pyx:786:19: unnecessary set + generator (just use a set comprehension)
cc @MarcoGorelli for his advice whether we should expect similar linting changes in the future for cython-lint. I know that as the saying goes: it's hard to make predictions, especially about the future 😉.
I guess until now we were a bit lazy and never needed to pin the cython-lint version but maybe we should start doing it?
Activity
ogrisel commentedon Oct 14, 2025
If I install the latest version of
cython-lintfrompipI can reproduce the problem by running the command manually:lesteve commentedon Oct 14, 2025
cc @MarcoGorelli for his advice whether we should expect similar linting changes in the future for cython-lint. I know that as the saying goes: it's hard to make predictions, especially about the future 😉.
I guess until now we were a bit lazy and never needed to pin the cython-lint version but maybe we should start doing it?
MarcoGorelli commentedon Oct 14, 2025
Yeah the precommit version is behind, I push a new version out today with some new checks
Fwiw I'd suggest running pre-commit run --all-files in ci, then there's a single command and everything stays in sync