build: specs GUI V6 + CLI torch-free — retrait optimum, excludes explicites (P0-3)
Suppression des 5 hiddenimports optimum* dans les deux specs V6/CLI. Ajout de EXCLUDED_TORCH_STACK + excludes=EXCLUDED_TORCH_STACK dans Analysis() pour éviter que PyInstaller embarque torch (~+2 Go) via optimum à l'analyse statique. Spec GUI V5 legacy inchangée (garde optimum légitimement). Test anti-dérive ajouté (5 cas). Correctif import pytest inutilisé (version.py). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,11 +114,6 @@ hiddenimports = [
|
||||
"yaml",
|
||||
"loguru",
|
||||
"regex",
|
||||
"optimum",
|
||||
"optimum.onnxruntime",
|
||||
"optimum.pipelines",
|
||||
"optimum.modeling_base",
|
||||
"optimum.exporters.onnx",
|
||||
]
|
||||
|
||||
|
||||
@@ -153,12 +148,24 @@ for _package_name in [
|
||||
_collect_optional_package(_package_name)
|
||||
|
||||
|
||||
# P0-3 (Plan 3) : exclusion dure de la pile torch. Le core fait un
|
||||
# `import torch` lazy (try/except no-op) dans _configure_torch_threads que
|
||||
# l'analyse statique suivrait ; en frozen l'ImportError est attendue et gérée.
|
||||
EXCLUDED_TORCH_STACK = [
|
||||
"torch",
|
||||
"torchvision",
|
||||
"optimum",
|
||||
"doctr",
|
||||
]
|
||||
|
||||
|
||||
a = Analysis(
|
||||
[str(project_dir / "scripts" / "anonymize_cli.py")],
|
||||
pathex=[str(project_dir)],
|
||||
binaries=binaries,
|
||||
datas=datas,
|
||||
hiddenimports=hiddenimports,
|
||||
excludes=EXCLUDED_TORCH_STACK,
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user