[project]
name = "py-drakkar"
dynamic = ["version"]
description = "Kafka subprocess orchestration framework"
readme = "README.md"
requires-python = ">=3.13"
license = "MIT"
authors = [
    { name = "wlame" },
]
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Framework :: AsyncIO",
    "Topic :: System :: Distributed Computing",
]
dependencies = [
    "confluent-kafka>=2.6.0",
    "pydantic>=2.10.0",
    "pydantic-settings>=2.7.0",
    "asyncpg>=0.30.0",
    "prometheus-client>=0.21.0",
    "structlog>=24.4.0",
    "pyyaml>=6.0.2",
    "aiosqlite>=0.20.0",
    "fastapi>=0.115.0",
    "uvicorn[standard]>=0.32.0",
    "jinja2>=3.1.0",
    "motor>=3.6.0",
    "httpx>=0.27.0",
    "redis>=5.2.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.3.0",
    "pytest-asyncio>=0.24.0",
    "pytest-cov>=6.0.0",
    "httpx>=0.27.0",
    "ruff>=0.11.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "drakkar/__init__.py"

[tool.hatch.build.targets.wheel]
packages = ["drakkar"]
artifacts = ["drakkar/templates/**"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "--strict-markers -v"

[tool.coverage.run]
source = ["drakkar"]
omit = ["tests/*"]

[tool.coverage.report]
show_missing = true
fail_under = 75

[tool.ruff]
target-version = "py313"
line-length = 120

[tool.ruff.lint]
select = [
    "E",     # pycodestyle errors
    "W",     # pycodestyle warnings
    "F",     # pyflakes
    "I",     # isort
    "UP",    # pyupgrade
    "ANN",   # flake8-annotations
    "B",     # flake8-bugbear
    "SIM",   # flake8-simplify
    "RUF",   # ruff-specific
]
ignore = [
    "ANN401", # dynamically typed expressions (Any)
    "ANN002", # missing type annotation for *args
    "ANN003", # missing type annotation for **kwargs
    "E501",   # line too long (handled by formatter)
    "SIM105", # contextlib.suppress — doesn't work with async try/except
    "UP046",  # generic class syntax — we need Generic[] for Python 3.13 compat
    "RUF006", # store asyncio.create_task ref — intentional fire-and-forget in partition processor
]

[tool.ruff.format]
quote-style = "single"

[dependency-groups]
dev = [
    "ty>=0.0.24",
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN"]
"integration/*" = ["ANN"]
"drakkar/debug_server.py" = ["ANN201", "ANN202"]  # FastAPI route return types inferred
