1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .Base import (
17- BCASL_PLUGIN_REGISTER_FUNC ,
18- _PluginRecord ,
19- BcPluginBase ,
20- ExecutionItem ,
21- ExecutionReport ,
22- PluginMeta ,
23- PreCompileContext ,
24- _logger ,
25- )
26-
2716import heapq
2817import importlib .util
29- import multiprocessing as mp
3018import math
19+ import multiprocessing as mp
3120import os
3221import signal
3322import subprocess
3726from pathlib import Path
3827from typing import Any , Optional
3928
29+ from .Base import (
30+ BCASL_PLUGIN_REGISTER_FUNC ,
31+ BcPluginBase ,
32+ ExecutionItem ,
33+ ExecutionReport ,
34+ PluginMeta ,
35+ PreCompileContext ,
36+ _logger ,
37+ _PluginRecord ,
38+ )
39+
4040_ACTIVE_WORKER_PIDS : set [int ] = set ()
4141_ACTIVE_WORKER_LOCK = threading .Lock ()
4242
@@ -121,7 +121,7 @@ def _normalize_tags(tags: Any) -> list[str]:
121121def _tag_priority_from_tags (tags : Any ) -> int :
122122 """Calcule la priorité basée sur les tags."""
123123 try :
124- from .tagging import TAG_PRIORITY_MAP , DEFAULT_TAG_PRIORITY
124+ from .tagging import DEFAULT_TAG_PRIORITY , TAG_PRIORITY_MAP
125125
126126 norm = _normalize_tags (tags )
127127 if not norm :
@@ -902,7 +902,7 @@ def run_pre_compile(
902902 continue
903903
904904 _logger .info ("--- Phase: %s ---" , pname )
905-
905+
906906 # Sous-ensemble d'items pour cette phase
907907 p_items = {pid : active_items [pid ] for pid in p_ids }
908908 indeg , children = _build_dependency_graph (p_items )
@@ -914,24 +914,39 @@ def run_pre_compile(
914914 for pid in order :
915915 rec = p_items [pid ]
916916 if skip_dependents_on_failure :
917- failed_dep = next ((d for d in rec .requires if d in failed_seq ), None )
917+ failed_dep = next (
918+ (d for d in rec .requires if d in failed_seq ), None
919+ )
918920 if failed_dep :
919- _record_dependency_blocked (report , plugin_id = pid , name = rec .plugin .meta .name , failed_dep = str (failed_dep ))
921+ _record_dependency_blocked (
922+ report ,
923+ plugin_id = pid ,
924+ name = rec .plugin .meta .name ,
925+ failed_dep = str (failed_dep ),
926+ )
920927 failed_seq .add (pid )
921928 continue
922-
923- # Note: On respecte toujours le mode sandbox (processus isolé) si activé,
929+
930+ # Note: On respecte toujours le mode sandbox (processus isolé) si activé,
924931 # mais on lance les plugins l'un après l'autre.
925- ok = _run_plugin_sequential (report , rec , ctx , self .project_root , self .plugin_timeout_s , eff_sandbox , stop_requested )
932+ ok = _run_plugin_sequential (
933+ report ,
934+ rec ,
935+ ctx ,
936+ self .project_root ,
937+ self .plugin_timeout_s ,
938+ eff_sandbox ,
939+ stop_requested ,
940+ )
926941 if not ok :
927942 failed_seq .add (pid )
928- if fail_fast : return report
943+ if fail_fast :
944+ return report
929945
930946 _logger .info (report .summary ())
931947 return report
932948
933949
934-
935950def _plugin_worker (
936951 module_path : str , plugin_id : str , project_root : str , config : dict [str , Any ], q
937952) -> None :
0 commit comments