[project]
name = "automated-emails-sender"
version = "0.1.0"
description = ""
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.13.0, <3.14"
readme = "README.md"
dependencies = [
    "pydantic-settings>=2.0.3,<3",
    "fansifter-common[cli,db]==0.154.0",
    "snowflake-sqlalchemy>=1.9.0,<2",
    "sentry-sdk>=2.12.0,<3",
    "datadog-lambda>=8.123.0",
    "boto3>=1.28.63,<2",
    "cryptography>=46.0.5",
    "emval>=0.1.12",
    "unidecode>=1.4.0",
    "owslogger>=4.3.0",
    "rich>=14.2.0",
    "redis>=7.0.1",
]

[dependency-groups]
dev = [
    "ty>=0.0.29",
    "ruff>=0.15.9",
    "pytest>=9.0.2",
    "pytest-cov>=6.1.1",
    "pytest-env>=1.6.0,<2",
    "pytest-docker>=3.2.5",
    "polyfactory>=3.3.0",
    "freezegun>=1.2.2,<2",
    "dirty-equals>=0.9.0",
    "faker>=40.11.0",
    "psycopg[binary]>=3.2.11",
    "boto3-stubs[s3]>=1.40.46",
    "fakeredis[json,lua]>=2.32.0",
    "pytest-mock>=3.15.1",
]

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

[tool.hatch.build.targets.sdist]
include = ["./app"]

[tool.hatch.build.targets.wheel]
include = ["./app"]

[tool.hatch.build.targets.wheel.sources]
"./app" = "app"

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

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

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

[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",
    "SNOWFLAKE_USER = postgres",
    "SNOWFLAKE_PASSWORD = postgres",
    "D:SNOWFLAKE_HOST = localhost",
    "D:SNOWFLAKE_PORT = 7443",
    "D:SNOWFLAKE_DATABASE = app_reporting_test",
    "LOGGING_DEBUG = true",
    "SENTRY_DSN = ",
    "DD_FLUSH_TO_LOG = true",
    "PREFERENCE_CENTER_ENCRYPTED_BACKEND = dummy",
]

[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 = ["hatchling"]
build-backend = "hatchling.build"
