2022-01-26 18:12:55 +01:00
[ build-system ]
requires = [
2022-08-24 03:46:21 -04:00
"hatchling>=1.8.0" ,
2022-01-26 18:12:55 +01:00
]
2022-08-24 03:46:21 -04:00
build-backend = "hatchling.build"
2022-01-26 18:12:55 +01:00
2022-08-24 03:46:21 -04:00
[ project ]
name = "farm-haystack"
dynamic = [
"version" ,
]
2023-08-30 15:29:12 +02:00
description = "LLM framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data."
2022-08-24 03:46:21 -04:00
readme = "README.md"
license = "Apache-2.0"
2023-04-03 10:34:58 +02:00
requires-python = ">=3.8"
2022-08-24 03:46:21 -04:00
authors = [
{ name = "deepset.ai" , email = "malte.pietsch@deepset.ai" } ,
]
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" ,
2023-06-30 19:44:08 +02:00
"pydantic<2" ,
2023-08-29 13:46:00 +02:00
"transformers==4.32.1" ,
2022-08-24 03:46:21 -04:00
"pandas" ,
2022-11-22 09:24:52 +01:00
"rank_bm25" ,
2023-09-13 12:55:33 +02:00
"scikit-learn>=1.3.0" , # TF-IDF and metrics
2023-06-08 12:11:38 +02:00
"lazy-imports==0.3.1" , # Optional imports
2023-06-05 17:03:51 +02:00
"prompthub-py==4.0.0" ,
2023-05-30 16:55:48 +02:00
"platformdirs" ,
2022-08-24 03:46:21 -04:00
# 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
2023-02-17 10:28:36 +01:00
"tenacity" , # retry decorator
2023-03-15 18:24:47 +01:00
"sseclient-py" , # server side events for OpenAI streaming
2023-04-14 11:34:16 +02:00
"more_itertools" , # utilities
2022-08-24 03:46:21 -04:00
2023-03-27 18:14:58 +02:00
# Web Retriever
"boilerpy3" ,
2023-06-23 15:33:20 +02:00
2023-06-20 09:54:10 +02:00
# Multimodal Embedder haystack/nodes/retriever/multimodal/embedder.py
"Pillow" ,
2022-08-24 03:46:21 -04:00
2023-01-24 12:15:49 -03:00
# OpenAI tokenizer
2023-09-13 06:11:21 -07:00
"tiktoken>=0.5.1" ,
2023-01-24 12:15:49 -03:00
2022-08-24 03:46:21 -04:00
# Schema validation
"jsonschema" ,
2023-03-15 18:02:18 +01:00
# Preview
2023-09-04 13:55:05 +01:00
"canals==0.8.0" ,
2023-09-07 09:06:57 +01:00
"openai" ,
2023-09-05 12:22:21 +02:00
"Jinja2" ,
2023-09-06 15:48:45 +01:00
"openai-whisper" , # FIXME https://github.com/deepset-ai/haystack/issues/5731
2023-03-27 10:06:11 +02:00
# Agent events
2023-05-11 10:14:33 +02:00
"events" ,
"requests-cache<1.0.0" ,
2022-08-24 03:46:21 -04:00
]
[ project . optional-dependencies ]
2023-06-20 09:54:10 +02:00
inference = [
2023-08-29 13:46:00 +02:00
"transformers[torch,sentencepiece]==4.32.1" ,
2023-06-20 09:54:10 +02:00
"sentence-transformers>=2.2.0" , # See haystack/nodes/retriever/_embedding_encoder.py, _SentenceTransformersEmbeddingEncoder
"huggingface-hub>=0.5.0" ,
]
2023-04-26 10:14:20 +02:00
elasticsearch = [
2023-07-10 09:59:51 +02:00
"farm-haystack[elasticsearch7]" ,
]
elasticsearch7 = [
2023-04-26 10:14:20 +02:00
"elasticsearch>=7.17,<8" ,
2023-06-29 16:40:10 +02:00
"elastic_transport<8"
2023-04-26 10:14:20 +02:00
]
2023-07-10 09:59:51 +02:00
elasticsearch8 = [
"elasticsearch>=8,<9" ,
"elastic_transport>=8,<9"
]
2022-08-24 03:46:21 -04:00
sql = [
"sqlalchemy>=1.4.2,<2" ,
"sqlalchemy_utils" ,
"psycopg2-binary; platform_system != 'Windows'" ,
]
only-faiss = [
2022-11-18 09:18:24 +01:00
"faiss-cpu>=1.6.3,<=1.7.2" ,
2022-08-24 03:46:21 -04:00
]
faiss = [
"farm-haystack[sql,only-faiss]" ,
]
only-faiss-gpu = [
"faiss-gpu>=1.6.3,<2" ,
]
faiss-gpu = [
"farm-haystack[sql,only-faiss-gpu]" ,
]
weaviate = [
2023-08-02 11:08:50 +02:00
"weaviate-client>2" ,
2022-08-24 03:46:21 -04:00
]
only-pinecone = [
2022-08-24 12:27:15 +01:00
"pinecone-client>=2.0.11,<3" ,
2022-08-24 03:46:21 -04:00
]
pinecone = [
"farm-haystack[sql,only-pinecone]" ,
]
opensearch = [
"opensearch-py>=2" ,
]
docstores = [
2023-05-22 10:03:51 +02:00
"farm-haystack[elasticsearch,faiss,weaviate,pinecone,opensearch]" ,
2022-08-24 03:46:21 -04:00
]
docstores-gpu = [
2023-05-22 10:03:51 +02:00
"farm-haystack[elasticsearch,faiss-gpu,weaviate,pinecone,opensearch]" ,
2022-08-24 03:46:21 -04:00
]
audio = [
2023-03-13 16:17:07 +01:00
"openai-whisper"
2022-08-24 03:46:21 -04:00
]
beir = [
"beir; platform_system != 'Windows'" ,
]
2023-06-23 15:33:20 +02:00
aws = [
2023-07-26 12:59:16 +02:00
"boto3" ,
# Costraint botocore to avoid taking to much time to resolve the dependency tree.
# boto3 used to constraint it at this version more than a year ago. To avoid breaking
# people using old versions we use a similar constraint without upper bound.
# https://github.com/boto/boto3/blob/dae73bef223abbedfa7317a783070831febc0c90/setup.py#L16
"botocore>=1.27" ,
2023-06-23 15:33:20 +02:00
]
2022-08-24 03:46:21 -04:00
crawler = [
2023-08-08 15:13:22 +02:00
"selenium>=4.11.0"
2022-08-24 03:46:21 -04:00
]
preprocessing = [
2023-04-14 11:34:16 +02:00
"nltk" ,
"langdetect" , # for language classification
]
file-conversion = [
2023-06-12 12:23:32 +02:00
"azure-ai-formrecognizer>=3.2.0b2" , # Microsoft Azure's Form Recognizer service (text and table exctrator)
2023-04-14 11:34:16 +02:00
"python-docx" ,
"tika" , # Apache Tika (text & metadata extractor)
2022-08-24 03:46:21 -04:00
"beautifulsoup4" ,
"markdown" ,
2023-01-26 17:15:02 +01:00
"python-frontmatter" ,
2022-08-24 03:46:21 -04:00
"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.
]
2023-03-01 18:34:38 -03:00
pdf = [
"PyMuPDF>=1.18.16" , # PDF text extraction alternative to xpdf; please check AGPLv3 license
]
2022-08-24 03:46:21 -04:00
ocr = [
2022-09-05 09:30:35 -03:00
"pytesseract>0.3.7" ,
"pdf2image>1.14" ,
2022-08-24 03:46:21 -04:00
]
onnx = [
"onnxruntime" ,
"onnxruntime_tools" ,
]
onnx-gpu = [
"onnxruntime-gpu" ,
"onnxruntime_tools" ,
]
2023-04-12 15:38:56 +02:00
metrics = [ # for metrics
"scipy>=1.3.2" ,
"rapidfuzz>=2.0.15,<2.8.0" , # FIXME https://github.com/deepset-ai/haystack/pull/3199
"seqeval" ,
2023-07-26 12:59:16 +02:00
"mlflow" ,
2023-04-12 15:38:56 +02:00
]
2022-08-24 03:46:21 -04:00
ray = [
2023-03-17 13:55:07 +01:00
"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)
2022-08-24 03:46:21 -04:00
"aiorwlock>=1.3.0,<2" ,
]
colab = [
2022-11-24 18:37:57 +01:00
"pillow<=9.0.0" ,
2022-08-24 03:46:21 -04:00
]
dev = [
"pre-commit" ,
# Type check
"mypy" ,
# Test
"pytest" ,
2023-04-28 11:59:09 +02:00
"pytest-cov" ,
2022-08-24 03:46:21 -04:00
"pytest-custom_exit_code" , # used in the CI
2023-01-23 10:23:09 -05:00
"pytest-asyncio" ,
2022-08-24 03:46:21 -04:00
"responses" ,
"tox" ,
"coverage" ,
"python-multipart" ,
"psutil" ,
# Linting
2023-02-08 15:34:43 +01:00
"pylint" ,
"farm-haystack[formatting]" ,
2022-08-24 03:46:21 -04:00
# Documentation
2022-09-05 09:30:35 -03:00
"pydoc-markdown" ,
2022-08-24 03:46:21 -04:00
"mkdocs" ,
"jupytercontrib" ,
2022-12-12 11:22:03 +01:00
"watchdog" ,
2023-05-12 11:20:48 +02:00
"toml" ,
2023-07-24 17:02:46 +02:00
"reno" ,
2023-07-26 12:59:16 +02:00
# dulwich is a reno dependency, they pin it at >=0.15.0 so pip takes ton of time to resolve the dependency tree.
# We pin it here to avoid taking too much time.
# https://opendev.org/openstack/reno/src/branch/master/requirements.txt#L7
"dulwich>=0.21.0,<1.0.0" ,
2022-08-24 03:46:21 -04:00
]
2023-02-08 15:34:43 +01:00
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" ,
]
2022-08-24 03:46:21 -04:00
all = [
2023-06-23 15:33:20 +02:00
"farm-haystack[inference,docstores,audio,crawler,preprocessing,file-conversion,pdf,ocr,ray,onnx,beir,metrics,aws]" ,
2022-08-24 03:46:21 -04:00
]
all-gpu = [
2022-12-06 14:56:27 +01:00
# beir is incompatible with faiss-gpu: https://github.com/beir-cellar/beir/issues/71
2023-06-23 15:33:20 +02:00
"farm-haystack[inference,docstores-gpu,audio,crawler,preprocessing,file-conversion,pdf,ocr,ray,onnx-gpu,metrics,aws]" ,
2022-08-24 03:46:21 -04:00
]
2023-04-04 14:24:00 +02:00
[ project . scripts ]
2023-05-31 18:34:14 +02:00
haystack = "haystack.cli.entry_point:main"
2023-04-04 14:24:00 +02:00
2022-08-24 03:46:21 -04:00
[ 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>.+)"
2023-03-14 17:01:19 +01:00
[ tool . hatch . metadata ]
allow-direct-references = true
2022-08-24 03:46:21 -04:00
[ tool . hatch . build . targets . sdist ]
include = [
"/haystack" ,
"/VERSION.txt" ,
]
[ tool . hatch . build . targets . wheel ]
packages = [
"haystack" ,
]
2022-01-26 18:12:55 +01:00
[ tool . black ]
line-length = 120
2022-03-07 19:25:33 +01:00
skip_magic_trailing_comma = true # For compatibility with pydoc>=4.6, check if still needed.
2022-01-26 18:12:55 +01:00
2023-09-13 16:14:45 +02:00
[ tool . codespell ]
ignore-words-list = "ans,astroid,nd,ned,nin,ue"
quiet-level = 3
skip = "test/nodes/*,test/others/*,test/samples/*"
2022-01-26 18:12:55 +01:00
[ tool . pylint . 'MESSAGES CONTROL' ]
max-line-length = 120
2023-05-04 15:49:26 +02:00
load-plugins = "haystack_linter"
2022-01-26 18:12:55 +01:00
disable = [
2022-02-21 20:16:14 +01:00
2022-05-04 17:39:06 +02:00
# To keep
2022-02-21 20:16:14 +01:00
"fixme" ,
"c-extension-no-member" ,
2022-04-12 16:41:05 +02:00
# To review:
2022-01-26 18:12:55 +01:00
"missing-docstring" ,
"unused-argument" ,
"no-member" ,
"line-too-long" ,
"protected-access" ,
"too-few-public-methods" ,
2022-02-09 18:27:12 +01:00
"raise-missing-from" ,
"invalid-name" ,
"duplicate-code" ,
"arguments-differ" ,
"consider-using-f-string" ,
"no-else-return" ,
"attribute-defined-outside-init" ,
"super-with-arguments" ,
"redefined-builtin" ,
"abstract-method" ,
"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" ,
"undefined-loop-variable" ,
"consider-using-in" ,
"bare-except" ,
"unexpected-keyword-arg" ,
"simplifiable-if-expression" ,
"use-list-literal" ,
2023-02-02 11:59:17 +01:00
"broad-exception-raised" ,
2022-04-12 16:41:05 +02:00
# To review later
"cyclic-import" ,
"import-outside-toplevel" ,
2022-02-09 18:27:12 +01:00
"deprecated-method" ,
2022-01-26 18:12:55 +01:00
]
[ tool . pylint . 'DESIGN' ]
2023-09-13 16:14:45 +02:00
max-args = 38 # Default is 5
2023-09-12 18:13:23 +02:00
max-attributes = 27 # Default is 7
2023-09-13 15:18:16 +02:00
max-branches = 34 # Default is 12
max-locals = 45 # Default is 15
max-module-lines = 2468 # Default is 1000
max-nested-blocks = 7 # Default is 5
max-statements = 206 # Default is 50
2022-01-26 18:12:55 +01:00
[ tool . pylint . 'SIMILARITIES' ]
2022-02-08 17:23:59 +01:00
min-similarity-lines = 6
[ tool . pytest . ini_options ]
minversion = "6.0"
addopts = "--strict-markers"
markers = [
2022-08-24 03:46:21 -04:00
"unit: unit tests" ,
2022-10-17 18:58:35 +02:00
"integration: integration tests" ,
2022-11-14 09:57:30 +01:00
2022-08-24 03:46:21 -04:00
"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" ,
2022-10-31 15:30:14 +01:00
"document_store" ,
2022-08-24 03:46:21 -04:00
]
log_cli = true
[ tool . mypy ]
warn_return_any = false
warn_unused_configs = true
ignore_missing_imports = true
plugins = [
"pydantic.mypy" ,
]
2023-08-04 12:42:13 +02:00
2023-09-13 15:18:16 +02:00
[ tool . ruff ]
2023-09-14 16:42:48 +02:00
select = [
"AIR" , # Airflow
"ASYNC" , # flake8-async
"C90" , # McCabe cyclomatic complexity
"CPY" , # flake8-copyright
"DJ" , # flake8-django
"E501" , # Long lines
"EXE" , # flake8-executable
"FURB" , # refurb
"INT" , # flake8-gettext
"PL" , # Pylint
"Q" , # flake8-quotes
"SLOT" , # flake8-slots
"T10" , # flake8-debugger
"W" , # pycodestyle
"YTT" , # flake8-2020
# "E", # pycodestyle
# "F", # Pyflakes
# "NPY", # NumPy-specific rules
# "PD", # pandas-vet
# "PERF", # Perflint
# "PT", # flake8-pytest-style
# "UP", # pyupgrade
]
line-length = 1486
target-version = "py38"
2023-09-13 15:18:16 +02:00
ignore = [
"PLR1714" , # repeated-equality-comparison
"PLR5501" , # collapsible-else-if
"PLW0603" , # global-statement
"PLW1510" , # subprocess-run-without-check
"PLW2901" , # redefined-loop-name
]
[ tool . ruff . mccabe ]
max-complexity = 28
[ tool . ruff . pylint ]
allow-magic-value-types = [ "float" , "int" , "str" ]
max-args = 38 # Default is 5
max-branches = 32 # Default is 12
max-returns = 9 # Default is 6
max-statements = 105 # Default is 50
2023-08-04 12:42:13 +02:00
[ tool . coverage . run ]
omit = [
"haystack/testing/*" ,
]