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 ]
2023-11-24 12:14:43 +01:00
name = "haystack-ai"
2022-08-24 03:46:21 -04:00
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 = [
2023-09-26 12:48:15 +02:00
"pandas" ,
2023-12-18 10:47:15 +01:00
"haystack-bm25" ,
2023-09-26 12:48:15 +02:00
"tqdm" ,
"tenacity" ,
"lazy-imports" ,
2023-12-28 17:10:51 +01:00
"openai>=1.1.0" ,
2023-11-24 12:09:47 +01:00
"Jinja2" ,
"posthog" , # telemetry
2023-10-18 17:53:48 +02:00
"pyyaml" ,
2023-11-24 12:09:47 +01:00
"more-itertools" , # TextDocumentSplitter
2023-11-28 09:58:56 +01:00
"networkx" , # Pipeline graphs
2024-02-28 16:43:08 +01:00
"typing_extensions>=4.7" , # typing support for Python 3.8
2023-12-14 11:53:38 +01:00
"boilerpy3" , # Fulltext extraction from HTML pages
2022-08-24 03:46:21 -04:00
]
2023-11-24 12:09:47 +01:00
2024-02-26 15:40:10 +01:00
[ tool . hatch . envs . default ]
dependencies = [
2022-08-24 03:46:21 -04:00
"pre-commit" ,
# Type check
"mypy" ,
# Test
2024-03-04 12:26:40 +01:00
"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" ,
2024-03-04 12:26:40 +01:00
"pytest-rerunfailures" ,
2022-08-24 03:46:21 -04:00
"responses" ,
"tox" ,
"coverage" ,
"python-multipart" ,
"psutil" ,
# Linting
2023-02-08 15:34:43 +01:00
"pylint" ,
2024-03-01 11:08:51 +01:00
"ruff" ,
2022-08-24 03:46:21 -04:00
# Documentation
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" ,
2023-02-08 15:34:43 +01:00
# Version specified following Black stability policy:
# https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy
"black[jupyter]~=23.0" ,
]
2024-02-26 15:40:10 +01:00
[ tool . hatch . envs . default . scripts ]
format = "black ."
format-check = "black --check ."
[ tool . hatch . envs . test ]
extra-dependencies = [
"transformers[torch,sentencepiece]==4.37.2" , # ExtractiveReader, TransformersSimilarityRanker, LocalWhisperTranscriber, HFGenerators...
"spacy>=3.7,<3.8" , # NamedEntityExtractor
"spacy-curated-transformers>=0.2,<=0.3" , # NamedEntityExtractor
"en-core-web-trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.7.3/en_core_web_trf-3.7.3-py3-none-any.whl" , # NamedEntityExtractor
# Converters
"pypdf" , # PyPDFConverter
"markdown-it-py" , # MarkdownToDocument
"mdit_plain" , # MarkdownToDocument
"tika" , # TikaDocumentConverter
"azure-ai-formrecognizer>=3.2.0b2" , # AzureOCRDocumentConverter
"langdetect" , # TextLanguageRouter and DocumentLanguageClassifier
"sentence-transformers>=2.2.0" , # SentenceTransformersTextEmbedder and SentenceTransformersDocumentEmbedder
"openai-whisper>=20231106" , # LocalWhisperTranscriber
2024-03-01 12:40:24 +01:00
"chroma-haystack" , # pipeline predefined templates
2024-02-26 15:40:10 +01:00
# OpenAPI
"jsonref" , # OpenAPIServiceConnector, OpenAPIServiceToFunctions
"openapi3" ,
# Validation
"jsonschema" ,
# Tracing
"opentelemetry-sdk" ,
"ddtrace" ,
2024-02-27 09:15:01 +01:00
# Structured logging
"structlog" ,
2024-02-26 15:40:10 +01:00
]
[ tool . hatch . envs . test . scripts ]
e2e = "pytest e2e"
unit = 'pytest --cov-report xml:coverage.xml --cov="haystack" -m "not integration" test'
integration = 'pytest --maxfail=5 -m "integration" test'
integration-mac = 'pytest --maxfail=5 -m "integration" test -k "not tika"'
integration-windows = 'pytest --maxfail=5 -m "integration" test -k "not tika"'
types = "mypy --install-types --non-interactive --cache-dir=.mypy_cache/ {args:haystack}"
2024-03-01 11:08:51 +01:00
lint = [
"ruff {args:haystack}" ,
"pylint -ry -j 0 {args:haystack}"
]
lint-fix = [
"black ." ,
"ruff {args:haystack} --fix" ,
]
2024-02-26 15:40:10 +01:00
[ tool . hatch . envs . readme ]
detached = true # To avoid installing the dependencies from the default environment
dependencies = [
"haystack-pydoc-tools" ,
]
[ tool . hatch . envs . readme . scripts ]
sync = "./.github/utils/pydoc-markdown.sh"
2024-02-28 12:41:10 +01:00
delete-outdated = "python ./.github/utils/delete_outdated_docs.py {args}"
2024-02-26 15:40:10 +01:00
[ tool . hatch . envs . snippets ]
extra-dependencies = [
"torch" ,
"pydantic" ,
]
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 ]
2023-11-23 11:41:57 +01:00
ignore-words-list = "ans,astroid,nd,ned,nin,ue,rouge,ist"
2023-09-13 16:14:45 +02:00
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
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-20 08:32:44 +02:00
max-attributes = 28 # 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
2023-09-20 08:32:44 +02:00
max-nested-blocks = 9 # Default is 5
2023-09-13 15:18:16 +02:00
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
2023-08-04 12:42:13 +02:00
2023-09-13 15:18:16 +02:00
[ tool . ruff ]
2024-03-01 11:08:51 +01:00
line-length = 1486
target-version = "py38"
[ tool . ruff . lint ]
2023-09-14 16:42:48 +02:00
select = [
"AIR" , # Airflow
"ASYNC" , # flake8-async
2023-09-16 16:26:07 +02:00
"C4" , # flake8-comprehensions
2023-09-14 16:42:48 +02:00
"C90" , # McCabe cyclomatic complexity
"CPY" , # flake8-copyright
"DJ" , # flake8-django
"E501" , # Long lines
"EXE" , # flake8-executable
2023-09-15 18:30:33 +02:00
"F" , # Pyflakes
2023-09-14 16:42:48 +02:00
"FURB" , # refurb
"INT" , # flake8-gettext
2023-09-16 16:26:07 +02:00
"PERF" , # Perflint
2023-09-14 16:42:48 +02:00
"PL" , # Pylint
"Q" , # flake8-quotes
2023-09-20 08:32:44 +02:00
"SIM" , # flake8-simplify
2023-09-14 16:42:48 +02:00
"SLOT" , # flake8-slots
"T10" , # flake8-debugger
"W" , # pycodestyle
"YTT" , # flake8-2020
2024-02-29 14:31:20 +01:00
"I" # isort
2023-09-14 16:42:48 +02:00
# "E", # pycodestyle
# "NPY", # NumPy-specific rules
# "PD", # pandas-vet
# "PT", # flake8-pytest-style
# "UP", # pyupgrade
]
2024-03-01 11:08:51 +01:00
2023-09-13 15:18:16 +02:00
ignore = [
2023-09-15 18:30:33 +02:00
"F401" , # unused-import
2023-09-16 16:26:07 +02:00
"PERF203" , # `try`-`except` within a loop incurs performance overhead
2023-09-20 08:32:44 +02:00
"PERF401" , # Use a list comprehension to create a transformed list
2023-09-13 15:18:16 +02:00
"PLR1714" , # repeated-equality-comparison
"PLR5501" , # collapsible-else-if
"PLW0603" , # global-statement
"PLW1510" , # subprocess-run-without-check
"PLW2901" , # redefined-loop-name
2023-09-20 08:32:44 +02:00
"SIM108" , # if-else-block-instead-of-if-exp
"SIM115" , # open-file-with-context-handler
"SIM118" , # in-dict-keys
2023-09-13 15:18:16 +02:00
]
2024-03-01 11:08:51 +01:00
[ tool . ruff . lint . mccabe ]
2023-09-13 15:18:16 +02:00
max-complexity = 28
2024-03-01 11:08:51 +01:00
[ tool . ruff . lint . per-file-ignores ]
2023-09-16 16:26:07 +02:00
"examples/basic_qa_pipeline.py" = [ "C416" ]
"haystack/preview/testing/document_store.py" = [ "C416" , "F821" ]
2023-09-15 18:30:33 +02:00
"haystack/telemetry.py" = [ "F821" ]
2024-03-01 11:08:51 +01:00
[ tool . ruff . lint . pylint ]
2023-09-13 15:18:16 +02:00
allow-magic-value-types = [ "float" , "int" , "str" ]
max-args = 38 # Default is 5
max-branches = 32 # Default is 12
2023-09-20 08:32:44 +02:00
max-public-methods = 90 # Default is 20
2023-09-13 15:18:16 +02:00
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/*" ,
]