Skip to content

test: do not scan the built copy of the package for German - #50

Merged
Xerolux merged 1 commit into
mainfrom
claude/fix-language-test-build-dir
Aug 20, 2026
Merged

test: do not scan the built copy of the package for German#50
Xerolux merged 1 commit into
mainfrom
claude/fix-language-test-build-dir

Conversation

@Xerolux

@Xerolux Xerolux commented Aug 20, 2026

Copy link
Copy Markdown
Owner

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:

CONTROLLER_VERBATIM = (PACKAGE / "const_api.py", REPO / "tests" / "mock_server.py")

The release job runs python -m build before the checks, and that copies the whole package into build/lib/. The copy is a different path, so the exemption did not cover it:

FAILED tests/test_language_policy.py::test_python_sources_are_english[const_api.py]
  build/lib/violet_poolcontroller_api/const_api.py:424: "Filterpumpen-Frostschutz nicht verfügbar - Sensorfehler"
  build/lib/violet_poolcontroller_api/const_api.py:456: "OmniTronic gibt keine Positionsrückmeldung (Rückspülen)"
  … 14 strings that are deliberately German
1 failed, 263 passed

Prepare stable release draft failed, and the publish jobs were skipped. No release was produced.

The fix

  • Exemptions are matched by file name, so a copy of const_api.py is exempt wherever it sits.
  • Generated directories are skipped outright: 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:

python -m build --wheel      →  build/lib/violet_poolcontroller_api/ present
python -m pytest tests/ -q   →  250 passed
python -m ruff check .       →  All checks passed

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 durchgehen to readings.py gives

FAILED tests/test_language_policy.py::test_python_sources_are_english[readings.py]

Once this is in, 0.0.38 can be released.


Generated by Claude Code

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
Xerolux marked this pull request as ready for review August 20, 2026 11:52
@Xerolux
Xerolux merged commit 380c597 into main Aug 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants