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

[project]
name = "telegras"
version = "0.4.0"
description = "Telegram + FastAPI ingestion core with pluggable publication backends"
readme = "README.md"
requires-python = ">=3.10"
authors = [
  { name = "cbadger", email = "" }
]
dependencies = [
  "fastapi>=0.112.0",
  "uvicorn[standard]>=0.30.0",
  "httpx>=0.27.0",
  "pydantic>=2.7.0",
  "sqlalchemy>=2.0.30",
  "aiosqlite>=0.20.0",
  "click>=8.0.0",
  "alembic>=1.13.2",
  "rich>=14.3.3",
]

[project.scripts]
telegras = "telegras.cli:cli"

[project.optional-dependencies]
dev = [
  "pytest>=8.2.0",
  "pytest-asyncio>=0.23.0",
  "pytest-cov>=5.0.0",
  "ruff>=0.1.6",
  "black>=23.0.0",
  "mypy>=1.7.0",
]
docs = [
  "mkdocs<2.0.0",
  "mkdocs-material>=9.5.0",
  "mkdocstrings[python]>=0.25.0",
  "interrogate>=1.7.0",
  "pydoclint>=0.7.0",
]

[tool.hatch.build.targets.wheel]
packages = ["telegras", "tg_api_parsed"]

[tool.hatch.envs.default.scripts]
start = "uvicorn telegras.app:app --reload"
test = "pytest"
cov = "pytest --cov=telegras"
lint = "ruff check telegras tests"
lint-docstrings = "ruff check --select D --ignore D100,D101,D102,D103,D104,D105,D106,D107,D202,D203,D212,D213,D403 telegras"
docstring-coverage = "interrogate telegras"
docstring-consistency = "pydoclint --config=pyproject.toml telegras"
docs-build = "mkdocs build --strict"
format = "ruff format telegras tests"
typecheck = "mypy telegras"

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = "-q"

[dependency-groups]
dev = ["pytest", "pytest-asyncio", "pytest-cov", "ruff", "black", "mypy"]
docs = ["mkdocs", "mkdocs-material", "mkdocstrings[python]", "interrogate", "pydoclint"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.interrogate]
fail-under = 6
exclude = ["tests", "docs", "alembic", "dist", "data", ".venv"]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
ignore-module = false

[tool.pydoclint]
style = "google"
exclude = "\\.git|\\.tox|tests|alembic"
arg-type-hints-in-docstring = false
check-return-types = true
check-yield-types = true
skip-checking-short-docstrings = true
