build: 配置国内PyPI镜像源加速依赖安装
CI / Lint, Typecheck & Test (push) Failing after 1m51s

This commit is contained in:
2026-07-04 09:50:15 +08:00
parent f63db6c71a
commit 0edeadb846
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -2,6 +2,12 @@
# 备选镜像源前缀:docker.1ms.run / dockerpull.com / docker.xuanyuan.me
FROM docker.m.daocloud.io/python:3.13-slim
# 国内镜像源(清华)
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
ENV UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ENV UV_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
# 环境变量:非交互 + 路径配置
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
+2 -1
View File
@@ -286,7 +286,8 @@ def pdf_ocr(input_path: Path, output_path: Path, lang: str = "chi_sim+eng") -> N
new_page = new_doc.new_page(width=page.rect.width, height=page.rect.height)
new_page.insert_image(new_page.rect, pixmap=pix)
text_rect = fitz.Rect(0, 0, page.rect.width, page.rect.height)
new_page.insert_textbox(text_rect, ocr_text)
# pyrefly: ignore [bad-argument-type]
new_page.insert_textbox(text_rect, ocr_text, fontname="china-ss", fontsize=11)
output_path.parent.mkdir(parents=True, exist_ok=True)
new_doc.save(str(output_path))