@@ -88,7 +88,7 @@ def _discover_bcasl_meta(Plugins_dir: Path) -> dict[str, dict[str, Any]]:
8888 spec .loader .exec_module (module ) # type: ignore[attr-defined]
8989
9090 # Utilise un gestionnaire temporaire pour enregistrer et lire les métadonnées
91- mgr = BCASL (Plugins_dir , config = {}, sandbox = False , plugin_timeout_s = 0.0 ) # type: ignore[call-arg]
91+ mgr = BCASL (Plugins_dir , config = {}, sandbox = False ) # type: ignore[call-arg]
9292
9393 # Méthode 1: chercher fonction bcasl_register
9494 reg = getattr (module , "bcasl_register" , None )
@@ -185,7 +185,7 @@ def _discover_bcasl_plugins(
185185 """Load les plugins et return un mapping plugin_id -> instance."""
186186 plugins : dict [str , BcPluginBase ] = {}
187187 try :
188- mgr = BCASL (workspace_root , config = cfg , sandbox = False , plugin_timeout_s = 0.0 )
188+ mgr = BCASL (workspace_root , config = cfg , sandbox = False )
189189 mgr .load_plugins_from_directory (Plugins_dir )
190190 for pid , rec in getattr (mgr , "_registry" , {}).items ():
191191 try :
@@ -213,23 +213,6 @@ def _emit_log(log_cb: Optional[callable], message: str) -> None:
213213 pass
214214
215215
216- def _resolve_plugin_timeout (cfg : dict [str , Any ]) -> float :
217- """Résout le timeout effectif (config > env), <= 0 => illimité."""
218- try :
219- env_timeout = float (os .environ .get ("PYCOMPILER_BCASL_PLUGIN_TIMEOUT" , "0" ))
220- except Exception :
221- env_timeout = 0.0
222- try :
223- opt = cfg .get ("options" , {}) if isinstance (cfg , dict ) else {}
224- cfg_timeout = (
225- float (opt .get ("plugin_timeout_s" , 0.0 )) if isinstance (opt , dict ) else 0.0
226- )
227- except Exception :
228- cfg_timeout = 0.0
229- plugin_timeout = cfg_timeout if cfg_timeout != 0.0 else env_timeout
230- return float (plugin_timeout ) if plugin_timeout and plugin_timeout > 0 else 0.0
231-
232-
233216def _is_bcasl_enabled (workspace_root : Path ) -> bool :
234217 """Consulte ark.yml pour savoir si le BCASL est activé globalement."""
235218 try :
@@ -306,7 +289,6 @@ def _run_bcasl_sync(
306289 workspace_root : Path ,
307290 plugins_dir : Path ,
308291 cfg : dict [str , Any ],
309- plugin_timeout : float ,
310292 log_cb : Optional [callable ] = None ,
311293 stop_requested : Optional [callable ] = None ,
312294 build_context : Optional [Any ] = None ,
@@ -315,7 +297,6 @@ def _run_bcasl_sync(
315297 manager = BCASL (
316298 workspace_root ,
317299 config = cfg ,
318- plugin_timeout_s = plugin_timeout ,
319300 build_context = build_context ,
320301 )
321302 loaded , errors = manager .load_plugins_from_directory (plugins_dir )
@@ -439,10 +420,15 @@ def _read_yml(p: Path) -> dict[str, Any]:
439420
440421 ark_config = load_ark_config (str (workspace_root ))
441422
442- # exclusion_patterns est désormais dans workspace: exclude
443- workspace_cfg = ark_config .get ("workspace" , {})
444- if isinstance (workspace_cfg , dict ):
445- exclude_patterns = workspace_cfg .get ("exclude" , exclude_patterns )
423+ # On privilégie build: exclude pour les actions pré-compilation
424+ build_cfg = ark_config .get ("build" , {})
425+ if isinstance (build_cfg , dict ) and "exclude" in build_cfg :
426+ exclude_patterns = build_cfg .get ("exclude" , exclude_patterns )
427+ else :
428+ # Fallback legacy ou si build: exclude est absent (peu probable avec normalization)
429+ workspace_cfg = ark_config .get ("workspace" , {})
430+ if isinstance (workspace_cfg , dict ):
431+ exclude_patterns = workspace_cfg .get ("exclude" , exclude_patterns )
446432
447433 # inclusion_patterns n'est plus supporté (l'exclusion suffit)
448434
@@ -467,9 +453,7 @@ def _read_yml(p: Path) -> dict[str, Any]:
467453 "file_patterns" : file_patterns ,
468454 "exclude_patterns" : exclude_patterns ,
469455 "options" : {
470- "plugin_timeout_s" : plugin_timeout ,
471456 "sandbox" : True ,
472- "plugin_parallelism" : 0 ,
473457 "iter_files_cache" : True ,
474458 },
475459 "phases" : default_phases ,
@@ -547,17 +531,8 @@ def ensure_bcasl_thread_stopped(self, timeout_ms: int = 5000) -> None:
547531
548532
549533def resolve_bcasl_timeout (self ) -> float :
550- """Résout le timeout effectif des plugins à partir de la config et de l'env.
551- <= 0 => illimité (0.0 renvoyé)
552- """
553- try :
554- if not getattr (self , "workspace_dir" , None ):
555- return 0.0
556- workspace_root = Path (self .workspace_dir ).resolve ()
557- cfg = _load_workspace_config (workspace_root )
558- return _resolve_plugin_timeout (cfg )
559- except Exception :
560- return 0.0
534+ """Legacy resolve_bcasl_timeout - returns 0.0 (no timeout)."""
535+ return 0.0
561536
562537
563538def open_bc_loader_dialog (self ) -> None :
@@ -647,7 +622,6 @@ def run_pre_compile_async(
647622 Plugins_dir = _get_plugins_dir ()
648623
649624 cfg = _load_workspace_config (workspace_root )
650- plugin_timeout = _resolve_plugin_timeout (cfg )
651625
652626 # Vérifier si BCASL est activé globalement via ark.yml
653627 if not _is_bcasl_enabled (workspace_root ):
@@ -676,7 +650,6 @@ def run_pre_compile_async(
676650 workspace_root ,
677651 Plugins_dir ,
678652 cfg ,
679- plugin_timeout ,
680653 build_context = build_context ,
681654 )
682655 try :
@@ -709,7 +682,6 @@ def run_pre_compile_async(
709682 workspace_root ,
710683 Plugins_dir ,
711684 cfg ,
712- plugin_timeout ,
713685 log_cb = log_cb ,
714686 build_context = build_context ,
715687 )
@@ -747,7 +719,6 @@ def run_pre_compile(self, build_context: Optional[Any] = None) -> Optional[objec
747719 Plugins_dir = _get_plugins_dir ()
748720
749721 cfg = _load_workspace_config (workspace_root )
750- plugin_timeout = _resolve_plugin_timeout (cfg )
751722
752723 # Vérifier si BCASL est activé globalement via ark.yml
753724 if not _is_bcasl_enabled (workspace_root ):
@@ -765,7 +736,6 @@ def run_pre_compile(self, build_context: Optional[Any] = None) -> Optional[objec
765736 workspace_root ,
766737 Plugins_dir ,
767738 cfg ,
768- plugin_timeout ,
769739 log_cb = log_cb ,
770740 build_context = build_context ,
771741 )
0 commit comments