Files
Haocode/requirements.txt
T
sorrow404null 554be4f92b feat(renderer): platform-gated dual renderer backend with isolated QtWebEngine profiles
Windows prefers WebView2, Linux uses QtWebEngine only; pythonnet deps are win32-marked. Each QtWebEngine instance gets its own profile under data/webengine, and Chromium flags are sanitized before QApplication (--no-sandbox accepted only for explicit root/container use).
2026-09-17 16:40:03 +08:00

59 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# haocode 运行依赖
# ---------------------------------------------------------------------------
# 环境:Windows 10/11 x64 + Python 3.10(开发环境为 miniconda env: haocode
# 安装:pip install -r requirements.txt
# 说明:本清单只列**代码真实 import 到**的第三方包(已用 AST 全量扫描核对),
# 不含开发机上其它项目的包(numpy / matplotlib / pillow / paramiko 等均未使用)。
# ---------------------------------------------------------------------------
# ---- GUI 框架(PyQt6----
PyQt6==6.10.2
PyQt6-Qt6==6.10.2
# ---- 渲染回退:QtWebEngineWebView2 不可用 / 无头 / 多实例时自动使用)----
# 注:WebView2 是首选渲染器,但它依赖微软运行时 + vendor/webview2/ 里的 .NET SDK
# 不走 pipQtWebEngine 是本项目自带的兜底渲染路径,必须装。
PyQt6-WebEngine==6.10.0
PyQt6-WebEngine-Qt6==6.10.2
# ---- 大模型 SDKOpenAI 兼容接口;DeepSeek / opencode-go / 自建反代均走它)----
openai==2.26.0
# ---- WebView2 绑定:pythonnetimport clr+ 其加载器(仅 WindowsLinux 自动跳过)----
pythonnet==3.1.0; sys_platform == "win32"
clr_loader==0.3.1; sys_platform == "win32"
# ---- PDF 附件解析(ui/views/main_window.py → tools/builtin_tools/pdf_reader.py----
PyMuPDF==1.28.0
# ===========================================================================
# Linux 源码运行(Ubuntu 22.04/24.04 x64,仅 QtWebEngine;不装 WebView2 任何东西)
# ===========================================================================
# 1) pip install -r requirements.txt # pythonnet/clr_loader 带平台 markerLinux 自动跳过
# 2) 安装 QtWebEngine 运行所需的系统库(apt,按需选装):
# sudo apt install -y libnss3 libxkbcommon0 libfontconfig1 libdbus-1-3 \
# libgl1 libegl1 libasound2t64 # 24.04 用 libasound2t6422.04 用 libasound2
# 离屏测试另需:QT_QPA_PLATFORM=offscreen
# 3) 运行:python3.10 main.py
# - 只使用 QtWebEngine;每实例独立 profiledata/webengine/profile_<pid>_*
# - root/容器启动若页面空白:显式 QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox" python3.10 main.py
# (启动会打印高可见风险警告;普通桌面不要加)
# ===========================================================================
# 以下仅在需要时安装
# ===========================================================================
# ---- 打包 exe(可选)----
# PyInstaller==6.21.0
# pyinstaller-hooks-contrib==2026.6
# ===========================================================================
# 不需要 pip 安装的运行时依赖(重要)
# ===========================================================================
# 1) vendor/webview2/ WebView2 .NET SDKCore.dll+ webview2loader_x64.dll
# 已随仓库提供,勿删;缺失 → 自动回落 QtWebEngine
# 2) WebView2Loader.dll 项目根目录的 loader(CWD 兜底路径)
# 3) WebView2 Runtime(系统级) Win11 自带;Win10 需安装 Evergreen Runtime
# 4) Node.js 仅 tests/test_math_extract.js 需要(可选)
# 5) pytest 不需要!tests/run_tests.py 自带 harness 并 stub 掉 pytest