pyproject.toml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. [build-system]
  2. requires = ["setuptools>=61.0", "wheel"]
  3. build-backend = "setuptools.build_meta"
  4. [project]
  5. name = "mineru"
  6. dynamic = ["version"]
  7. license = { text = "AGPL-3.0" }
  8. description = "A practical tool for converting PDF to Markdown"
  9. readme = "README.md"
  10. requires-python = ">=3.10,<3.14"
  11. keywords = ["magic-pdf", "mineru", "MinerU", "convert", "pdf", "markdown"]
  12. classifiers = [
  13. "Programming Language :: Python :: 3.10",
  14. "Programming Language :: Python :: 3.11",
  15. "Programming Language :: Python :: 3.12",
  16. "Programming Language :: Python :: 3.13",
  17. ]
  18. dependencies = [
  19. "boto3>=1.28.43",
  20. "click>=8.1.7",
  21. "loguru>=0.7.2",
  22. "numpy>=1.21.6",
  23. "pdfminer.six==20250506",
  24. "tqdm>=4.67.1",
  25. "requests",
  26. "httpx",
  27. "pillow>=11.0.0",
  28. "pypdfium2>=4.30.0",
  29. "pypdf>=5.6.0",
  30. "reportlab",
  31. "pdftext>=0.6.2",
  32. "modelscope>=1.26.0",
  33. "huggingface-hub>=0.32.4",
  34. "json-repair>=0.46.2",
  35. "opencv-python>=4.11.0.86",
  36. "fast-langdetect>=0.2.3,<0.3.0",
  37. "scikit-image>=0.25.0,<1.0.0",
  38. "openai>=1.70.0,<2",
  39. "beautifulsoup4>=4.13.5,<5",
  40. "magika>=0.6.2,<0.7.0",
  41. "mineru-vl-utils>=0.1.7,<1",
  42. ]
  43. [project.optional-dependencies]
  44. test = [
  45. "mineru[core]",
  46. "pytest",
  47. "pytest-cov",
  48. "coverage",
  49. "fuzzywuzzy"
  50. ]
  51. vlm = [
  52. "torch>=2.6.0,<2.8.0",
  53. "transformers>=4.51.1,<5.0.0",
  54. "accelerate>=1.5.1",
  55. ]
  56. vllm = [
  57. "vllm==0.10.1.1",
  58. ]
  59. pipeline = [
  60. "matplotlib>=3.10,<4",
  61. "ultralytics>=8.3.48,<9",
  62. "doclayout_yolo==0.0.4",
  63. "dill>=0.3.8,<1",
  64. "PyYAML>=6.0.2,<7",
  65. "ftfy>=6.3.1,<7",
  66. "shapely>=2.0.7,<3",
  67. "pyclipper>=1.3.0,<2",
  68. "omegaconf>=2.3.0,<3",
  69. "torch>=2.6.0,<2.8.0",
  70. "torchvision",
  71. "transformers>=4.49.0,!=4.51.0,<5.0.0",
  72. "onnxruntime>1.17.0",
  73. ]
  74. api = [
  75. "fastapi",
  76. "python-multipart",
  77. "uvicorn",
  78. ]
  79. gradio = [
  80. "gradio>=5.34,<6",
  81. "gradio-pdf>=0.0.22",
  82. ]
  83. core = [
  84. "mineru[vlm]",
  85. "mineru[pipeline]",
  86. "mineru[api]",
  87. "mineru[gradio]",
  88. ]
  89. all = [
  90. "mineru[core]",
  91. "mineru[vllm]",
  92. ]
  93. [project.urls]
  94. homepage = "https://mineru.net/"
  95. documentation = "https://opendatalab.github.io/MinerU/"
  96. repository = "https://github.com/opendatalab/MinerU"
  97. issues = "https://github.com/opendatalab/MinerU/issues"
  98. [project.scripts]
  99. mineru = "mineru.cli:client.main"
  100. mineru-vllm-server = "mineru.cli.vlm_vllm_server:main"
  101. mineru-models-download = "mineru.cli.models_download:download_models"
  102. mineru-api = "mineru.cli.fast_api:main"
  103. mineru-gradio = "mineru.cli.gradio_app:main"
  104. [tool.setuptools.dynamic]
  105. version = { attr = "mineru.version.__version__" }
  106. [tool.setuptools.packages.find]
  107. include = ["mineru*"]
  108. namespaces = false
  109. [tool.setuptools.package-data]
  110. "mineru" = ["resources/**"]
  111. "mineru.model.ocr.paddleocr2pytorch.pytorchocr.utils" = ["resources/**"]
  112. [tool.setuptools]
  113. include-package-data = true
  114. zip-safe = false
  115. [tool.pytest.ini_options]
  116. addopts = "-s --cov=mineru --cov-report html"
  117. [tool.coverage.run]
  118. command_line = "-m pytest tests/unittest/test_e2e.py"
  119. source = ["mineru/"]
  120. omit = [
  121. "*/gradio_app.py",
  122. "*/models_download.py",
  123. "*/fast_api.py",
  124. "*/cli/client.py",
  125. "*/vlm_vllm_server.py",
  126. "*/cli_parser.py",
  127. ]
  128. [tool.coverage.html]
  129. directory = "htmlcov"
  130. [tool.coverage.report]
  131. exclude_also = [
  132. 'def __repr__',
  133. 'if self.debug:',
  134. 'if settings.DEBUG',
  135. 'raise AssertionError',
  136. 'raise NotImplementedError',
  137. 'if 0:',
  138. 'if __name__ == .__main__.:',
  139. 'if TYPE_CHECKING:',
  140. 'class .*\bProtocol\):',
  141. '@(abc\.)?abstractmethod',
  142. ]