Error on warnings - #1008
Draft
penelopeysm wants to merge 2 commits into
Draft
Conversation
penelopeysm
marked this pull request as draft
May 14, 2026 19:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1007
This actually took me a long time to figure out. Here are the facts:
There's only one warning in CI right now. It's a
DeprecationWarning, which stems from an invalid escape sequence in pyro (which is effectively unmaintained; the last release was 2 years ago -- so while the true solution is to fix it upstream, this probably won't happen).This is triggered when a module is first imported (when Python compiles the bytecode, the
.pycfiles inside__pycache__).Because this happens prior to Pytest being loaded, it's actually not possible to catch it with the
filterwarningsoptions (see e.g. config option filterwarnings ignore::DeprecationWarning does not supress warnings pytest-dev/pytest#13145)I think there's only one reliable way to stop it from ruining CI, which is to compile the bytecode before running Pytest. The
--compile-bytecodeflag is easy to enforce in CI, but I think it's important to mention in the docs, given that this can be confusing (e.g. if someone doesuv run pytestbefore compiling bytecode they will get an error),I tried to suppress it with
uv run python -Wignore::DeprecationWarning:pyro.ops.stats -m pytest ..., as suggested in the pytest issue above, but I couldn't get it to work :/