Skip to content

fix(ci): restore lint and test run on master (supersedes #8) - #9

Open
lukisch wants to merge 2 commits into
masterfrom
claude/pensive-galileo-e0b81u
Open

lukisch wants to merge 2 commits into
masterfrom
claude/pensive-galileo-e0b81u

Conversation

@lukisch

@lukisch lukisch commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

MethodenAnalyser smoke tests is red on master since df464bf (2026-11-07). All 12 matrix jobs fail within a minute, before any test runs.

Reproduced locally on master with ruff 0.16.9: ruff check . reports 23 findings. Two more failures sit behind the lint step:

  • tests/test_security_license_contract.py and scripts/check_store_readiness.py import tomllib, which does not exist on Python 3.10 (four of the twelve cells).
  • tests/test_app_assets.py imports PIL, but the workflow only installs pytest and ruff.

#8 addressed the same three causes on 2026-10-15, but it conflicts with master and predates 17 of the 23 findings. This PR takes its approach onto the current master; #8 can be closed once this lands.

Changes

  • Lint: all 23 findings fixed, no rule disabled. Blind except Exception handlers now catch the errors the guarded code can raise: OSError/ValueError for file and JSON loading, plus TypeError for the atomic JSON write, ET.ParseError for manifest parsing, tk.TclError for the report dialog, AttributeError/OSError for the admin check. The rest is import ordering, one merged isinstance, an explicit check=False, and a shebang removed from a non-executable script.
  • Python 3.10: tomli fallback in the two tomllib importers. tomli is a dependency of pytest on 3.10.
  • Pillow: declared in pyproject.toml (dev), requirements-dev.txt and the workflow install step. Runtime stays stdlib-only.
  • scripts/run_windows_wack.py: report timestamps now use datetime.now().astimezone(), so the ISO timestamp carries the local UTC offset. The date in the file name is unchanged.

Verification

  • ruff check .: clean (was 23 findings).
  • python -m compileall -q .: clean.
  • Python 3.10 with Tk 9.0 under xvfb-run: 295 passed, 10 skipped (all PEP 695, need 3.12+), 15 subtests passed.
  • Not run locally: Windows, macOS, and Python 3.11–3.13 with Tk. Those interpreters have no tkinter in this environment. The matrix on this PR is the evidence for them.

Notes for the reviewer

  • The narrowed handlers are a behaviour change: an exception type outside the listed ones now propagates instead of being reported as a finding or status text.
  • test_run_windows_wack_preflight_passes writes releases/windowsstore/test_reports/wack_preflight_<date>.xml into the repository tree on every run, and that directory is tracked. I removed the file my run produced (second commit) and did not change the test.

Generated by Claude Code

All 12 matrix jobs have failed at the Ruff step since 2026-11-07.

- fix 23 Ruff findings; narrow blind exception handlers to the expected
  file, data, XML and Tk errors, no lint rule disabled
- fall back to tomli on Python 3.10 where tomllib is not in the stdlib
- declare Pillow as a dev/CI dependency for tests/test_app_assets.py
- WACK preflight timestamps carry the local UTC offset

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01THB2F17eZ5jWcC9snC7oi1
@github-actions

Copy link
Copy Markdown

Welcome! 👋 Thanks for your first pull request in this repository.

A maintainer will review it soon. Please make sure:

  • Your changes are tested
  • Documentation is updated if needed
  • The PR description explains what and why

Thanks for contributing!

@lukisch lukisch left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zweitprüfung (Cloud-Bot) – Head 85e6196

Hinweis: Der PR stammt aus einem früheren Bot-Lauf (claude/…-Branch, gleiche GitHub-Identität). Das ist keine unabhängige Prüfung und keine formale Freigabe.

Ergebnis: freigabefähig, keine blockierenden Befunde.

  • Lokal auf Python 3.10 (Tk 9.0, Pillow 12.3.0, xvfb-run): ruff check . sauber, compileall sauber, pytest 295 bestanden / 10 übersprungen (PEP 695). Das deckt sich mit der PR-Beschreibung.
  • Python 3.11–3.13, Windows und macOS lokal nicht ausgeführt. Dafür gilt die grüne 12er-Matrix.
  • Eingeengte except-Blöcke gegen den geschützten Code geprüft: MethodenAnalyser3.py:2407, manage_translations.py:25/88/131/158, scripts/check_store_readiness.py:187, scripts/run_windows_wack.py:102/165. Die erwartbaren Fehler (OSError, JSON-/Unicode-Fehler als ValueError, ET.ParseError, TclError) bleiben abgedeckt.

Nicht blockierend:

  • scripts/check_store_readiness.py:17-20: Der tomli-Fallback hängt auf Python 3.10 an einer transitiven pytest-Abhängigkeit. tomli; python_version < "3.11" gehört explizit in pyproject.toml (dev) und requirements-dev.txt, sonst scheitert das Skript ohne pytest.
  • scripts/run_windows_wack.py:83: .astimezone() vor strftime("%Y%m%d") ist wirkungslos. Relevant ist nur die Änderung in Zeile 304.
  • Bestätigt: Der Testlauf schreibt releases/windowsstore/test_reports/wack_preflight_<Datum>.xml in den getrackten Baum. Das bestand schon vorher; der Test sollte in einem Folge-PR auf tmp_path umgestellt werden.

Nicht gemergt; die Freigabe liegt beim Maintainer.


Generated by Claude Code

lukisch commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Zu den drei nicht blockierenden Hinweisen aus der Zweitprüfung (Head 85e6196): Alle drei treffen zu, ich pushe dafür aber nicht erneut, weil der PR grün und mergebar ist.

  • tomli nur transitiv: Stimmt. Vor diesem PR scheiterte scripts/check_store_readiness.py auf Python 3.10 immer, jetzt nur noch ohne tomli. Die explizite Deklaration (tomli; python_version < "3.11" in pyproject.toml und requirements-dev.txt) gehört in einen Folge-PR oder in den nächsten Push hier, falls einer nötig wird.
  • .astimezone() vor strftime("%Y%m%d"): Ohne Wirkung auf das Datum, behebt dort nur den Lint-Befund DTZ005. Bleibt so.
  • WACK-Report im getrackten Baum: Bestand schon vorher. Die Umstellung des Tests auf tmp_path ist ein eigener Folge-PR.

Generated by Claude Code

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