Skip to content

CI Turn *ALL* warnings into errors - #29516

Closed
jeremiedbb wants to merge 30 commits into
scikit-learn:mainfrom
jeremiedbb:turn-all-warnings-into-errors
Closed

jeremiedbb wants to merge 30 commits into
scikit-learn:mainfrom
jeremiedbb:turn-all-warnings-into-errors

Conversation

@jeremiedbb

Copy link
Copy Markdown
Member

This PR adds a pytest mark on all tests to turn all warnings into errors, towards #10158, especially #10158 (comment).

  • There's obviously a list of test modules to skip because there are still many warnings in our tests.
    The goal is to open a meta issue to track the clean-up of warnings in the remaining test modules.

  • This PR adds a pytest mark on each test, until it's done for all remaining test modules, at which point it should be done as a single pytest config.

cc/ @lesteve :)

@github-actions

github-actions Bot commented Jul 18, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

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

Generated for commit: b662932. Link to the linter CI: here

@jeremiedbb
jeremiedbb marked this pull request as ready for review January 2, 2025 11:09
@lesteve

lesteve commented Jan 7, 2025 •

Copy link
Copy Markdown
Member

Basically I am worried about all the warnings that we were completely ignoring before and that now will create additional work. I have to say that my gut feeling is that it is not worth it. I don't seem to remember many reports of people complaining about too many annoying warnings that somehow an approach like this PR would avoid 1.

Having said this I may be willing to consider it, maybe give it a go, use it for a few months, see how much pain this represents in practice, and revert if we decide this is too painful.

An example warning that I have in mind, polars and it was reverted thanks to @glemaitre input pola-rs/polars#20255 (comment). This did not affect scikit-learn CI because it was a RuntimeWarning, the reason I know about it because @glemaitre told me about it. With this PR approach, we would have had an error, decided to ignore it. Probably we would never have cleaned it up, because we have many other high priority things to do than trying to remove warning filters that are not necessary anymore.

A few suggestions:

  • just curious do you have an example in mind where not catching a warning was actually hiding a real issue?
  • could you try [scipy-dev] [pyodide] [free-threaded] maybe other exotic builds if I forget any to see whether slight variation of CI builds are likely to cause different errors?
  • should we start with turning all warnings into errors only in a few builds like we are currently doing? For example, how much do we care that much that with min dependencies, there are some weird warnings? I would say not that much personally.
  • to get a feeling about the blast radius, can you push a commit turning all warnings into errors and see how many failure there are?
  • are there any projects out there that does something similar and we could ask for feed-back about this PR stricter approach?

Footnotes

  1. I guess a portion of the users mostly do warnings.simplefilter('ignore') and keep on living their normal life ... ↩

@jeremiedbb

Copy link
Copy Markdown
Member Author

There are arguments to not ebable it in

  • the min dependency jobs: we probably don't care much about warnings coming from old stuff.
  • the latest dependency jobs: we don't want to have temporary warning filters everytime we get a warning from a dependency which is to be fixed upstream.

In addition, looping through all the test files will take a huge amount of contributor and review time that we don't have a lot (and it's not the best use of this time). With that in mind I'm closing this PR for now.

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.

2 participants