forked from deepset-ai/haystack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
355 lines (326 loc) · 8.33 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
[build-system]
requires = [
"hatchling>=1.8.0",
]
build-backend = "hatchling.build"
[project]
name = "farm-haystack"
dynamic = [
"version",
]
description = "Neural Question Answering & Semantic Search at Scale. Use modern transformer based models like BERT to find answers in large document collections"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.8"
authors = [
{ name = "deepset.ai", email = "[email protected]" },
]
keywords = [
"BERT",
"QA",
"Question-Answering",
"Reader",
"Retriever",
"albert",
"language-model",
"mrc",
"roberta",
"search",
"semantic-search",
"squad",
"transfer-learning",
"transformer",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: Freely Distributable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"requests",
"pydantic",
"transformers==4.30.1",
"pandas",
"rank_bm25",
"scikit-learn>=1.0.0", # TF-IDF, SklearnQueryClassifier and metrics
"lazy-imports==0.3.1", # Optional imports
"prompthub-py==4.0.0",
"platformdirs",
# Utils
"tqdm", # progress bars in model download and training scripts
"networkx", # graphs library
"quantulum3", # quantities extraction from text
"posthog", # telemetry
# audio's espnet-model-zoo requires huggingface-hub version <0.8 while we need >=0.5 to be able to use create_repo in FARMReader
"tenacity", # retry decorator
"sseclient-py", # server side events for OpenAI streaming
"more_itertools", # utilities
# Web Retriever
"boilerpy3",
# Multimodal Embedder haystack/nodes/retriever/multimodal/embedder.py
"Pillow",
# OpenAI tokenizer
"tiktoken>=0.3.2",
# Schema validation
"jsonschema",
# Preview
"canals==0.2.2",
# Agent events
"events",
"requests-cache<1.0.0",
]
[project.optional-dependencies]
inference = [
"transformers[torch,sentencepiece]==4.30.1",
"sentence-transformers>=2.2.0", # See haystack/nodes/retriever/_embedding_encoder.py, _SentenceTransformersEmbeddingEncoder
"huggingface-hub>=0.5.0",
]
elasticsearch = [
"elasticsearch>=7.17,<8",
]
sql = [
"sqlalchemy>=1.4.2,<2",
"sqlalchemy_utils",
"psycopg2-binary; platform_system != 'Windows'",
]
only-faiss = [
"faiss-cpu>=1.6.3,<=1.7.2",
]
faiss = [
"farm-haystack[sql,only-faiss]",
]
only-faiss-gpu = [
"faiss-gpu>=1.6.3,<2",
]
faiss-gpu = [
"farm-haystack[sql,only-faiss-gpu]",
]
weaviate = [
"weaviate-client<3.19.0",
]
only-pinecone = [
"pinecone-client>=2.0.11,<3",
]
pinecone = [
"farm-haystack[sql,only-pinecone]",
]
opensearch = [
"opensearch-py>=2",
]
docstores = [
"farm-haystack[elasticsearch,faiss,weaviate,pinecone,opensearch]",
]
docstores-gpu = [
"farm-haystack[elasticsearch,faiss-gpu,weaviate,pinecone,opensearch]",
]
audio = [
"openai-whisper"
]
beir = [
"beir; platform_system != 'Windows'",
]
aws = [
"boto3"
]
crawler = [
"selenium>=4.0.0,!=4.1.4", # Avoid 4.1.4 due to https://github.com/SeleniumHQ/selenium/issues/10612
"webdriver-manager",
]
preprocessing = [
"nltk",
"langdetect", # for language classification
]
file-conversion = [
"azure-ai-formrecognizer>=3.2.0b2", # Microsoft Azure's Form Recognizer service (text and table exctrator)
"python-docx",
"tika", # Apache Tika (text & metadata extractor)
"beautifulsoup4",
"markdown",
"python-frontmatter",
"python-magic; platform_system != 'Windows'", # Depends on libmagic: https://pypi.org/project/python-magic/
"python-magic-bin; platform_system == 'Windows'", # Needs to be installed without python-magic, otherwise Windows CI gets stuck.
]
pdf = [
"PyMuPDF>=1.18.16" , # PDF text extraction alternative to xpdf; please check AGPLv3 license
]
ocr = [
"pytesseract>0.3.7",
"pdf2image>1.14",
]
onnx = [
"onnxruntime",
"onnxruntime_tools",
]
onnx-gpu = [
"onnxruntime-gpu",
"onnxruntime_tools",
]
metrics = [ # for metrics
"scipy>=1.3.2",
"rapidfuzz>=2.0.15,<2.8.0", # FIXME https://github.com/deepset-ai/haystack/pull/3199
"seqeval",
"mlflow<2.4.0",
]
ray = [
"ray[serve]>=1.9.1,<2; platform_system != 'Windows'",
"ray[serve]>=1.9.1,<2,!=1.12.0; platform_system == 'Windows'", # Avoid 1.12.0 due to https://github.com/ray-project/ray/issues/24169 (fails on windows)
"aiorwlock>=1.3.0,<2",
]
colab = [
"pillow<=9.0.0",
]
dev = [
"pre-commit",
# Type check
"mypy",
# Test
"pytest",
"pytest-cov",
"pytest-custom_exit_code", # used in the CI
"pytest-asyncio",
"responses",
"tox",
"coverage",
"python-multipart",
"psutil",
# Linting
"pylint",
"farm-haystack[formatting]",
# Documentation
"pydoc-markdown",
"mkdocs",
"jupytercontrib",
"watchdog",
"toml",
]
formatting = [
# Version specified following Black stability policy:
# https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy
"black[jupyter]~=23.0",
]
all = [
"farm-haystack[inference,docstores,audio,crawler,preprocessing,file-conversion,pdf,ocr,ray,onnx,beir,metrics,aws]",
]
all-gpu = [
# beir is incompatible with faiss-gpu: https://github.com/beir-cellar/beir/issues/71
"farm-haystack[inference,docstores-gpu,audio,crawler,preprocessing,file-conversion,pdf,ocr,ray,onnx-gpu,metrics,aws]",
]
[project.scripts]
haystack = "haystack.cli.entry_point:main"
[project.urls]
"CI: GitHub" = "https://github.com/deepset-ai/haystack/actions"
"Docs: RTD" = "https://haystack.deepset.ai/overview/intro"
"GitHub: issues" = "https://github.com/deepset-ai/haystack/issues"
"GitHub: repo" = "https://github.com/deepset-ai/haystack"
Homepage = "https://github.com/deepset-ai/haystack"
[tool.hatch.version]
path = "VERSION.txt"
pattern = "(?P<version>.+)"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.sdist]
include = [
"/haystack",
"/VERSION.txt",
]
[tool.hatch.build.targets.wheel]
packages = [
"haystack",
]
[tool.black]
line-length = 120
skip_magic_trailing_comma = true # For compatibility with pydoc>=4.6, check if still needed.
[tool.pylint.'MESSAGES CONTROL']
max-line-length=120
load-plugins = "haystack_linter"
disable = [
# To keep
"fixme",
"c-extension-no-member",
# To review:
"missing-docstring",
"unused-argument",
"no-member",
"line-too-long",
"protected-access",
"too-few-public-methods",
"raise-missing-from",
"invalid-name",
"too-many-locals",
"duplicate-code",
"too-many-arguments",
"arguments-differ",
"consider-using-f-string",
"no-else-return",
"attribute-defined-outside-init",
"too-many-instance-attributes",
"super-with-arguments",
"redefined-builtin",
"abstract-method",
"too-many-branches",
"unspecified-encoding",
"unidiomatic-typecheck",
"no-name-in-module",
"consider-using-with",
"redefined-outer-name",
"arguments-renamed",
"unnecessary-pass",
"broad-except",
"unnecessary-comprehension",
"subprocess-run-check",
"singleton-comparison",
"consider-iterating-dictionary",
"too-many-nested-blocks",
"undefined-loop-variable",
"too-many-statements",
"consider-using-in",
"bare-except",
"too-many-lines",
"unexpected-keyword-arg",
"simplifiable-if-expression",
"use-list-literal",
"broad-exception-raised",
# To review later
"cyclic-import",
"import-outside-toplevel",
"deprecated-method",
]
[tool.pylint.'DESIGN']
max-args=7
[tool.pylint.'SIMILARITIES']
min-similarity-lines=6
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--strict-markers"
markers = [
"unit: unit tests",
"integration: integration tests",
"generator: generator tests",
"summarizer: summarizer tests",
"embedding_dim: uses a document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128))",
"tika: requires Tika container",
"parsr: requires Parsr container",
"ocr: requires Tesseract",
"elasticsearch: requires Elasticsearch container",
"weaviate: requires Weaviate container",
"pinecone: requires Pinecone credentials",
"faiss: uses FAISS",
"opensearch",
"document_store",
]
log_cli = true
[tool.mypy]
warn_return_any = false
warn_unused_configs = true
ignore_missing_imports = true
plugins = [
"pydantic.mypy",
]