chore: bump version to 0.1.7
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ license = { text = "MIT" }
|
|||||||
name = "pyflowx"
|
name = "pyflowx"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
autofmt = "pyflowx.cli.autofmt:main"
|
autofmt = "pyflowx.cli.autofmt:main"
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ from .runner import CliExitCode, CliRunner
|
|||||||
from .storage import JSONBackend, MemoryBackend, StateBackend
|
from .storage import JSONBackend, MemoryBackend, StateBackend
|
||||||
from .task import TaskCmd, TaskEvent, TaskResult, TaskSpec, TaskStatus
|
from .task import TaskCmd, TaskEvent, TaskResult, TaskSpec, TaskStatus
|
||||||
|
|
||||||
__version__ = "0.1.6"
|
__version__ = "0.1.7"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"IS_LINUX",
|
"IS_LINUX",
|
||||||
|
|||||||
@@ -295,13 +295,11 @@ def main() -> None:
|
|||||||
# 清理构建目录
|
# 清理构建目录
|
||||||
"clean": px.Graph.from_specs([clean_build]),
|
"clean": px.Graph.from_specs([clean_build]),
|
||||||
# 完整打包流程
|
# 完整打包流程
|
||||||
"all": px.Graph.from_specs(
|
"all": px.Graph.from_specs([
|
||||||
[
|
pack_source_default,
|
||||||
pack_source_default,
|
pack_deps_default,
|
||||||
pack_deps_default,
|
pack_wheel_default,
|
||||||
pack_wheel_default,
|
]),
|
||||||
]
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
runner.run_cli()
|
runner.run_cli()
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
|
||||||
|
|
||||||
import pyflowx as px
|
import pyflowx as px
|
||||||
from pyflowx.conditions import Constants
|
from pyflowx.conditions import Constants
|
||||||
@@ -25,54 +24,14 @@ def main() -> None:
|
|||||||
nargs="+",
|
nargs="+",
|
||||||
help="进程名称 (如: chrome.exe python node)",
|
help="进程名称 (如: chrome.exe python node)",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"--strategy",
|
|
||||||
choices=["sequential", "thread"],
|
|
||||||
default="sequential",
|
|
||||||
help="执行策略 (默认: sequential)",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--dry-run",
|
|
||||||
action="store_true",
|
|
||||||
help="只打印执行计划, 不实际运行",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--quiet",
|
|
||||||
action="store_true",
|
|
||||||
help="静默模式, 不显示执行过程",
|
|
||||||
)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# 动态创建 TaskSpec
|
if Constants.IS_WINDOWS:
|
||||||
specs: list[px.TaskSpec] = []
|
cmd = ["taskkill", "/f", "/im"]
|
||||||
for proc_name in args.process_names:
|
else:
|
||||||
if Constants.IS_WINDOWS:
|
cmd = ["pkill", "-f"]
|
||||||
cmd = ["taskkill", "/f", "/im", f"{proc_name}*"]
|
|
||||||
else:
|
|
||||||
cmd = ["pkill", "-f", f"{proc_name}*"]
|
|
||||||
|
|
||||||
spec = px.TaskSpec(
|
graph = px.Graph.from_specs([
|
||||||
name=f"kill_{proc_name}",
|
px.TaskSpec(f"kill_{proc_name}", cmd=[*cmd, f"{proc_name}*"], verbose=True) for proc_name in args.process_names
|
||||||
cmd=cmd,
|
])
|
||||||
verbose=not args.quiet,
|
px.run(graph, strategy="thread")
|
||||||
)
|
|
||||||
specs.append(spec)
|
|
||||||
|
|
||||||
# 创建 Graph 并执行
|
|
||||||
graph = px.Graph.from_specs(specs)
|
|
||||||
|
|
||||||
try:
|
|
||||||
report = px.run(
|
|
||||||
graph,
|
|
||||||
strategy=args.strategy,
|
|
||||||
dry_run=args.dry_run,
|
|
||||||
verbose=not args.quiet,
|
|
||||||
)
|
|
||||||
sys.exit(0 if report.success else 1)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("\n操作已取消", file=sys.stderr)
|
|
||||||
sys.exit(130)
|
|
||||||
except px.PyFlowXError as e:
|
|
||||||
print(f"错误: {e}", file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user