Fix build Nuitka : ne compiler que nos modules, copier les packages tels quels

- Re-ajoute --nofollow-import-to pour tous les packages externes lourds
  (onnxruntime, numpy, transformers, PIL, fitz, pdfplumber, etc.)
- Ajoute --no-deployment-flag=excluded-module-usage pour autoriser
  leur import à l'exécution
- Nouvelle étape : pip install --target=dist pour copier les packages
  Python directement dans le dossier de distribution
- Nuitka ne compile en C que nos 4 modules + stdlib + tkinter
- Les packages externes restent en bytecode Python natif (fiable)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 23:08:29 +01:00
parent 9e06bbfa1d
commit 2d90bbbce4
2 changed files with 58 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ on:
jobs:
build-windows:
runs-on: windows-latest
timeout-minutes: 120
timeout-minutes: 90
steps:
- name: Checkout
@@ -50,6 +50,27 @@ jobs:
--include-module=eds_pseudo_manager `
--include-data-dir=config=config `
--include-data-dir=models=models `
--nofollow-import-to=onnxruntime `
--nofollow-import-to=numpy `
--nofollow-import-to=transformers `
--nofollow-import-to=optimum `
--nofollow-import-to=tokenizers `
--nofollow-import-to=sentencepiece `
--nofollow-import-to=torch `
--nofollow-import-to=PIL `
--nofollow-import-to=pdfplumber `
--nofollow-import-to=pdfminer `
--nofollow-import-to=fitz `
--nofollow-import-to=pymupdf `
--nofollow-import-to=yaml `
--nofollow-import-to=huggingface_hub `
--nofollow-import-to=safetensors `
--nofollow-import-to=regex `
--nofollow-import-to=tqdm `
--nofollow-import-to=requests `
--nofollow-import-to=filelock `
--nofollow-import-to=packaging `
--no-deployment-flag=excluded-module-usage `
--windows-console-mode=disable `
--output-dir=build `
--company-name="Hopital" `
@@ -59,6 +80,14 @@ jobs:
--assume-yes-for-downloads `
Pseudonymisation_Gui_V5.py
- name: Copy Python packages into dist folder
run: |
$dist = "build\Pseudonymisation_Gui_V5.dist"
Write-Host "Installing packages into dist folder..."
pip install --target="$dist" -r requirements.txt --no-warn-script-location
Write-Host "Done. Dist folder size:"
"{0:N0} MB" -f ((Get-ChildItem -Recurse "$dist" | Measure-Object -Property Length -Sum).Sum / 1MB)
- name: Prepare distribution zip
run: |
Rename-Item -Path "build\Pseudonymisation_Gui_V5.dist" -NewName "Pseudonymisation"