Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest ruff
pip install pytest ruff "Pillow>=12.3.0"

- name: Run Ruff Lint Check
run: ruff check .
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Format basiert auf [Keep a Changelog](https://keepachangelog.com/de/1.1.0/).

## [Unreleased]

### CI-Korrektur: Lint- und Testlauf auf `master` wiederhergestellt (2026-11-11)
- **Ruff**: 23 Befunde behoben, an denen alle 12 Matrixjobs vor dem Testschritt scheiterten. Fehlerbehandlungen in `MethodenAnalyser3.py`, `manage_translations.py`, `scripts/check_store_readiness.py` und `scripts/run_windows_wack.py` fangen jetzt die erwarteten Datei-, Daten-, XML- und Tk-Fehler statt pauschal `Exception`. Keine Lint-Regel wurde abgeschaltet.
- **Python 3.10**: `tests/test_security_license_contract.py` und `scripts/check_store_readiness.py` fallen auf `tomli` zurück, weil `tomllib` erst ab Python 3.11 zur Standardbibliothek gehört.
- **Pillow**: als Entwicklungs- und CI-Abhängigkeit erklärt (`pyproject.toml`, `requirements-dev.txt`, `tests.yml`); `tests/test_app_assets.py` importiert `PIL`. Die Laufzeit bleibt ohne externe Pakete.
- **WACK-Preflight**: Zeitstempel im Report tragen jetzt den lokalen UTC-Versatz.

### Windows Store Packaging & Tier-2 6-Sprachen-Harmonisierung nach Policy P-006 (2026-11-07)
- **Store-Packaging & Manifest-Harmonisierung (`store_package.json`, `releases/windowsstore/store_settings.json`)**:
- Vollständige Tier-2 6-Sprachen-Harmonisierung (`de-DE`, `en-US`, `es-ES`, `zh-CN`, `ja-JP`, `ru-RU`).
Expand Down
2 changes: 1 addition & 1 deletion MethodenAnalyser3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ def save_report_as(output_widget: scrolledtext.ScrolledText, status_widget: tk.L
if status_widget is not None:
status_widget.config(text=f"{_t('status_report_saved')} {os.path.basename(file_path)}")
messagebox.showinfo(_t("dialog_success_title"), f"{_t('status_report_saved')} {file_path}")
except Exception as e:
except (OSError, ValueError, tk.TclError) as e:
if status_widget is not None:
status_widget.config(text=f"[FEHLER] {e}")
messagebox.showerror(_t("dialog_error_title"), str(e))
Expand Down
8 changes: 4 additions & 4 deletions manage_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
if hasattr(sys.stderr, "reconfigure"):
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
except Exception:
except (OSError, ValueError):
pass

APP_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -85,7 +85,7 @@ def check_translations(source_dir=None):
try:
with open(trans_file, "r", encoding="utf-8") as f:
translations = json.load(f)
except Exception as e:
except (OSError, ValueError) as e:
print(f"[!] Fehler beim Laden von {trans_file}: {e}")
return False

Expand Down Expand Up @@ -128,7 +128,7 @@ def show_stats(source_dir=None):
try:
with open(trans_file, "r", encoding="utf-8") as f:
translations = json.load(f)
except Exception as e:
except (OSError, ValueError) as e:
print(f"[!] Fehler beim Laden von {trans_file}: {e}")
return

Expand All @@ -155,7 +155,7 @@ def save_translations(trans_file, translations):
os.fsync(f.fileno())
os.replace(temp_file, trans_file)
return True
except Exception as e:
except (OSError, TypeError, ValueError) as e:
if os.path.exists(temp_file):
try:
os.remove(temp_file)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Support = "mailto:support@lukasgeiger.com"
dev = [
"pytest>=9.1.1",
"ruff>=0.9.0",
"Pillow>=12.3.0",
]
build = [
"pyinstaller>=6.10.0",
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Tested toolchain range (runtime remains Python standard library only).
pytest>=9.1.1,<10.0
ruff>=0.9.0
Pillow>=12.3.0
pyinstaller>=6.14.2,<7.0
altgraph>=0.17.4
packaging>=24.0
22 changes: 12 additions & 10 deletions scripts/check_store_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
import argparse
import json
import re
import tomllib
import xml.etree.ElementTree as ET
import zipfile
from collections.abc import Sequence
from pathlib import Path
from typing import Sequence
import xml.etree.ElementTree as ET

try:
import tomllib
except ModuleNotFoundError: # Python 3.10: tomli is installed alongside pytest
import tomli as tomllib

REQUIRED_DOCUMENTS = (
"PRIVACY_POLICY.md",
Expand Down Expand Up @@ -114,10 +117,7 @@ def _check_repository(project_root: Path) -> list[str]:
)

capabilities = config.get("capabilities")
if isinstance(capabilities, list):
if "runFullTrust" not in capabilities:
findings.append("[repository] store_package.json must declare runFullTrust")
elif isinstance(capabilities, str):
if isinstance(capabilities, (list, str)):
if "runFullTrust" not in capabilities:
findings.append("[repository] store_package.json must declare runFullTrust")
else:
Expand Down Expand Up @@ -184,7 +184,7 @@ def _check_repository(project_root: Path) -> list[str]:
findings.append(
f"[repository] AppxManifest.xml missing resource languages: {expected_manifest_langs - manifest_langs}"
)
except Exception as exc:
except (OSError, ET.ParseError) as exc:
findings.append(f"[repository] AppxManifest.xml parse error: {exc}")

# Check tile icons in store_package/MethodenAnalyser/icons/
Expand Down Expand Up @@ -266,8 +266,10 @@ def _check_repository(project_root: Path) -> list[str]:
def _check_evidence(evidence_root: Path | None) -> list[str]:
if evidence_root is None:
return [
"[external] evidence root was not supplied (Partner Center reservation, FullTrust review, "
"Windows tray smoke, live URL readback, SBOM, signed MSIX/hash, and WACK PASS remain open)"
(
"[external] evidence root was not supplied (Partner Center reservation, FullTrust review, "
"Windows tray smoke, live URL readback, SBOM, signed MSIX/hash, and WACK PASS remain open)"
)
]
if not evidence_root.is_dir():
return [f"[external] evidence root does not exist: {evidence_root}"]
Expand Down
9 changes: 4 additions & 5 deletions scripts/run_windows_wack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
"""run_windows_wack.py - Führt das Windows App Certification Kit (WACK) für MethodenAnalyser aus oder erstellt hermetische Preflight-Reports."""

from __future__ import annotations
Expand Down Expand Up @@ -81,7 +80,7 @@ def resolve_report_path(project_root: Path, report_dir: Path | None, explicit: P
if explicit is not None:
return explicit.expanduser().resolve()
base_dir = (report_dir or (project_root / "releases" / "windowsstore" / "test_reports")).expanduser().resolve()
timestamp = datetime.now().strftime("%Y%m%d")
timestamp = datetime.now().astimezone().strftime("%Y%m%d")
return base_dir / f"{WACK_REPORT_PREFIX}{timestamp}.xml"


Expand All @@ -100,7 +99,7 @@ def is_windows_admin() -> bool:
return False
try:
return bool(ctypes.windll.shell32.IsUserAnAdmin())
except Exception:
except (AttributeError, OSError):
return False


Expand Down Expand Up @@ -163,7 +162,7 @@ def run_preflight_checks(project_root: Path, store_config: dict[str, object]) ->
"result": "FAIL",
"details": "Properties Logo-Element fehlt im Manifest",
})
except Exception as e:
except (OSError, ET.ParseError) as e:
checks.append({
"id": "MANIFEST_SYNTAX",
"name": "AppxManifest-Validierung & XML-Wohlgeformtheit",
Expand Down Expand Up @@ -302,7 +301,7 @@ def write_xml_report(path: Path, checks: list[dict[str, object]]) -> WackSummary
root = ET.Element("REPORT", {
"TOOL": "WACK-Preflight-Runner",
"VERSION": "1.0.0",
"TIMESTAMP": datetime.now().isoformat(),
"TIMESTAMP": datetime.now().astimezone().isoformat(),
})
summary_elem = ET.SubElement(root, "SUMMARY")
passes = sum(1 for c in checks if c["result"] == "PASS")
Expand Down
1 change: 0 additions & 1 deletion tests/source_platform_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import MethodenAnalyser3 as m
from translator import TranslationSystem


ROOT = Path(__file__).resolve().parents[1]


Expand Down
2 changes: 1 addition & 1 deletion tests/test_app_assets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
"""Test suite for application icon assets, store logos and PWA manifests."""

import json
from pathlib import Path

from PIL import Image

ROOT = Path(__file__).resolve().parents[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def test_manage_translations_check_outside_repo_cwd():
[sys.executable, str(manage_py), "--check"],
cwd=foreign_cwd,
capture_output=True,
check=False,
text=True,
)
assert res.returncode == 0, f"Fehler bei fremdem CWD: {res.stdout}\n{res.stderr}"
2 changes: 1 addition & 1 deletion tests/test_manage_translations_atomic_write_and_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))

import manage_translations as mt # noqa: E402
import manage_translations as mt


def test_save_translations_atomic_write_creates_valid_json(tmp_path):
Expand Down
6 changes: 5 additions & 1 deletion tests/test_security_license_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

import ast
import re
import tomllib
from pathlib import Path

try:
import tomllib
except ModuleNotFoundError: # Python 3.10: tomli is installed alongside pytest
import tomli as tomllib

ROOT = Path(__file__).resolve().parents[1]


Expand Down
3 changes: 1 addition & 2 deletions tests/test_store_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import json
import subprocess
import sys
from pathlib import Path
import xml.etree.ElementTree as ET

from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
EXPECTED_LANGUAGES = ("de-DE", "en-US", "es-ES", "zh-CN", "ja-JP", "ru-RU")
Expand Down
Loading