feat(gui): afficher version + build date + commit dans titre et status bar

Demande utilisateur : pouvoir identifier la build au premier coup d'oeil
sans confondre ancien/nouveau exe lors des tests.

Implémentation :
- build_info.py (gitignored, fallback "dev" pour mode développement)
  régénéré automatiquement par scripts/rebuild_anon.ps1 avec :
  BUILD_DATE = "2026-04-15 18:15"
  BUILD_COMMIT = "234137e"
  BUILD_BRANCH = "main"
- Pseudonymisation_Gui_V5.py : fonction _version_long() qui construit
  "v5.4 · 2026-04-15 18:15 · #234137e" depuis build_info (avec fallback
  silencieux si module absent en dev). Affichée dans :
    - Titre fenêtre : "Pseudonymisation de vos documents — v5.4 · ..."
    - Status bar en bas à droite
- anonymisation_onefile.spec : build_info.py ajouté aux datas bundlées.
- scripts/rebuild_anon.ps1 : STEP 4a génère build_info.py avant le
  PyInstaller avec git rev-parse short + branch + date courante.
- .gitignore : build_info.py exclu (volatile, regénéré).

En mode dev (pas frozen) : affichage "v5.4" seul (fallback).
En mode frozen : affichage complet avec date/commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 18:40:58 +02:00
parent 234137ec50
commit 6586b89b8f
4 changed files with 41 additions and 3 deletions

View File

@@ -50,6 +50,20 @@ Write-Host " Venv détecté : $venvPython"
Write-Host "=== STEP 4 : Régénérer finess_numbers.txt (entjur fix) ==="
& $venvPython "$project\scripts\build_finess_gazetteers.py" 2>&1 | Out-Host
Write-Host "=== STEP 4a : Générer build_info.py (identifiant de build) ==="
$commit = (git rev-parse --short HEAD 2>&1).Trim()
$branch = (git rev-parse --abbrev-ref HEAD 2>&1).Trim()
$buildDate = Get-Date -Format "yyyy-MM-dd HH:mm"
$buildInfo = @"
"""Métadonnées de build - GENERE AUTOMATIQUEMENT par rebuild_anon.ps1.
Ne PAS editer a la main - ecrase a chaque rebuild."""
BUILD_DATE = "$buildDate"
BUILD_COMMIT = "$commit"
BUILD_BRANCH = "$branch"
"@
$buildInfo | Set-Content "$project\build_info.py" -Encoding UTF8
Write-Host " build_info.py: $buildDate / $commit / $branch"
Write-Host "=== STEP 4bis : Désactiver scan Defender sur dist/ (évite locks PyInstaller) ==="
try {
Add-MpPreference -ExclusionPath "$project\dist" -ErrorAction SilentlyContinue