test: do not scan the built copy of the package for German - #50
Merged
Conversation
The language-policy test failed the 0.0.38 release job. It exempts the controller's German error strings in const_api.py by path, but the release runs `python -m build` before the checks, and that copies the package into build/lib/. The copy is a different path, so the exemption missed it and the scan flagged fourteen strings that are deliberately German. Exemptions are matched by file name now, and generated directories - build, dist, .tox, .venv, *.egg-info, __pycache__ - are skipped outright: a built wheel is not source, and what it contains says nothing about what is written in this repository. Verified against the failing scenario rather than in the abstract: with build/lib/ present, 250 tests pass. A new test asserts the built copy is never scanned, and injecting a German comment into readings.py still fails the suite.
Xerolux
marked this pull request as ready for review
August 20, 2026 11:52
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.
The language-policy test from #48 failed the 0.0.38 release job. Not a false alarm about the code — a defect in the test.
What happened
The test exempts the controller's German error strings in
const_api.py— they reproduce what the hardware reports, so translating them would break the match. The exemption was keyed to the path:The release job runs
python -m buildbefore the checks, and that copies the whole package intobuild/lib/. The copy is a different path, so the exemption did not cover it:Prepare stable release draftfailed, and the publish jobs were skipped. No release was produced.The fix
const_api.pyis exempt wherever it sits.build,dist,.tox,.venv,venv,__pycache__and*.egg-info. A built wheel is not source — what it contains says nothing about what is written in this repository.Verification
Checked against the scenario that actually failed, not in the abstract:
A new test —
test_generated_copies_are_not_scanned— asserts the built copy is never in the scanned set, so this cannot come back silently.And the guard still catches what it is for: appending
# Dieser Kommentar sollte nicht durchgehentoreadings.pygivesOnce this is in, 0.0.38 can be released.
Generated by Claude Code