[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "hayhooks"
dynamic = ["version"]
description = 'Grab and deploy Haystack pipelines'
readme = "README.md"
requires-python = ">=3.10,<3.15"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "deepset.ai", email = "malte.pietsch@deepset.ai" }
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai!=2.18.0",
"fastapi[standard]",
"typer",
"uvicorn",
"rich",
"requests",
"python-multipart",
"loguru",
"pydantic-settings",
"python-dotenv",
"docstring-parser",
]
[project.optional-dependencies]
mcp = [
"mcp>=1.8.0 ; python_version >= '3.10'",
]
[project.urls]
Documentation = "https://github.com/deepset-ai/hayhooks#readme"
Issues = "https://github.com/deepset-ai/hayhooks/issues"
Source = "https://github.com/deepset-ai/hayhooks"
[project.scripts]
hayhooks = "hayhooks.cli:hayhooks_cli"
[tool.hatch.version]
source = "vcs"
[tool.hatch.envs.default]
installer = "uv"
dependencies = [
"ruff",
]
[tool.hatch.envs.default.scripts]
fmt = "ruff check --fix {args}; ruff format {args}"
fmt-check = "ruff check {args} && ruff format --check {args}"
[tool.hatch.envs.docs]
detached = true
dependencies = [
"mkdocs-material",
"mkdocstrings",
"mkdocs-mermaid2-plugin",
"mkdocs-minify-plugin",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-llmstxt",
]
[tool.hatch.envs.docs.scripts]
serve = "mkdocs serve {args}"
build = "mkdocs build {args}"
deploy = "mkdocs gh-deploy --remote-name origin --force --no-history -m \"Deploy docs via automation\" {args}"
[tool.hatch.envs.test]
features = ["mcp"]
extra-dependencies = [
"qdrant-haystack",
"trafilatura",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"ty",
]
[tool.hatch.envs.test.scripts]
unit = "pytest -vv -m 'not integration' {args:tests}"
integration = "pytest -vv -m integration {args:tests}"
all = "pytest -vv {args:tests}"
all-cov = "all --cov=hayhooks"
types = "ty check {args:src/hayhooks}"
[tool.ty.environment]
python-version = "3.10"
[tool.ty.rules]
unused-ignore-comment = "warn"
[tool.ty.src]
exclude = ["tests/**/*"]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
isort.split-on-trailing-comma = false
flake8-tidy-imports.ban-relative-imports = "all"
select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
# from Haystack:
"ASYNC", # flake8-async
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"EXE", # flake8-executable
"F", # Pyflakes
"INT", # flake8-gettext
"PERF", # Perflint
"PL", # Pylint
"Q", # flake8-quotes
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T10", # flake8-debugger
"W", # pycodestyle
"YTT", # flake8-2020
# (docstring rules)
"D209", # Closing triple quotes go to new line
"D205", # 1 blank line required between summary line and description
"D213", # summary lines must be positioned on the second physical line of the docstring
"D419", # undocumented-returns
]
ignore = [
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"N806", # Variable in function should be lowercase
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PLC0415", # `import` should be at the top-level of a file
"S101", # Use of `assert` detected
]
[tool.ruff.lint.per-file-ignores]
# Specific ignores for tests
"tests/**/*" = [
"B017", # Do not assert blind exception
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"FBT003", # Boolean-typed default argument in function definition
"PLR2004", # Magic value used in comparison
"S101", # Use of `assert` detected
"TID252", # Prefer absolute imports over relative imports from parent modules
]
[tool.coverage.run]
source_pkgs = ["hayhooks"]
branch = true
parallel = true
omit = [
"src/hayhooks/testing/*",
]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.pytest.ini_options]
addopts = "--strict-markers"
filterwarnings = [
"ignore::UserWarning",
"ignore:Module hayhooks was previously imported:coverage.exceptions.CoverageWarning",
"ignore:__package__ != __spec__.parent:DeprecationWarning",
]
asyncio_mode = "auto"
log_cli = true
markers = [
"unit: unit tests",
"integration: integration tests",
"asyncio: mark a test as an asyncio coroutine",
"mcp: tests that require the MCP package",
]