Skip to content

MNT Avoid pre-commit failure #31273

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged

MNT Avoid pre-commit failure #31273

merged 1 commit into from
Apr 29, 2025

Conversation

DeaMariaLeon
Copy link
Contributor

Reference Issues/PRs

What does this implement/fix? Explain your changes.

mypy in Pre-commit was failing locally:

sklearn/cluster/_agglomerative.py:39: error: Module "sklearn.cluster" has no attribute "_hierarchical_fast"

The skip was removed here: https://github.com/scikit-learn/scikit-learn/pull/31226/files#diff-4cd0e4b7b1063f3f70c05f3d299765b1533d922cdc7d209ae86a331e7d668447L39:~:text=import%20_hierarchical_fast%20as-,_hierarchical,-%23%20type%3A%20ignore

Any other comments?

cc @glemaitre

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 79a888b. Link to the linter CI: here

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

@ogrisel
Copy link
Member

ogrisel commented Apr 29, 2025

cc @DimitriPapadopoulos for reference.

@ogrisel ogrisel merged commit 9ba4f91 into scikit-learn:main Apr 29, 2025
39 checks passed
@DeaMariaLeon DeaMariaLeon deleted the ignore branch April 29, 2025 15:48
@DimitriPapadopoulos
Copy link
Contributor

Sorry about that. I wonder why mypy fails locally but not in CI jobs. Different versions? A recent mypy update?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Apr 30, 2025

I think I get it:

  • The developer instructions recommend running pre-commit locally, but pre-commit is not run during CI.
  • The skip lists of pre-commit and tools such as ruff and mypy run outside pre-commit might differ. This is a pre-commit feature.

I had started discussion #31047 about such testing/CI inconsistencies, without much success.

See also #31276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants