Skip to content

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Nov 22, 2024

Warnings are usually a sign of something that can be improved or even wrong, like tasks not being properly awaited or cancelled, so it's a good idea to treat them as errors to avoid them getting unnoticed.

This PR also moves pytest options to the pyproject.toml files, so they are easier to change and more flexible.

It is very difficult to change the options if they are shipped by
repo-config, so it is better to put them in the template and leave users
the flexibility to change them.

Signed-off-by: Leandro Lucarella <[email protected]>
@llucax llucax requested a review from a team as a code owner November 22, 2024 09:52
@llucax llucax self-assigned this Nov 22, 2024
@llucax llucax added this to the v0.12.0 milestone Nov 22, 2024
@github-actions github-actions bot added part:nox Affects the configuration of nox part:template Affects the cookiecutter template files labels Nov 22, 2024
@llucax llucax enabled auto-merge November 22, 2024 09:52
@llucax llucax requested review from Marenz and shsms November 22, 2024 09:52
@llucax llucax force-pushed the pytest-Werror branch 4 times, most recently from 26137c8 to 671688f Compare November 22, 2024 10:21
Warnings are usually a sign of something that can be improved or even
wrong, like tasks not being properly awaited or cancelled, so it's a
good idea to treat them as errors to avoid them getting unnoticed.

We still treat deprecations as warnings, as when testing with the
`pytest_min` session is normal to get deprecation warnings as we are
using old versions of dependencies.

Signed-off-by: Leandro Lucarella <[email protected]>
@llucax
Copy link
Contributor Author

llucax commented Nov 22, 2024

Mmm, the deprecations are annoying. It would be good to have them as errors too normally, I guess. Not sure. It can be sometimes annoying when one is not planning to upgrade in the short term.

If we wanted to not treat warnings as errors only in the pytest_min session, we could also pass the default::* flags in the nox session.

But I guess for now this is the less problematic approach and it is a big improvement over the previous status quo, so we can go one step at the time.

@llucax llucax added this pull request to the merge queue Nov 26, 2024
Merged via the queue into frequenz-floss:v0.x.x with commit 618694e Nov 26, 2024
14 checks passed
@llucax llucax deleted the pytest-Werror branch November 26, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:nox Affects the configuration of nox part:template Affects the cookiecutter template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants