Repository navigation
ci: every warning is an error, and implicit encodings are warnings - #24
Merged
Merged
Conversation
pytest.ini sets filterwarnings = error: a deprecation in this code or in a dependency fails the run instead of scrolling past in the summary. Both CI test jobs start the interpreter with -X warn_default_encoding, so a text read without an explicit encoding fails too. Set on the interpreter rather than in the job's env so Poetry's own process stays quiet. The suite was already clean under both flags with dependencies included (140 passed); a sanity test with a stray DeprecationWarning fails as intended. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Follow-up to #23. The suite already passes with every warning turned into an error, with the opt-in encoding warning, and with dependencies included. This makes CI enforce it, so the next deprecation or implicit encoding fails a pull request instead of scrolling past in a summary.
Changes
pytest.ini:filterwarnings = error. The comment says what to do when it fires: fix, update the dependency, or record a narrow ignore in Known Issues..github/workflows/ci.ymland.gitlab-ci.yml: the test command ispoetry run python -X warn_default_encoding -m pytest. The flag is on the interpreter rather than in the job environment on purpose:PYTHONWARNDEFAULTENCODING=1would also reach Poetry's own process, whose dependencies print encoding warnings of their own (seen locally from theregexpackage).docs/setup.mdandAGENTS.md: the rule and the local command that matches CI.Python dev mode (
-X dev) also passes but is left out: it turns on asyncio debug mode and slows the suite for no additional check this project needs.Verification, local on Python 3.15.0 with PostgreSQL 17
--noconftestunder the same flag: 24 passed.DeprecationWarningfails under thispytest.ini(FAILED ... DeprecationWarning: x).🤖 Generated with Claude Code