Skip to content

Commit 11fda7e

Browse files
committed
reue de nuitka engine pour lui donner acces à l'autobuild de command via enginesdk import compute_for_all
1 parent fd172d4 commit 11fda7e

4 files changed

Lines changed: 72 additions & 19 deletions

File tree

ENGINES/nuitka/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
from PySide6.QtWidgets import QFileDialog, QInputDialog
3232

3333
from engine_sdk.base import CompilerEngine
34-
from engine_sdk import engine_register
35-
34+
from engine_sdk import engine_register, compute_for_all
3635

3736
@engine_register
3837
class NuitkaEngine(CompilerEngine):
@@ -120,6 +119,19 @@ def build_command(self, gui, file: str) -> list[str]:
120119
if output_dir and output_dir.text().strip():
121120
cmd.extend(["--output-dir", output_dir.text().strip()])
122121

122+
# Auto ajout des plugins Nuitka via détection
123+
try:
124+
auto_map = compute_for_all(self) or {}
125+
auto_nuitka_args = auto_map.get("nuitka", [])
126+
for a in auto_nuitka_args:
127+
if a not in cmd:
128+
cmd.append(a)
129+
except Exception as e:
130+
try:
131+
self.log.append(f"⚠️ Auto-détection Nuitka: {e}")
132+
except Exception:
133+
pass
134+
123135
# Add the target file
124136
cmd.append(file)
125137

ENGINES/nuitka/mapping.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"numpy": {"nuitka": "numpy"},
3+
"scipy": {"nuitka": "scipy"},
4+
"pandas": {"nuitka": "pandas"},
5+
"matplotlib": {"nuitka": "matplotlib"},
6+
"scikit-learn": {"nuitka": "sklearn"},
7+
"scikit-image": {"nuitka": "scikit-image"},
8+
"Pillow": {"nuitka": "pillow"},
9+
"imageio": {"nuitka": "imageio"},
10+
"opencv-python": {"nuitka": "opencv"},
11+
"opencv-contrib-python": {"nuitka": "opencv"},
12+
"lxml": {"nuitka": "lxml"},
13+
14+
"PySide6": {"nuitka": "pyside6"},
15+
"PySide2": {"nuitka": "pyside2"},
16+
"PyQt6": {"nuitka": "pyqt6"},
17+
"PyQt5": {"nuitka": "pyqt5"},
18+
"tkinter": {"nuitka": "tk-inter"},
19+
"Kivy": {"nuitka": "kivy"},
20+
"wxPython": {"nuitka": "wxpython"},
21+
22+
"torch": {"nuitka": "torch"},
23+
"torchvision": {"nuitka": "torch"},
24+
"torchaudio": {"nuitka": "torch"},
25+
"tensorflow": {"nuitka": "tensorflow"},
26+
"onnxruntime": {"nuitka": "onnxruntime"},
27+
"xgboost": {"nuitka": "xgboost"},
28+
"lightgbm": {"nuitka": "lightgbm"},
29+
30+
"statsmodels": {"nuitka": "statsmodels"},
31+
"Jinja2": {"nuitka": "jinja2"},
32+
"cryptography": {"nuitka": "cryptography"},
33+
"PyOpenSSL": {"nuitka": "pyopenssl"},
34+
"pyzmq": {"nuitka": "pyzmq"},
35+
"pyaudio": {"nuitka": "pyaudio"},
36+
"h5py": {"nuitka": "h5py"},
37+
"pyserial": {"nuitka": "pyserial"},
38+
"pygame": {"nuitka": "pygame"},
39+
"spacy": {"nuitka": "spacy"},
40+
"transformers": {"nuitka": "transformers"},
41+
"sentencepiece": {"nuitka": "sentencepiece"},
42+
43+
"shapely": {"nuitka": "shapely"},
44+
"geopandas": {"nuitka": "geopandas"},
45+
"fiona": {"nuitka": "fiona"},
46+
"rasterio": {"nuitka": "rasterio"},
47+
"librosa": {"nuitka": "librosa"},
48+
"sounddevice": {"nuitka": "sounddevice"},
49+
"yaml": {"nuitka": "yaml"},
50+
"pylibjpeg": {"nuitka": "pylibjpeg"}
51+
}

engine_sdk/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
# Re-export auto_plugins helpers for convenience
1919
from .auto_build_command import (
20-
compute_auto_for_engine,
20+
2121
compute_for_all,
22-
register_auto_builder,
22+
2323
)
2424

2525
__version__ = "1.0.0"
@@ -173,9 +173,9 @@ def check_engine_compatibility(engine_class, required_sdk_version: str = None) -
173173
"CompilerEngine",
174174
"engine_register",
175175
"register",
176-
"compute_auto_for_engine",
176+
177177
"compute_for_all",
178-
"register_auto_builder",
178+
179179
"registry",
180180
# Utilities for engine authors
181181
"redact_secrets",

engine_sdk/auto_build_command.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,11 @@
22

33
# Pass-through to host auto_plugins helpers
44
from Core.Auto_Command_Builder import (
5-
compute_auto_for_engine,
5+
66
compute_for_all,
7-
register_aliases,
8-
register_auto_builder,
9-
register_import_alias,
10-
register_package_import_name,
11-
_tr,
127
)
138

149
__all__ = [
15-
"compute_auto_for_engine",
16-
"compute_for_all",
17-
"register_auto_builder",
18-
"register_aliases",
19-
"register_import_alias",
20-
"register_package_import_name",
21-
"_tr",
10+
11+
"compute_for_all"
2212
]

0 commit comments

Comments
 (0)