chore: add locked requirements

This commit is contained in:
chengma
2026-07-02 16:09:59 +08:00
parent 599f2a171c
commit e52da68835
6 changed files with 35 additions and 9 deletions
+6 -1
View File
@@ -1020,4 +1020,9 @@
- 代码:`app/ai.py` 的 `generate_batch()` 按 `generate_cover` 分支执行;关闭时只生成标题,标题成功即 `db.set_generated(task_id, new_title, None)` 并进入 `generated`,不调用 `gen_cover()`、不渲染封面提示词、不创建新封面文件;开启时保留标题后图片两段流程。
- GUI:`app/gui.py` 在②底部增加「生成封面图片(成本较高)」复选框;开始生成前保存当前开关;标题-only 模式进度显示 `图片0/0`,运行日志写明“本轮仅生成标题,不生成图片”,完成统计使用 `generated_done`,避免只看 `cover_done`。
- 测试:`tests/test_appconfig.py` 覆盖默认关闭;`tests/test_ai.py` 覆盖跳过封面时不调用 `gen_cover` 且任务进入 generated;`tests/test_gui.py` 覆盖开关持久化、Worker 标题-only 日志/运行日志统计,以及旧图片路径显式开启开关。
- 验证:`python -m py_compile app\appconfig.py app\ai.py app\gui.py tests\test_appconfig.py tests\test_ai.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p "test_appconfig.py"` 通过(7 tests);`python -m unittest discover -s tests -p "test_ai.py"` 通过(8 tests);`python -m unittest discover -s tests -p "test_gui.py"` 通过(70 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(159 tests);`git diff --check` 无空白错误,仅 LF/CRLF 提示。Qt 仍有本机字体目录提示,不影响测试结果。
- 验证:`python -m py_compile app\appconfig.py app\ai.py app\gui.py tests\test_appconfig.py tests\test_ai.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p "test_appconfig.py"` 通过(7 tests);`python -m unittest discover -s tests -p "test_ai.py"` 通过(8 tests);`python -m unittest discover -s tests -p "test_gui.py"` 通过(70 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(159 tests);`git diff --check` 无空白错误,仅 LF/CRLF 提示。Qt 仍有本机字体目录提示,不影响测试结果。
## 【2026-07-02】T-521 完成 · 依赖清单(锁版本 requirements)
- 代码/配置:新增根目录 `requirements.txt`,锁定当前直接运行依赖:PySide6==6.5.3、openpyxl==3.1.3、requests==2.31.0、websocket-client==1.6.1、Pillow==9.5.0;不新增运行时依赖,不改业务代码。
- 文档:`docs/03-tech-stack.md` 的安装命令改为 `python -m pip install -r requirements.txt`,并补充依赖纪律;`docs/README.md` 增加运行环境安装命令;`docs/06-tasks.md` 标记 T-521 DONE;`docs/current-state.md` 同步当前快照和下一任务 T-522。
- 验证:`python -c "import PySide6, openpyxl, requests, websocket, PIL; ..."` 确认当前版本;`python -m pip install --no-index -r requirements.txt` 确认当前环境已满足锁定依赖且不触网;`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(159 tests)。`python -m pip check` 在全局环境发现 albumentations/paddleocr/flask-babel 等非本项目包的既有依赖冲突,非 T-521 新增依赖导致;本项目锁定的 5 个直接依赖可正常 import。