在准备环境前提交次全部更改。
This commit is contained in:
21
scripts/ops/_run_dataflow.py
Normal file
21
scripts/ops/_run_dataflow.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""临时包装脚本:确保从项目根目录运行 analyze_dataflow.py"""
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
# 切换到项目根目录
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
os.chdir(root)
|
||||
print(f"[wrapper] cwd = {os.getcwd()}", flush=True)
|
||||
|
||||
# 将 scripts/ops 加入 sys.path
|
||||
scripts_ops = os.path.join(root, "scripts", "ops")
|
||||
if scripts_ops not in sys.path:
|
||||
sys.path.insert(0, scripts_ops)
|
||||
|
||||
try:
|
||||
from analyze_dataflow import main
|
||||
main()
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user