fix: 运行状态与日志三处修复;依赖改用 uv 锁 + 国内镜像
- 重启标记不再污染新一轮运行:hydrate_runs() 标记「已中断」后立即落库,runtime.set_state() 在切入 discovering/studying 时清掉上一轮的 error/progress/finished_at - 服务重启后卡片「课程日志」能读到 SQLite 历史:前端兜底条件不再拿 status 是否为空做判断(重启后 status 恒为 interrupted) - 删除账号连带清日志:account_delete() 按账号 id + 用户名清 run_state/run_log/login_log,删除接口同时清内存里两个 key - 新增 uv.lock 依赖锁定;pyproject 走阿里云 PyPI 镜像,Dockerfile 支持 PIP_INDEX_URL 构建参数 - 文档移入 docs/,.gitignore 忽略 *.egg-info/(uv run 可编辑安装产物)
This commit is contained in:
@@ -10,13 +10,24 @@
|
||||
start.bat
|
||||
```
|
||||
|
||||
或手动:
|
||||
或手动(uv,依赖版本已锁在 `uv.lock`):
|
||||
|
||||
```bat
|
||||
pip install -r requirements.txt
|
||||
uv sync
|
||||
uv run app.py
|
||||
```
|
||||
|
||||
没有 uv 就用 pip(Docker 镜像里也是走的这条):
|
||||
|
||||
```bat
|
||||
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
|
||||
python app.py
|
||||
```
|
||||
|
||||
依赖默认走阿里云镜像:uv 的源配在 `pyproject.toml`,`uv.lock` 里记录的也是它;Dockerfile 用 `PIP_INDEX_URL` 构建参数(默认阿里云,`--build-arg PIP_INDEX_URL=https://pypi.org/simple` 可回官方源)。临时换源:`UV_DEFAULT_INDEX=https://mirrors.cloud.tencent.com/pypi/simple uv sync`。清华源 `pypi.tuna.tsinghua.edu.cn` 会 403 uv 的 JSON simple 请求,不要设。
|
||||
|
||||
`ddddocr` 依赖 `onnxruntime`,后者只对 Python 3.10–3.14 的正式版发轮子;3.15 / free-threaded / ARM 上会装不上(`ResolutionImpossible`)。缺它只影响广东公需课的验证码识别,其余平台不受影响。
|
||||
|
||||
浏览器打开 <http://127.0.0.1:8848>(`localhost` 也可以,服务同时监听 `::1`)。
|
||||
|
||||
换端口 / 对外开放:
|
||||
|
||||
Reference in New Issue
Block a user