refactor(executors): 移除私有函数前缀并修正导入

This commit is contained in:
2026-06-21 08:18:46 +08:00
parent 08eb743ea9
commit 22ae4b0084
3 changed files with 33 additions and 13 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ class Strategy(enum.Enum):
ASYNC = "async"
def _normalize_strategy(strategy: str | Strategy) -> Strategy:
def normalize_strategy(strategy: str | Strategy) -> Strategy:
"""将字符串或 Strategy 归一化为 Strategy 枚举.
Parameters
@@ -436,7 +436,7 @@ def run(
任何任务耗尽重试后仍失败时。运行在失败层中止;后续层的任务
不会被执行。
"""
normalized = _normalize_strategy(strategy)
normalized = normalize_strategy(strategy)
graph.validate()
layers = graph.layers()
+2 -2
View File
@@ -26,7 +26,7 @@ import sys
from typing import Sequence
from .errors import PyFlowXError
from .executors import Strategy, _normalize_strategy, run
from .executors import Strategy, normalize_strategy, run
from .graph import Graph
__all__ = ["CliExitCode", "CliRunner"]
@@ -132,7 +132,7 @@ class CliRunner:
f"CliRunner 命令 {name!r} 的值必须是 Graph 实例, 实际是 {type(graph).__name__}"
)
self._graphs: dict[str, Graph] = dict(graphs)
self._strategy: Strategy = _normalize_strategy(strategy)
self._strategy: Strategy = normalize_strategy(strategy)
self._description: str = description
self._verbose: bool = verbose