-
Notifications
You must be signed in to change notification settings - Fork 443
/
pyproject.toml
217 lines (202 loc) · 5.61 KB
/
pyproject.toml
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "python-doctr"
description = "Document Text Recognition (docTR): deep Learning for high-performance OCR on documents."
authors = [{name = "Mindee", email = "[email protected]"}]
maintainers = [
{name = "François-Guillaume Fernandez"},
{name = "Charles Gaillard"},
{name = "Olivier Dulcy"},
{name = "Felix Dittrich"},
]
readme = "README.md"
requires-python = ">=3.10.0,<4"
license = {file = "LICENSE"}
keywords=["OCR", "deep learning", "computer vision", "tensorflow", "pytorch", "text detection", "text recognition"]
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dynamic = ["version"]
dependencies = [
# For proper typing, mypy needs numpy>=1.20.0 (cf. https://github.com/numpy/numpy/pull/16515)
# Additional typing support is brought by numpy>=1.22.4, but core build sticks to >=1.16.0
"numpy>=1.16.0,<3.0.0",
"scipy>=1.4.0,<2.0.0",
"h5py>=3.1.0,<4.0.0",
"opencv-python>=4.5.0,<5.0.0",
"pypdfium2>=4.11.0,<5.0.0",
"pyclipper>=1.2.0,<2.0.0",
"shapely>=1.6.0,<3.0.0",
"langdetect>=1.0.9,<2.0.0",
"rapidfuzz>=3.0.0,<4.0.0",
"huggingface-hub>=0.20.0,<1.0.0",
"Pillow>=9.2.0",
"defusedxml>=0.7.0",
"anyascii>=0.3.2",
"tqdm>=4.30.0",
]
[project.optional-dependencies]
tf = [
# cf. https://github.com/mindee/doctr/pull/1461
"tensorflow>=2.15.0,<3.0.0",
"tf-keras>=2.15.0,<3.0.0", # Keep keras 2 compatibility
"tf2onnx>=1.16.0,<2.0.0", # cf. https://github.com/onnx/tensorflow-onnx/releases/tag/v1.16.0
]
torch = [
"torch>=2.0.0,<3.0.0",
"torchvision>=0.15.0",
"onnx>=1.12.0,<3.0.0",
]
html = [
"weasyprint>=55.0",
]
viz = [
"matplotlib>=3.1.0",
"mplcursors>=0.3",
]
contrib = [
"onnxruntime>=1.11.0",
]
testing = [
"pytest>=5.3.2",
"coverage[toml]>=4.5.4",
"onnxruntime>=1.11.0",
"requests>=2.20.0",
"psutil>=5.9.5"
]
quality = [
"ruff>=0.1.5",
"mypy>=0.812",
"pre-commit>=2.17.0",
]
docs = [
"sphinx>=3.0.0,!=3.5.0",
"sphinxemoji>=0.1.8",
"sphinx-copybutton>=0.3.1",
"docutils<0.22",
"recommonmark>=0.7.1",
"sphinx-markdown-tables>=0.0.15",
"sphinx-tabs>=3.3.0",
"furo>=2022.3.4",
]
dev = [
# Tensorflow
# cf. https://github.com/mindee/doctr/pull/1461
"tensorflow>=2.15.0,<3.0.0",
"tf-keras>=2.15.0,<3.0.0", # Keep keras 2 compatibility
"tf2onnx>=1.16.0,<2.0.0", # cf. https://github.com/onnx/tensorflow-onnx/releases/tag/v1.16.0
# PyTorch
"torch>=2.0.0,<3.0.0",
"torchvision>=0.15.0",
"onnx>=1.12.0,<3.0.0",
# Extras
"weasyprint>=55.0",
"matplotlib>=3.1.0",
"mplcursors>=0.3",
# Testing
"pytest>=5.3.2",
"coverage[toml]>=4.5.4",
"onnxruntime>=1.11.0",
"requests>=2.20.0",
"psutil>=5.9.5",
# Quality
"ruff>=0.3.0",
"mypy>=1.0",
"pre-commit>=3.0.0",
# Docs
"sphinx>=3.0.0,!=3.5.0",
"sphinxemoji>=0.1.8",
"sphinx-copybutton>=0.3.1",
"docutils<0.22",
"recommonmark>=0.7.1",
"sphinx-markdown-tables>=0.0.15",
"sphinx-tabs>=3.3.0",
"furo>=2022.3.4",
]
[project.urls]
documentation = "https://mindee.github.io/doctr"
repository = "https://github.com/mindee/doctr"
tracker = "https://github.com/mindee/doctr/issues"
changelog = "https://mindee.github.io/doctr/changelog.html"
[tool.setuptools]
zip-safe = true
[tool.setuptools.packages.find]
exclude = ["api*", "demo*", "docs*", "notebooks*", "references*", "scripts*", "tests*"]
[tool.setuptools.package-data]
doctr = ["py.typed"]
[tool.mypy]
files = "doctr/"
show_error_codes = true
pretty = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true
check_untyped_defs = true
implicit_reexport = false
[[tool.mypy.overrides]]
module = [
"anyascii.*",
"tensorflow.*",
"keras.*",
"torchvision.*",
"onnxruntime.*",
"PIL.*",
"tqdm.*",
"scipy.*",
"cv2.*",
"h5py.*",
"matplotlib.*",
"pyclipper.*",
"shapely.*",
"tf2onnx.*",
"mplcursors.*",
"defusedxml.*",
"weasyprint.*",
"huggingface_hub.*",
"pypdfium2.*",
"rapidfuzz.*",
"langdetect.*",
]
ignore_missing_imports = true
[tool.ruff]
exclude = [".git", "venv*", "build", "**/__init__.py"]
line-length = 120
target-version = "py310"
preview=true
[tool.ruff.lint]
select = [
# https://docs.astral.sh/ruff/rules/
"E", "W", "F", "I", "N", "Q", "C4", "T10", "LOG",
"D101", "D103", "D201","D202","D207","D208","D214","D215","D300","D301","D417", "D419", "D207" # pydocstyle
]
ignore = ["E402", "E203", "F403", "E731", "N812", "N817", "C408"]
[tool.ruff.lint.isort]
known-first-party = ["doctr", "app", "utils"]
known-third-party = ["tensorflow", "keras", "torch", "torchvision", "wandb", "tqdm", "fastapi", "onnxruntime", "cv2"]
[tool.ruff.lint.per-file-ignores]
"doctr/models/**.py" = ["N806", "F841"]
"doctr/datasets/**.py" = ["N806"]
"tests/**.py" = ["D"]
"scripts/**.py" = ["D"]
"docs/**.py" = ["D"]
"references/**.py" = ["D"]
"api/**.py" = ["D"]
"demo/**.py" = ["D"]
".github/**.py" = ["D"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.coverage.run]
source = ["doctr"]