[project]
name = "ows-preference-center"
version = "0.1.0"
description = "The Orchard Web Service for Preference Center"
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.14.0, <3.15"
dependencies = [
    "fansifter-common[crypto,db]==0.154.0",
    "jwtauth>=0.2.0,<0.3",
    "anydi>=0.75.0",
    "fastapi>=0.138.1",
    "email-validator>=2.3.0,<3",
    "SQLAlchemy>=2.0.51,<3",
    "sqlalchemy-utils>=0.42.1",
    "snowflake-sqlalchemy>=1.8.2,<2",
    "pydantic-settings>=2.14.2,<3",
    "cachelib>=0.14.0,<0.15",
    "orjson>=3.11.5,<4",
    "ddtrace>=4.0.1",
    "sentry-sdk[fastapi]>=2.48.0,<3",
    "boto3>=1.42.13,<2",
    "phonenumbers>=9.0.33",
    "confluent-kafka>=2.12.2,<3",
    "redis>=7.1.0",
    "uvicorn[standard]>=0.40.0",
    "jinja2>=3.1.6,<4",
    "owslogger>=4.3.1",
    "rich>=14.2.0",
    "pycountry>=24.6.1",
]

[dependency-groups]
dev = [
    "ty>=0.0.55",
    "ruff>=0.15.20",
    "pytest>=9.0.3",
    "pytest-cov>=7.0.0",
    "pytest-mock>=3.15.1,<4",
    "pytest-env>=1.2.0,<2",
    "pytest-docker>=3.2.5,<4",
    "boto3-stubs>=1.42.13,<2",
    "polyfactory>=3.2.0",
    "dirty-equals>=0.11.0",
    "freezegun>=1.5.5,<2",
    "types-pyyaml>=6.0.12.20250915",
    "types-confluent-kafka>=1.4.0",
]

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

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

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

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

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

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

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

[tool.pytest.ini_options]
markers = [
    "db: database marker",
]
addopts = [
    "--strict-config",
    "--strict-markers",
]
anydi_autoinject = true
xfail_strict = true
junit_family = "xunit2"
env = [
    "APP_DEBUG = true",
    "Environment = test",
    "CACHE_BACKEND = null",
    "SENTRY_DSN = ",
    "LOGGING_DEBUG = true",
    "JWT_AUTH_ENABLED = false",
    "SECRET_KEY=",
    "PROFILE_VERSION = v1",
]

[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"
