File size: 5,351 Bytes
44657b5
 
d78583d
44657b5
 
 
 
 
 
 
 
 
 
 
 
 
 
6237d61
44657b5
 
 
 
 
 
 
 
 
 
 
 
 
 
22bc712
 
84568d7
22bc712
 
 
44657b5
22bc712
84568d7
 
 
 
 
 
 
 
 
 
 
 
22bc712
84568d7
 
 
44657b5
6237d61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44657b5
84568d7
 
 
 
 
 
44657b5
 
 
 
 
 
22bc712
 
 
44657b5
d78583d
44657b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84568d7
 
 
 
 
 
 
44657b5
 
84568d7
 
 
22bc712
 
 
 
 
44657b5
 
22bc712
 
 
 
 
 
 
 
 
 
 
 
d78583d
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
[tool.poetry]
name = "docling-serve"
version = "0.2.0"  # DO NOT EDIT, updated automatically
description = "Running Docling as a service"
license = "MIT"
authors = [
    "Michele Dolfi <[email protected]>",
    "Christoph Auer <[email protected]>",
    "Panos Vagenas <[email protected]>",
    "Cesar Berrospi Ramis <[email protected]>",
   "Peter Staar <[email protected]>",
]
maintainers = [
    "Peter Staar <[email protected]>",
    "Christoph Auer <[email protected]>",
    "Michele Dolfi <[email protected]>",
    "Cesar Berrospi Ramis <[email protected]>",
    "Panos Vagenas <[email protected]>",
]
readme = "README.md"
repository = "https://github.com/DS4SD/docling-serve"
homepage = "https://github.com/DS4SD/docling-serve"
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    # "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Developers",
    "Typing :: Typed",
    "Programming Language :: Python :: 3"
]

[tool.poetry.dependencies]
python = ">=3.10,<3.13" # 3.10 needed for Gradio, and no torchvision build for 3.13 yet
docling = "^2.14.0"
fastapi = {version = "^0.115.6", extras = ["standard"]}
gradio = { version = "^5.9.1", optional = true }
uvicorn = "~0.29.0"
pydantic = "^2.10.3"
pydantic-settings = "^2.4.0"
python-multipart = "^0.0.19"
httpx = "^0.28.1"
tesserocr = { version = "^2.7.1", optional = true }
rapidocr-onnxruntime = { version = "^1.4.0", optional = true, markers = "python_version < '3.13'" }
onnxruntime = [
  # 1.19.2 is the last version with python3.9 support,
  # see https://github.com/microsoft/onnxruntime/releases/tag/v1.20.0
  { version = ">=1.7.0,<1.20.0", optional = true, markers = "python_version < '3.10'" },
  { version = "^1.7.0", optional = true, markers = "python_version >= '3.10'" }
]


[tool.poetry.extras]
ui = ["gradio"]
tesserocr = ["tesserocr"]
rapidocr = ["rapidocr-onnxruntime", "onnxruntime"]


[tool.poetry.group.pypi-torch]
optional = false

[tool.poetry.group.pypi-torch.dependencies]
torch = [
  {version = "!=2.4.1+cpu" },
]
torchvision = [
  {version = "!=0.19.1+cpu" },
]

[tool.poetry.group.cpu]
optional = true

[tool.poetry.group.cpu.dependencies]
torch = [
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.10"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp310-cp310-linux_x86_64.whl"},
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.11"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp311-cp311-linux_x86_64.whl"},
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.12"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp312-cp312-linux_x86_64.whl"},
]
torchvision = [
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.10"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp310-cp310-linux_x86_64.whl"},
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.11"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp311-cp311-linux_x86_64.whl"},
    {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.12"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp312-cp312-linux_x86_64.whl"},
]

[tool.poetry.group.constraints.dependencies]
numpy = [
    { version = "^2.1.0", markers = 'python_version >= "3.13"' },
    { version = "^1.24.4", markers = 'python_version < "3.13"' },
]

[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
isort = "^5.13.2"
pre-commit = "^3.8.0"
autoflake = "^2.3.1"
flake8 = "^7.1.1"
pytest = "^8.3.4"
pytest-asyncio = "^0.24.0"
pytest-check = "^2.4.1"
mypy = "^1.11.2"
python-semantic-release = "^7.32.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
target-version = ["py310"]
include = '\.pyi?$'

[tool.isort]
profile = "black"
line_length = 88
py_version=311

[tool.autoflake]
in-place = true
remove-all-unused-imports = true
remove-unused-variables = true
expand-star-imports = true
recursive = true

[tool.mypy]
pretty = true
# strict = true
no_implicit_optional = true
plugins = "pydantic.mypy"
python_version = "3.10"

[[tool.mypy.overrides]]
module = [
    "easyocr.*",
    "tesserocr.*",
    "rapidocr_onnxruntime.*",
    "docling_conversion.*",
    "gradio_ui.*",
    "response_preparation.*",
    "helper_functions.*",
    "requests.*",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
minversion = "8.2"
testpaths = [
    "tests",
]
addopts = "-rA --color=yes --tb=short --maxfail=5"
markers = [
"asyncio",
]

[tool.semantic_release]
# for default values check:
# https://github.com/python-semantic-release/python-semantic-release/blob/v7.32.2/semantic_release/defaults.cfg

version_source = "tag_only"
branch = "main"

# configure types which should trigger minor and patch version bumps respectively
# (note that they must be a subset of the configured allowed types):
parser_angular_allowed_types = "build,chore,ci,docs,feat,fix,perf,style,refactor,test"
parser_angular_minor_types = "feat"
parser_angular_patch_types = "fix,perf"