已开启
fix: guard example execution during test collection #1
fix: guard example execution during test collection #1
已开启
阿彪创建于 7月30日
阿彪
阿彪
7月30日

修改内容

  • 将示例推理流程封装到 main()
  • 把 MineruEngine 导入移入执行函数,避免模块导入时加载 Ray/GPU 依赖
  • 增加 if __name__ == "__main__": 入口,保留脚本直接运行行为

验证

  • 在未安装 Ray 的环境中安全导入 test/test_main.py
  • python -m pytest --collect-only -q 不再出现导入错误;仓库当前没有可收集的测试,因此 pytest 返回“no tests collected”
  • python -m compileall -q flash_mineru test
  • git diff --check

Closes #1

likedislike
合并受阻
阿彪阿彪
7月30日 关联了issue:pytest 收集 test_main.py 时会启动 Ray/GPU 推理