pyproject.toml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. ]
  38. [project.optional-dependencies]
  39. test = [
  40. "mineru[core]",
  41. "pytest",
  42. "pytest-cov",
  43. "coverage",
  44. "beautifulsoup4",
  45. "fuzzywuzzy"
  46. ]
  47. vlm = [
  48. "transformers>=4.51.1",
  49. "torch>=2.6.0",
  50. "accelerate>=1.5.1",
  51. "pydantic",
  52. ]
  53. sglang = [
  54. "sglang[all]>=0.4.8,<0.4.9",
  55. ]
  56. pipeline = [
  57. "matplotlib>=3.10,<4",
  58. "ultralytics>=8.3.48,<9",
  59. "doclayout_yolo==0.0.4",
  60. "dill>=0.3.8,<1",
  61. "rapid_table>=1.0.5,<2.0.0",
  62. "PyYAML>=6.0.2,<7",
  63. "ftfy>=6.3.1,<7",
  64. "openai>=1.70.0,<2",
  65. "shapely>=2.0.7,<3",
  66. "pyclipper>=1.3.0,<2",
  67. "omegaconf>=2.3.0,<3",
  68. "torch>=2.2.2,!=2.5.0,!=2.5.1,<3",
  69. "torchvision",
  70. "transformers>=4.49.0,!=4.51.0,<5.0.0",
  71. ]
  72. api = [
  73. "fastapi",
  74. "python-multipart",
  75. "uvicorn",
  76. ]
  77. gradio = [
  78. "gradio>=5.34,<6",
  79. "gradio-pdf>=0.0.22",
  80. ]
  81. core = [
  82. "mineru[vlm]",
  83. "mineru[pipeline]",
  84. "mineru[api]",
  85. "mineru[gradio]",
  86. ]
  87. all = [
  88. "mineru[core]",
  89. "mineru[sglang]",
  90. ]
  91. pipeline_old_linux = [
  92. "matplotlib>=3.10,<=3.10.1",
  93. "ultralytics>=8.3.48,<=8.3.104",
  94. "doclayout_yolo==0.0.4",
  95. "dill==0.3.8",
  96. "PyYAML==6.0.2",
  97. "ftfy==6.3.1",
  98. "openai==1.71.0",
  99. "shapely==2.1.0",
  100. "pyclipper==1.3.0.post6",
  101. "omegaconf==2.3.0",
  102. "albumentations==1.4.20",
  103. "rapid_table==1.0.3",
  104. "torch>=2.2.2,!=2.5.0,!=2.5.1,<3",
  105. "torchvision",
  106. "transformers>=4.49.0,!=4.51.0,<5.0.0",
  107. ]
  108. [project.urls]
  109. homepage = "https://mineru.net/"
  110. documentation = "https://opendatalab.github.io/MinerU/"
  111. repository = "https://github.com/opendatalab/MinerU"
  112. issues = "https://github.com/opendatalab/MinerU/issues"
  113. [project.scripts]
  114. mineru = "mineru.cli:client.main"
  115. mineru-sglang-server = "mineru.cli.vlm_sglang_server:main"
  116. mineru-models-download = "mineru.cli.models_download:download_models"
  117. mineru-api = "mineru.cli.fast_api:main"
  118. mineru-gradio = "mineru.cli.gradio_app:main"
  119. [tool.setuptools.dynamic]
  120. version = { attr = "mineru.version.__version__" }
  121. [tool.setuptools.packages.find]
  122. include = ["mineru*"]
  123. namespaces = false
  124. [tool.setuptools.package-data]
  125. "mineru" = ["resources/**"]
  126. "mineru.model.ocr.paddleocr2pytorch.pytorchocr.utils" = ["resources/**"]
  127. [tool.setuptools]
  128. include-package-data = true
  129. zip-safe = false
  130. [tool.pytest.ini_options]
  131. addopts = "-s --cov=mineru --cov-report html"
  132. [tool.coverage.run]
  133. command_line = "-m pytest tests/unittest/test_e2e.py"
  134. source = ["mineru/"]
  135. omit = [
  136. "*/vlm_sglang_model/*",
  137. "*/gradio_app.py",
  138. "*/models_download.py",
  139. "*/fast_api.py",
  140. "*/cli/client.py",
  141. "*/sglang_engine_predictor.py",
  142. "*/vlm_sglang_server.py",
  143. "*/cli_parser.py",
  144. "*/run_async.py"
  145. ]
  146. [tool.coverage.html]
  147. directory = "htmlcov"
  148. [tool.coverage.report]
  149. exclude_also = [
  150. 'def __repr__',
  151. 'if self.debug:',
  152. 'if settings.DEBUG',
  153. 'raise AssertionError',
  154. 'raise NotImplementedError',
  155. 'if 0:',
  156. 'if __name__ == .__main__.:',
  157. 'if TYPE_CHECKING:',
  158. 'class .*\bProtocol\):',
  159. '@(abc\.)?abstractmethod',
  160. ]