Files
MinerU/pyproject.toml

197 lines
5.3 KiB
TOML
Raw Permalink 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.
[build-system]
requires = ["setuptools>=77.0.3", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mineru"
dynamic = ["version"]
license = "LicenseRef-MinerU-Open-Source-License"
license-files = ["LICENSE.md"]
description = "A practical document parsing tool for converting PDF, OFD, EPUB, HTML, images, CSV, RTF, OOXML, and OpenDocument files into Markdown and JSON"
readme = "README.md"
requires-python = ">=3.11,<3.15"
keywords = [
"mineru",
"magic-pdf",
"document-parsing",
"document-understanding",
"pdf",
"markdown",
"ocr",
"vlm",
"docx",
"pptx",
"xlsx",
"epub",
"ofd",
"csv",
"rtf",
"odt",
"ods",
"odp",
"multimodal",
]
classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"docvortex>=0.6.0,<0.7",
"gradio>=6.21,<7",
"mineru[torch] ; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mineru-vl-utils>=2.0.7,<3",
"mineru-llama-cpp>=0.1.3,<1",
"click>=8.1.7",
"loguru>=0.7.2",
"numpy>=1.21.6",
"tqdm>=4.67.1",
"requests",
"httpx",
"pillow>=11.0.0",
"pypdfium2>=5.13.0,<6",
"PyYAML>=6.0.1,<7",
"packaging",
"modelscope>=1.26.0",
"huggingface-hub[hf_xet]>=0.32.4",
"filelock>=3.0.0",
"json-repair>=0.46.2",
"openai>=1.70.0,<3",
"beautifulsoup4>=4.13.5,<5",
"tinycss2>=1.5.1,<2",
"aiosqlite>=0.20.0,<1",
"watchfiles>=1.0.0,<2",
"fastapi",
"fastapi-offline>=1.7.7,<2",
"python-multipart",
"uvicorn",
"pydantic>=2.12.5,<3",
"typing_extensions>=4.0.0",
"typer>=0.9.0",
"rich>=13.0.0",
"jieba>=0.42.1",
"onnx>=1.19,<2",
"onnxruntime-directml>=1.23,<2 ; sys_platform == 'win32' and (platform_machine == 'AMD64' or platform_machine == 'amd64' or platform_machine == 'x86_64')",
"onnxruntime>=1.24.4,<2 ; sys_platform != 'win32' or (platform_machine != 'AMD64' and platform_machine != 'amd64' and platform_machine != 'x86_64')",
"onnxruntime-ep-webgpu>=0.4.0,<1 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
"ftfy>=6.3.1,<7",
"shapely>=2.0.7,<3",
"pyclipper>=1.3.0,<2",
"tokenizers>=0.22.0,<0.24",
]
[project.optional-dependencies]
dev = [
"lxml-stubs",
]
test = [
"pypdf>=5.6.0",
"reportlab",
"lxml>=4.0.0,<7.0.0",
"pytest",
"pytest-cov",
"coverage",
"fuzzywuzzy",
]
torch = [
"torch>=2.7.0,<3",
"torchvision",
"transformers>=5.10.1,<6",
"accelerate>=1.5.1",
"safetensors>=0.4.0,<1",
]
full = [
"mineru[torch]",
"vllm>=0.19.1,<0.29.0 ; sys_platform == 'linux'",
"lmdeploy>=0.17.0,<0.18 ; sys_platform == 'win32'",
"qwen-vl-utils>=0.0.14,<1 ; sys_platform == 'win32'",
]
all = [
"mineru[full]",
]
[project.urls]
homepage = "https://mineru.net/"
documentation = "https://opendatalab.github.io/MinerU/"
repository = "https://github.com/opendatalab/MinerU"
issues = "https://github.com/opendatalab/MinerU/issues"
License = "https://github.com/opendatalab/MinerU/blob/master/LICENSE.md"
[project.scripts]
mineru = "mineru.cli.main:main"
mineru-kit = "mineru.kit.main:main"
mineru-router = "mineru.kit.router.cli:main"
mineru-webui = "mineru.kit.commands.webui:main"
mineru-openai-server = "mineru.kit.commands.vlm_server:main"
mineru-models-download = "mineru.kit.commands.models:download_main"
mineru-api = "mineru.kit.commands.api_server:main"
[tool.setuptools.dynamic]
version = { attr = "mineru.version.__version__" }
[tool.setuptools.packages.find]
include = ["mineru*"]
namespaces = false
[tool.setuptools.package-data]
"mineru" = ["resources/**"]
"mineru.kit.gradio._vendor.ofd2html" = ["LICENSE", "UPSTREAM.md"]
"mineru.doclib.migrations" = ["*.sql"]
"mineru.model._internal.pytorchocr.utils" = ["resources/**"]
"mineru.model.ocr" = ["data/*.txt"]
[tool.setuptools]
include-package-data = true
zip-safe = false
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-s --cov=mineru --cov-report html"
markers = [
"torch: 需要可选 Torch/Transformers 依赖,由独立 CPU 测试任务执行",
"accelerator: 需要实际 GPU/NPU 设备,不属于 CPU CI 回归",
"e2e: MinerU CLI 端到端用例(脚本化 docs/next/cli/mineru-e2e-test-cases.md)",
"smoke: 快速回归子集(无需本地 quality tier)",
"slow: 单用例预计超过 60s",
"remote: 依赖 mineru.net 云端 parse-server(默认套件包含)",
"full_stack: 需要 Torch 小模型与本地 VLM 模型集",
"isolated_home: 使用独立 MINERU_HOME",
"lifecycle: 会 stop/start/restart doclib server",
]
[tool.coverage.run]
command_line = "-m pytest tests/unittest"
source = ["mineru/"]
omit = [
"*/gradio_app.py",
"*/fast_api.py",
"*/cli/client.py",
"*/vlm_vllm_server.py",
"*/cli_parser.py",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.report]
exclude_also = [
'def __repr__',
'if self.debug:',
'if settings.DEBUG',
'raise AssertionError',
'raise NotImplementedError',
'if 0:',
'if __name__ == .__main__.:',
'if TYPE_CHECKING:',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]
[tool.ruff]
line-length = 128
[tool.ruff.lint]
select = ["C", "E", "F", "W", "ANN"]
ignore = ["C901", "ANN204", "ANN401"]