pyproject.toml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. ]
  39. [project.optional-dependencies]
  40. test = [
  41. "mineru[core]",
  42. "pytest",
  43. "pytest-cov",
  44. "coverage",
  45. "beautifulsoup4",
  46. "fuzzywuzzy"
  47. ]
  48. vlm = [
  49. "transformers>=4.51.1",
  50. "torch>=2.6.0",
  51. "accelerate>=1.5.1",
  52. "pydantic",
  53. ]
  54. sglang = [
  55. "sglang[all]>=0.4.7,<0.4.10",
  56. ]
  57. pipeline = [
  58. "matplotlib>=3.10,<4",
  59. "ultralytics>=8.3.48,<9",
  60. "doclayout_yolo==0.0.4",
  61. "dill>=0.3.8,<1",
  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.6.0,<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. [project.urls]
  92. homepage = "https://mineru.net/"
  93. documentation = "https://opendatalab.github.io/MinerU/"
  94. repository = "https://github.com/opendatalab/MinerU"
  95. issues = "https://github.com/opendatalab/MinerU/issues"
  96. [project.scripts]
  97. mineru = "mineru.cli:client.main"
  98. mineru-sglang-server = "mineru.cli.vlm_sglang_server:main"
  99. mineru-models-download = "mineru.cli.models_download:download_models"
  100. mineru-api = "mineru.cli.fast_api:main"
  101. mineru-gradio = "mineru.cli.gradio_app:main"
  102. [tool.setuptools.dynamic]
  103. version = { attr = "mineru.version.__version__" }
  104. [tool.setuptools.packages.find]
  105. include = ["mineru*"]
  106. namespaces = false
  107. [tool.setuptools.package-data]
  108. "mineru" = ["resources/**"]
  109. "mineru.model.ocr.paddleocr2pytorch.pytorchocr.utils" = ["resources/**"]
  110. [tool.setuptools]
  111. include-package-data = true
  112. zip-safe = false
  113. [tool.pytest.ini_options]
  114. addopts = "-s --cov=mineru --cov-report html"
  115. [tool.coverage.run]
  116. command_line = "-m pytest tests/unittest/test_e2e.py"
  117. source = ["mineru/"]
  118. omit = [
  119. "*/vlm_sglang_model/*",
  120. "*/gradio_app.py",
  121. "*/models_download.py",
  122. "*/fast_api.py",
  123. "*/cli/client.py",
  124. "*/sglang_engine_predictor.py",
  125. "*/vlm_sglang_server.py",
  126. "*/cli_parser.py",
  127. "*/run_async.py"
  128. ]
  129. [tool.coverage.html]
  130. directory = "htmlcov"
  131. [tool.coverage.report]
  132. exclude_also = [
  133. 'def __repr__',
  134. 'if self.debug:',
  135. 'if settings.DEBUG',
  136. 'raise AssertionError',
  137. 'raise NotImplementedError',
  138. 'if 0:',
  139. 'if __name__ == .__main__.:',
  140. 'if TYPE_CHECKING:',
  141. 'class .*\bProtocol\):',
  142. '@(abc\.)?abstractmethod',
  143. ]