Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

chore: align Python 3.11-3.14 support and release checks

myhloli92613d738d9a
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 81915f8d..acf43e67 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -106,13 +106,12 @@ body:
id: python_version
attributes:
label: Python version | Python 版本
- description: Python >=3.10,<3.15; see python --version. | 支持 Python >=3.10,<3.15,可通过 python --version 查看。
+ description: Python >=3.11,<3.15; see python --version. | 支持 Python >=3.11,<3.15,可通过 python --version 查看。
options:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- - "3.10"
- Other / unknown | 其他或不清楚
validations:
required: true
diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml
index 720a5aa3..8df06552 100644
--- a/.github/workflows/cli.yml
+++ b/.github/workflows/cli.yml
@@ -13,31 +13,64 @@ on:
jobs:
cli-test:
if: github.repository == 'opendatalab/MinerU'
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}
timeout-minutes: 240
strategy:
- fail-fast: true
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ python: ['3.11', '3.12', '3.13', '3.14']
+ defaults:
+ run:
+ shell: bash
+ env:
+ PYTHONUTF8: '1'
steps:
- name: PDF cli
uses: actions/checkout@v6
with:
- ref: dev
fetch-depth: 2
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ matrix.python }}
+
- name: install uv
uses: astral-sh/setup-uv@v7
- - name: install&test
+ - name: Install and check dependencies
run: |
uv --version
- uv venv --python 3.12
- source .venv/bin/activate
- uv pip install .[test]
- cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
+ uv venv --python "$(python -c 'import sys; print(sys.executable)')"
+ uv pip install '.[test]'
+ uv pip check
+
+ - name: Check Python syntax
+ run: uv run --no-project --no-sync python -m compileall -q mineru scripts tests
+
+ - name: Run Linux unit tests
+ if: runner.os == 'Linux' && matrix.python != '3.12'
+ run: uv run --no-project --no-sync python -m pytest -o addopts='' tests/unittest
+
+ - name: Run Linux unit tests with coverage
+ if: runner.os == 'Linux' && matrix.python == '3.12'
+ run: |
+ uv run --no-project --no-sync python tests/clean_coverage.py
# 统一使用 pytest-cov 采集覆盖率,避免叠加启动 coverage 采集器。
- cd $GITHUB_WORKSPACE && python -m pytest tests/unittest
- cd $GITHUB_WORKSPACE && python tests/get_coverage.py
+ uv run --no-project --no-sync python -m pytest tests/unittest
+ uv run --no-project --no-sync python tests/get_coverage.py
+
+ - name: Run Windows and macOS public contract tests
+ if: runner.os != 'Linux'
+ run: |
+ uv run --no-project --no-sync python -m pytest -o addopts='' \
+ tests/unittest/test_docvortex_import_boundary.py \
+ tests/unittest/test_backend_architecture.py \
+ tests/unittest/test_docvortex_protocol.py \
+ tests/unittest/test_docvortex_routing.py \
+ tests/unittest/test_parser_api_contract.py
# notify_to_feishu:
# if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure')}}
diff --git a/.github/workflows/docvortex-boundary.yml b/.github/workflows/docvortex-boundary.yml
index 75bbf3b2..8a3af768 100644
--- a/.github/workflows/docvortex-boundary.yml
+++ b/.github/workflows/docvortex-boundary.yml
@@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
- python: ['3.10', '3.13', '3.14']
+ python: ['3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.os }}
defaults:
run:
@@ -72,7 +72,7 @@ jobs:
import os
from pathlib import Path
import re
- # 使用引擎所声明的工具链;Python 3.10 无需为读取单一字段额外安装 TOML 包。
+ # 使用引擎所声明的工具链,只提取构建所需的 channel 字段。
text = Path(".boundary/docvortex-src/rust-toolchain.toml").read_text(encoding="utf-8")
match = re.search(r'^\s*channel\s*=\s*["\']([A-Za-z0-9][A-Za-z0-9.+-]*)["\']', text, re.MULTILINE)
if match is None:
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index 3f915b3f..8c556d54 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -30,7 +30,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
- python-version: "3.10"
+ python-version: "3.11"
- name: Update version.py
run: |
@@ -62,42 +62,43 @@ jobs:
git push origin HEAD:master
check-install:
- needs: [ update-version ]
- runs-on: ubuntu-latest
+ needs: [ build ]
+ runs-on: ${{ matrix.os }}
+ env:
+ PYTHONUTF8: '1'
strategy:
fail-fast: false
matrix:
- python-version: ["3.10", "3.11", "3.12", "3.13"]
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
+ defaults:
+ run:
+ shell: bash
steps:
- - name: Checkout code
- uses: actions/checkout@v6
+ - name: Download release wheel
+ uses: actions/download-artifact@v7
with:
- ref: master
- fetch-depth: 0
-
- - name: Verify version.py
- run: |
- ls -l mineru/version.py
- cat mineru/version.py
+ name: wheel-file
+ path: dist
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- - name: Install mineru
+ - name: Install and verify release wheel
run: |
python -m pip install --upgrade pip
- pip install -e .[core]
+ python -m pip install dist/*.whl
+ python -m pip check
+ python -I -c "from mineru.parser import MinerUParser, MinerUApiParser, parse, parse_async; from mineru.render import render; from mineru.types import MiddleJson"
+ mineru version --json
+ mineru-kit --version
build:
- needs: [ check-install ]
+ needs: [ update-version ]
runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- python-version: [ "3.10"]
steps:
@@ -107,6 +108,11 @@ jobs:
ref: master
fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: "3.11"
+
- name: Install build tools
run: |
python -m pip install wheel
@@ -119,6 +125,23 @@ jobs:
- name: Check wheel metadata
run: |
python -m twine check --strict dist/*.whl
+ python - <<'PY'
+ from email.parser import BytesParser
+ from pathlib import Path
+ from zipfile import ZipFile
+
+ from packaging.specifiers import SpecifierSet
+
+ # 核验待发布产物的实际声明,安装矩阵与发布任务复用同一份 wheel。
+ wheels = list(Path("dist").glob("*.whl"))
+ assert len(wheels) == 1, wheels
+ with ZipFile(wheels[0]) as archive:
+ metadata_path = next(name for name in archive.namelist() if name.endswith(".dist-info/METADATA"))
+ metadata = BytesParser().parsebytes(archive.read(metadata_path))
+ assert SpecifierSet(metadata["Requires-Python"]) == SpecifierSet(">=3.11,<3.15"), metadata["Requires-Python"]
+ classifiers = set(metadata.get_all("Classifier", []))
+ assert all(f"Programming Language :: Python :: 3.{minor}" in classifiers for minor in range(11, 15))
+ PY
- name: Upload artifact
uses: actions/upload-artifact@v6
@@ -128,7 +151,7 @@ jobs:
retention-days: 30
publish:
- needs: [ build ]
+ needs: [ build, check-install ]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment:
diff --git a/README.md b/README.md
index db3088e7..ca58c0ba 100644
--- a/README.md
+++ b/README.md
@@ -68,7 +68,7 @@ Install or update the global `mineru` skill. First, run `npx skills add opendata
### Install Manually
-Python `>=3.10,<3.15`. Install MinerU 4.0 stable in a virtual environment:
+Python `>=3.11,<3.15`. Install MinerU 4.0 stable in a virtual environment:
```bash
pip install uv
@@ -256,10 +256,12 @@ mineru version --json
If `mineru version --json` fails, try `mineru --version` for older CLIs. If the detected version does not meet this requirement, tell the user which version was found and ask before upgrading it. If approved, upgrade with the same installer and environment, then check the version again. If declined, stop and do not run this skill's commands. Never assume compatibility when the version cannot be determined.
-MinerU requires Python `>=3.10,<3.15`.
+MinerU requires Python `>=3.11,<3.15`.
### Upgrade An Existing Installation
+If the existing environment uses Python older than 3.11, stop MinerU services and recreate the environment with Python 3.11–3.14 using the same environment manager before reinstalling MinerU. Update interpreter paths in service startup configuration and verify the result with `mineru version --json`. Python 3.12 remains the recommended starting point.
+
Before upgrading, determine which tool owns the resolved `mineru` executable. Check `uv tool list`, then `pipx list --short`; otherwise, identify the Python environment containing the executable. Do not use an unrelated `pip` or install a second copy.
Before an in-place upgrade or reinstall, stop the MinerU server. On Windows, confirm that status reports `running=false` before modifying the environment:
@@ -292,7 +294,6 @@ uv python find 3.12
uv python find 3.13
uv python find 3.14
uv python find 3.11
-uv python find 3.10
```
If all `uv python find` commands failed, download Python 3.12 with `uv`:
@@ -318,13 +319,13 @@ PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)"
"$PIPX_DEFAULT_PYTHON" --version
```
-Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.15`, install with `pipx`:
+Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.11,<3.15`, install with `pipx`:
```bash
pipx install "mineru>=4.0,<5"
```
-If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.15`.
+If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.11,<3.15`.
```bash
command -v python3.12
@@ -343,11 +344,11 @@ pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"
If neither `uv` nor `pipx` is available, but `pip` or `pip3` is available, check the Python version of the `pip` command, and ask the user before installing into the global python environment:
```bash
-which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
+which -a pip pip3 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
pip --version
```
-If a `pip` command reports Python `>=3.10,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
+If a `pip` command reports Python `>=3.11,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
```bash
pip install "mineru>=4.0,<5"
@@ -355,7 +356,7 @@ pip install "mineru>=4.0,<5"
### If No Supported Installer Is Available
-If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.15`, recommend that the user install `uv` first.
+If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.11,<3.15`, recommend that the user install `uv` first.
### After Installation
diff --git a/README_zh-CN.md b/README_zh-CN.md
index 31597932..cc9a88be 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -68,7 +68,7 @@ Install or update the global `mineru` skill. First, run `npx skills add opendata
### 手动安装
-Python `>=3.10,<3.15`,在虚拟环境中安装 4.0 正式版:
+Python `>=3.11,<3.15`,在虚拟环境中安装 4.0 正式版:
```bash
pip install uv
@@ -226,10 +226,12 @@ mineru version --json
If `mineru version --json` fails, try `mineru --version` for older CLIs. If the detected version does not meet this requirement, tell the user which version was found and ask before upgrading it. If approved, upgrade with the same installer and environment, then check the version again. If declined, stop and do not run this skill's commands. Never assume compatibility when the version cannot be determined.
-MinerU requires Python `>=3.10,<3.15`.
+MinerU requires Python `>=3.11,<3.15`.
### Upgrade An Existing Installation
+If the existing environment uses Python older than 3.11, stop MinerU services and recreate the environment with Python 3.11–3.14 using the same environment manager before reinstalling MinerU. Update interpreter paths in service startup configuration and verify the result with `mineru version --json`. Python 3.12 remains the recommended starting point.
+
Before upgrading, determine which tool owns the resolved `mineru` executable. Check `uv tool list`, then `pipx list --short`; otherwise, identify the Python environment containing the executable. Do not use an unrelated `pip` or install a second copy.
Before an in-place upgrade or reinstall, stop the MinerU server. On Windows, confirm that status reports `running=false` before modifying the environment:
@@ -262,7 +264,6 @@ uv python find 3.12
uv python find 3.13
uv python find 3.14
uv python find 3.11
-uv python find 3.10
```
If all `uv python find` commands failed, download Python 3.12 with `uv`:
@@ -288,13 +289,13 @@ PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)"
"$PIPX_DEFAULT_PYTHON" --version
```
-Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.15`, install with `pipx`:
+Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.11,<3.15`, install with `pipx`:
```bash
pipx install "mineru>=4.0,<5"
```
-If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.15`.
+If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.11,<3.15`.
```bash
command -v python3.12
@@ -313,11 +314,11 @@ pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"
If neither `uv` nor `pipx` is available, but `pip` or `pip3` is available, check the Python version of the `pip` command, and ask the user before installing into the global python environment:
```bash
-which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
+which -a pip pip3 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
pip --version
```
-If a `pip` command reports Python `>=3.10,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
+If a `pip` command reports Python `>=3.11,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
```bash
pip install "mineru>=4.0,<5"
@@ -325,7 +326,7 @@ pip install "mineru>=4.0,<5"
### If No Supported Installer Is Available
-If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.15`, recommend that the user install `uv` first.
+If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.11,<3.15`, recommend that the user install `uv` first.
### After Installation
diff --git a/docs/docvortex-0.4-migration.md b/docs/docvortex-0.4-migration.md
index 2e30c0ce..7f75d22c 100644
--- a/docs/docvortex-0.4-migration.md
+++ b/docs/docvortex-0.4-migration.md
@@ -36,4 +36,4 @@ MinerU 使用 `docvortex>=0.4.0,<0.5.0`。本轮调整 Python 模块边界,保
`tools/validate_docvortex_boundary.py` 可对指定两仓库源码或当前安装包捕获真实 PDF 的中间协议与全部渲染。记录实际导入路径、样本 SHA256 和页数;比较时只允许忽略 DocVortex producer 版本、DOCX/EPUB 容器时间字段,以及经独立复算确认由 producer 版本派生的 EPUB 标识。
-MinerU 的 `DocVortex boundary integration` 手动工作流接受未发布的 0.4 wheel URL,以及可选的 mineru-vl-utils 配套 wheel URL,在三种操作系统及 Python 3.10、3.13、3.14 上验证边界、协议和固定推理结果。DocVortex 自身 CI 验证独立安装与基础算法。配置工作流不代表已经通过远端 CI。
+MinerU 的 `DocVortex boundary integration` 手动工作流接受未发布的 0.4 wheel URL,以及可选的 mineru-vl-utils 配套 wheel URL,在三种操作系统及 Python 3.11–3.14 上验证边界、协议和固定推理结果。DocVortex 自身 CI 验证独立安装与基础算法。配置工作流不代表已经通过远端 CI。
diff --git a/docs/en/quick_start/index.md b/docs/en/quick_start/index.md
index 8c9522c4..a7e9e435 100644
--- a/docs/en/quick_start/index.md
+++ b/docs/en/quick_start/index.md
@@ -4,7 +4,7 @@ This guide targets the **MinerU 4.0 stable release**. Existing AMD and vendor ac
## Install MinerU
-The MinerU package supports Python `>=3.10,<3.15`. Python 3.12 is a practical starting point for a new environment. Optional engines such as vLLM, LMDeploy, and Torch have additional wheel, OS, and driver constraints; the package's Python range does not guarantee every engine supports that entire range.
+The MinerU package supports Python `>=3.11,<3.15`. Python 3.12 is a practical starting point for a new environment. Optional engines such as vLLM, LMDeploy, and Torch have additional wheel, OS, and driver constraints; the package's Python range does not guarantee every engine supports that entire range.
```bash
uv venv --python 3.12 .venv
diff --git a/docs/en/reference/changelog.md b/docs/en/reference/changelog.md
index 2180c405..d1645e89 100644
--- a/docs/en/reference/changelog.md
+++ b/docs/en/reference/changelog.md
@@ -4,6 +4,8 @@ This document records the release history of MinerU, including major capability
## Unreleased
+- Raised the minimum Python version to 3.11; the supported range is `>=3.11,<3.15`. Starting with the next stable release, stop MinerU services in the old environment, create a new virtual environment with Python 3.11–3.14, reinstall dependencies, and update interpreter paths in service startup configuration. Python 3.12 remains the recommended starting point. Verify the installed versions with `mineru version --json`.
+
- Image naming change: newly materialized CLI/API ZIP images now use Gradio visual-parent names, inline ordinals count all img src attributes, and collisions receive `_duplicate_n`. References update together; image bytes and MiddleJson 2.0 are unchanged. Historical ZIPs retain their stored references. Requires `docvortex>=0.4.19,<1`.
- Breaking change: removed the `--backend` option from `mineru-kit parse` (introduced during the 4.0 alphas). The option only inferred a tier and had no independent effect, so use `--tier` instead: `pipeline` → `--tier basic`; `vlm-engine`, `vlm-auto-engine`, and `vlm-http-client` → `--tier advanced`; `hybrid-engine` and `hybrid-auto-engine` → `--tier standard` (or omit the option); `flash` → `--tier flash`. Parsing with a remote VLM service is configured through the VLM server settings and is unrelated to this option.
diff --git a/docs/en/reference/migration_4.md b/docs/en/reference/migration_4.md
index b5878b6b..86444b3d 100644
--- a/docs/en/reference/migration_4.md
+++ b/docs/en/reference/migration_4.md
@@ -13,7 +13,7 @@
| Old HTTP parsing calls | V1 uploads → parse jobs → output files |
| Extras such as `mineru[core]` and `mineru[pipeline]` | Base package, `mineru[torch]`, or `mineru[full]` |
-Install stable with `"mineru>=4.0,<5"`, inserting extras after the package name when needed. The package requires Python `>=3.10,<3.15`; optional engines also require suitable wheels and drivers. Stop services in the original environment before upgrading and check `mineru version --json` afterwards. Do not replace legacy platform images or installation commands with mainline 4.0 instructions.
+Install stable with `"mineru>=4.0,<5"`, inserting extras after the package name when needed. The package requires Python `>=3.11,<3.15`; optional engines also require suitable wheels and drivers. Stop services in the original environment before upgrading and check `mineru version --json` afterwards. Do not replace legacy platform images or installation commands with mainline 4.0 instructions.
## Tiers, pages, and outputs
diff --git a/docs/next/transformers5-migration.md b/docs/next/transformers5-migration.md
index 0638d8e3..1e051a18 100644
--- a/docs/next/transformers5-migration.md
+++ b/docs/next/transformers5-migration.md
@@ -42,7 +42,7 @@ uv pip install --python .venv-validation/bin/python \
uv pip check --python .venv-validation/bin/python
```
-安装矩阵直接读取已构建 wheel 的元数据,覆盖三个平台、Python 3.10–3.14 与基础/torch/full/all 模式:
+安装矩阵直接读取已构建 wheel 的元数据,覆盖三个平台、Python 3.11–3.14 与基础/torch/full/all 模式:
```bash
python scripts/check_transformers5_dependencies.py \
diff --git a/docs/zh/quick_start/index.md b/docs/zh/quick_start/index.md
index 8f397c13..6d20d2db 100644
--- a/docs/zh/quick_start/index.md
+++ b/docs/zh/quick_start/index.md
@@ -4,7 +4,7 @@
## 安装 MinerU
-MinerU 包支持 Python `>=3.10,<3.15`。建议新建 Python 3.12 环境;vLLM、LMDeploy、Torch 等可选引擎还受各自 wheel、操作系统和驱动约束,包支持的 Python 范围不等于所有引擎均支持该范围。
+MinerU 包支持 Python `>=3.11,<3.15`。建议新建 Python 3.12 环境;vLLM、LMDeploy、Torch 等可选引擎还受各自 wheel、操作系统和驱动约束,包支持的 Python 范围不等于所有引擎均支持该范围。
```bash
uv venv --python 3.12 .venv
diff --git a/docs/zh/reference/changelog.md b/docs/zh/reference/changelog.md
index 2269072c..5a70cc5c 100644
--- a/docs/zh/reference/changelog.md
+++ b/docs/zh/reference/changelog.md
@@ -4,6 +4,8 @@
## 未发布
+- Python 最低版本提升至 3.11,支持范围为 `>=3.11,<3.15`。从下一正式版本开始,请先停止旧环境中的 MinerU 服务,再使用 Python 3.11–3.14 新建虚拟环境、重新安装依赖,并更新服务启动配置中的解释器路径;建议新环境使用 Python 3.12。升级后通过 `mineru version --json` 核对实际版本。
+
- 图片命名变更:CLI/API ZIP 的新物化图片统一采用 Gradio 的视觉父块命名,表内图按所有 img src 顺序编号,冲突追加 `_duplicate_n`。引用同步更新,图片字节及 MiddleJson 2.0 不变;历史 ZIP 仍按已有引用读取。需要 `docvortex>=0.4.19,<1`。
- 破坏性变更:移除 `mineru-kit parse` 的 `--backend` 参数(该参数在 4.0 alpha 阶段引入)。它仅用于推断 tier,没有独立作用,请改用 `--tier`:`pipeline` → `--tier basic`;`vlm-engine`、`vlm-auto-engine`、`vlm-http-client` → `--tier advanced`;`hybrid-engine`、`hybrid-auto-engine` → `--tier standard`(或省略该参数);`flash` → `--tier flash`。使用远程 VLM 服务由 VLM 服务配置表达,与该参数无关。
diff --git a/docs/zh/reference/migration_4.md b/docs/zh/reference/migration_4.md
index 99cf406e..02e1c27b 100644
--- a/docs/zh/reference/migration_4.md
+++ b/docs/zh/reference/migration_4.md
@@ -13,7 +13,7 @@
| 旧 API 调用 | V1 上传 → 解析任务 → 文件产物 |
| `mineru[core]`、`mineru[pipeline]` 等 extras | 基础包、`mineru[torch]` 或 `mineru[full]` |
-正式版安装使用 `"mineru>=4.0,<5"`(需要 extras 时加在包名后)。Python 包要求 `>=3.10,<3.15`;可选引擎按实际 wheel 和驱动选择版本。升级前停止原环境中的服务,升级后检查 `mineru version --json`。不要把旧平台的镜像和安装命令替换成主线 4.0。
+正式版安装使用 `"mineru>=4.0,<5"`(需要 extras 时加在包名后)。Python 包要求 `>=3.11,<3.15`;可选引擎按实际 wheel 和驱动选择版本。升级前停止原环境中的服务,升级后检查 `mineru version --json`。不要把旧平台的镜像和安装命令替换成主线 4.0。
## 档位、页码与输出
diff --git a/mineru/doclib/rows.py b/mineru/doclib/rows.py
index eb869092..6d418d13 100644
--- a/mineru/doclib/rows.py
+++ b/mineru/doclib/rows.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-# Python 3.10 的 typing 尚未提供 NotRequired,统一使用兼容实现。
+# 保留 typing_extensions 的 TypedDict,兼容 Python 3.11 下的运行时类型校验。
from typing_extensions import NotRequired, TypedDict
from ..types import Tier
diff --git a/mineru/doclib/telemetry/payload.py b/mineru/doclib/telemetry/payload.py
index 71bf0666..421301b9 100644
--- a/mineru/doclib/telemetry/payload.py
+++ b/mineru/doclib/telemetry/payload.py
@@ -26,7 +26,7 @@ def dimensions_hash(dimensions: dict[str, str]) -> str:
def utc_iso_from_ms(value_ms: int) -> str:
- """使用 Python 3.10 支持的 UTC 时区,保留毫秒精度和 Z 后缀。"""
+ """使用 UTC 时区,保留毫秒精度和 Z 后缀。"""
return datetime.fromtimestamp(value_ms / 1000, tz=timezone.utc).isoformat(timespec="milliseconds").replace("+00:00", "Z")
diff --git a/mineru/model/runtime/intel_gpu.py b/mineru/model/runtime/intel_gpu.py
index bf724c78..ae49b6da 100644
--- a/mineru/model/runtime/intel_gpu.py
+++ b/mineru/model/runtime/intel_gpu.py
@@ -1,3 +1,4 @@
+# Copyright (c) Opendatalab. All rights reserved.
"""Explicit PCI architecture families for the Linux WebGPU product policy."""
from typing import Literal
diff --git a/mineru/model/runtime/onnx_calibration.py b/mineru/model/runtime/onnx_calibration.py
index 385312dc..66e863bb 100644
--- a/mineru/model/runtime/onnx_calibration.py
+++ b/mineru/model/runtime/onnx_calibration.py
@@ -1,3 +1,4 @@
+# Copyright (c) Opendatalab. All rights reserved.
"""Bounded rec calibration worker, shared by automatic selection and the release benchmark."""
from __future__ import annotations
diff --git a/mineru/model/runtime/onnx_rec.py b/mineru/model/runtime/onnx_rec.py
index b28fdc98..26156d90 100644
--- a/mineru/model/runtime/onnx_rec.py
+++ b/mineru/model/runtime/onnx_rec.py
@@ -1,3 +1,4 @@
+# Copyright (c) Opendatalab. All rights reserved.
"""Content-addressed ONNX CTC output reduction shared by CPU, DML and WebGPU."""
from __future__ import annotations
diff --git a/mineru/model/runtime/webgpu.py b/mineru/model/runtime/webgpu.py
index 6234880c..c968fc5f 100644
--- a/mineru/model/runtime/webgpu.py
+++ b/mineru/model/runtime/webgpu.py
@@ -1,3 +1,4 @@
+# Copyright (c) Opendatalab. All rights reserved.
"""Lazy native WebGPU registration and process-wide session serialization."""
from __future__ import annotations
diff --git a/mineru/model/runtime/windows_gpu.py b/mineru/model/runtime/windows_gpu.py
index 18c6c8a8..2db1b7db 100644
--- a/mineru/model/runtime/windows_gpu.py
+++ b/mineru/model/runtime/windows_gpu.py
@@ -1,3 +1,4 @@
+# Copyright (c) Opendatalab. All rights reserved.
"""Lazy Windows GPU discovery; DXGI indices are never persisted."""
from __future__ import annotations
diff --git a/pyproject.toml b/pyproject.toml
index 12c2dd05..2e37e348 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -93,7 +93,6 @@ test = [
"pytest-cov",
"coverage",
"fuzzywuzzy",
- "tomli; python_version < '3.11'",
]
torch = [
"torch>=2.7.0,<3",
diff --git a/scripts/check_transformers5_dependencies.py b/scripts/check_transformers5_dependencies.py
index 851cde68..37aab414 100644
--- a/scripts/check_transformers5_dependencies.py
+++ b/scripts/check_transformers5_dependencies.py
@@ -116,7 +116,7 @@ def main() -> None:
parser.add_argument("--utils-wheel", type=Path, required=True)
parser.add_argument("--docvortex-wheel", type=Path, required=True)
parser.add_argument("--platform", choices=tuple(PLATFORMS), required=True)
- parser.add_argument("--python", nargs="+", default=["3.10", "3.11", "3.12", "3.13", "3.14"])
+ parser.add_argument("--python", nargs="+", default=["3.11", "3.12", "3.13", "3.14"])
parser.add_argument("--transformers", choices=["5.10.1", "5.14.0", "5.16.1"])
parser.add_argument("--extras", nargs="+", default=["base", "torch", "full", "all"])
parser.add_argument("--utils-matrix", action="store_true")
diff --git a/scripts/sync_issue_template_version.py b/scripts/sync_issue_template_version.py
index fd93b221..50c6b137 100644
--- a/scripts/sync_issue_template_version.py
+++ b/scripts/sync_issue_template_version.py
@@ -1,6 +1,6 @@
# Copyright (c) Opendatalab. All rights reserved.
# /// script
-# requires-python = ">=3.10"
+# requires-python = ">=3.11"
# dependencies = ["packaging", "PyYAML>=6,<7"]
# ///
"""依据已发布 wheel 的元数据更新 issue 表单中的最新正式版本提示。"""
diff --git a/skills/mineru/SKILL.md b/skills/mineru/SKILL.md
index b3d83885..5a884875 100644
--- a/skills/mineru/SKILL.md
+++ b/skills/mineru/SKILL.md
@@ -130,10 +130,12 @@ mineru version --json
If `mineru version --json` fails, try `mineru --version` for older CLIs. If the detected version does not meet this requirement, tell the user which version was found and ask before upgrading it. If approved, upgrade with the same installer and environment, then check the version again. If declined, stop and do not run this skill's commands. Never assume compatibility when the version cannot be determined.
-MinerU requires Python `>=3.10,<3.15`.
+MinerU requires Python `>=3.11,<3.15`.
### Upgrade An Existing Installation
+If the existing environment uses Python older than 3.11, stop MinerU services and recreate the environment with Python 3.11–3.14 using the same environment manager before reinstalling MinerU. Update interpreter paths in service startup configuration and verify the result with `mineru version --json`. Python 3.12 remains the recommended starting point.
+
Before upgrading, determine which tool owns the resolved `mineru` executable. Check `uv tool list`, then `pipx list --short`; otherwise, identify the Python environment containing the executable. Do not use an unrelated `pip` or install a second copy.
Before an in-place upgrade or reinstall, stop the MinerU server. On Windows, confirm that status reports `running=false` before modifying the environment:
@@ -166,7 +168,6 @@ uv python find 3.12
uv python find 3.13
uv python find 3.14
uv python find 3.11
-uv python find 3.10
```
If all `uv python find` commands failed, download Python 3.12 with `uv`:
@@ -192,13 +193,13 @@ PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)"
"$PIPX_DEFAULT_PYTHON" --version
```
-Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.15`, install with `pipx`:
+Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.11,<3.15`, install with `pipx`:
```bash
pipx install "mineru>=4.0,<5"
```
-If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.15`.
+If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.11,<3.15`.
```bash
command -v python3.12
@@ -217,11 +218,11 @@ pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"
If neither `uv` nor `pipx` is available, but `pip` or `pip3` is available, check the Python version of the `pip` command, and ask the user before installing into the global python environment:
```bash
-which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
+which -a pip pip3 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
pip --version
```
-If a `pip` command reports Python `>=3.10,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
+If a `pip` command reports Python `>=3.11,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:
```bash
pip install "mineru>=4.0,<5"
@@ -229,7 +230,7 @@ pip install "mineru>=4.0,<5"
### If No Supported Installer Is Available
-If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.15`, recommend that the user install `uv` first.
+If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.11,<3.15`, recommend that the user install `uv` first.
### After Installation
diff --git a/tests/unittest/test_doclib_app_startup.py b/tests/unittest/test_doclib_app_startup.py
index c4f6ff2e..22511d31 100644
--- a/tests/unittest/test_doclib_app_startup.py
+++ b/tests/unittest/test_doclib_app_startup.py
@@ -1,11 +1,7 @@
import asyncio
import logging
import subprocess
-
-try:
- import tomllib
-except ModuleNotFoundError:
- import tomli as tomllib
+import tomllib
import uuid
from logging.handlers import RotatingFileHandler
from pathlib import Path
diff --git a/tests/unittest/test_model_backend_selection.py b/tests/unittest/test_model_backend_selection.py
index 965a7890..ca20eacf 100644
--- a/tests/unittest/test_model_backend_selection.py
+++ b/tests/unittest/test_model_backend_selection.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import tomllib
from pathlib import Path
from unittest.mock import Mock
@@ -19,11 +20,6 @@ from mineru.model.vlm import selector
from mineru.parser import tier as parser_tier
from scripts.check_transformers5_dependencies import check_backend_dependencies
-try:
- import tomllib
-except ModuleNotFoundError:
- import tomli as tomllib
-
@pytest.mark.parametrize(
("platform", "accelerator", "packages", "small", "vlm"),
diff --git a/tests/unittest/test_opencv_boundaries.py b/tests/unittest/test_opencv_boundaries.py
index 98c2dd43..be348274 100644
--- a/tests/unittest/test_opencv_boundaries.py
+++ b/tests/unittest/test_opencv_boundaries.py
@@ -315,10 +315,7 @@ def test_seal_rejects_removed_mode(mode: str) -> None:
def test_base_dependencies_exclude_opencv_and_keep_product_extras() -> None:
"""基础声明移除 OpenCV,ONNX、llama.cpp、Torch/full 和苹果自动 extra 保持原样。"""
- try:
- import tomllib
- except ModuleNotFoundError:
- import tomli as tomllib
+ import tomllib
from packaging.requirements import Requirement
project = tomllib.loads((_ROOT / "pyproject.toml").read_text())["project"]
diff --git a/tests/unittest/test_parser_api_contract.py b/tests/unittest/test_parser_api_contract.py
index fb290c4e..92390a8b 100644
--- a/tests/unittest/test_parser_api_contract.py
+++ b/tests/unittest/test_parser_api_contract.py
@@ -396,10 +396,7 @@ def test_standard_dependency_error_recommends_backend_extra(monkeypatch: pytest.
"""各后端缺依赖时保留模块名称,并且只推荐项目中真实存在的安装 extra。"""
import re
- try:
- import tomllib
- except ModuleNotFoundError:
- import tomli as tomllib
+ import tomllib
monkeypatch.setattr(parser_tier, "installed_distribution_name", lambda: "mineru")