[project]
name = "resonance-engine-core"
version = "0.1.0"
requires-python = ">=3.14"
dependencies = [
    "fastapi>=0.136.1",
    "pydantic-settings>=2.13.1",
    "fansifter-common[db]>=0.144.0",
    "uvicorn>=0.46.0",
    "httpx>=0.28.1",
    "faker>=40.13.0",
    "redis>=7.4.0",
    "typer>=0.24.1",
    "confluent-kafka>=2.14.0",
    "psycopg[binary,pool]>=3.3.3",
    "owslogger==4.3.1",
    "rich>=14.3.3",
    "boto3>=1.42.88",
    "cryptography>=46.0.7",
]

[dependency-groups]
dev = [
    "ty>=0.0.34",
    "ruff>=0.15.9",
    "polyfactory>=3.3.0",
    "pytest-cov>=7.1.0",
    "pytest-docker>=3.2.5",
    "pytest-env>=1.6.0",
    "pytest-mock>=3.15.1",
    "respx>=0.22.0",
    "types-confluent-kafka>=1.4.1",
    "celery[redis]<=5.6.0",
    "celery-types>=0.26.0",
    "fakeredis>=2.35.1",
]

[[tool.uv.index]]
name = "theorchard"
url = "https://pypi.theorchard.io/pypi/"

[tool.uv.build-backend]
module-name = "app"
module-root = ""

[tool.ty.src]
include = [
    "app/**/*.py",
    "tests/**/*.py",
    "manage.py",
]

[tool.ruff]
line-length = 88
include = [
    "app/**/*.py",
    "tests/**/*.py",
    "manage.py",
]

[tool.ruff.lint]
select = [
    "ARG",
    "C",
    "E",
    "F",
    "W",
    "B",
    "I",
    "UP",
    "T20",
    "TID252",
    "G",
    "FURB",
    "FAST",
    "RUF",
]
ignore = [
    "E501",
    "B008",
    "B009"
]

[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["ARG002"]

[tool.ruff.lint.isort]
combine-as-imports = true
forced-separate = ["tests"]

[tool.pytest.ini_options]
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
env = [
    "Environment = test",
    "APP_DEBUG = true",
    "DSQL_ENDPOINT = ",
    "DB_USER = postgres",
    "DB_PASSWORD = postgres",
    "D:DB_HOST = localhost",
    "D:DB_PORT = 7432",
    "D:DB_NAME = resonance_test",
    "LOGGING_DEBUG = true",
    "SENTRY_DSN = ",
    "DD_FLUSH_TO_LOG = true",
]

[tool.coverage.run]
branch = true
source = ["app"]

omit = [
    "app/config.py",
]

[tool.coverage.report]
exclude_also = [
    "@abstractmethod",
    "@abc.abstractmethod",
    "if TYPE_CHECKING",
    "raise NotImplementedError",
    "if settings.sentry_dsn:",
]

[build-system]
requires = ["uv_build>=0.11.2,<0.12"]
build-backend = "uv_build"
