[project]
name = "ows-email-campaigns"
version = "0.1.0"
description = "The Orchard Web Service for Audience Development Email Campaigns."
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.14.0, <3.15"
dependencies = [
    "owslogger==4.3.1",
    "jwtauth>=0.2.0,<0.3",
    "anydi>=0.74.2",
    "psycopg[binary, pool]>=3.3.3",
    "snowflake-sqlalchemy>=1.9.0",
    "sqlalchemy==2.0.49",
    "sqlalchemy-utils>=0.42.1",
    "fastapi==0.135.3",
    "pydantic-settings>=2.14.2,<3",
    "ddtrace>=4.6.5",
    "sentry-sdk[fastapi]>=2.1.1,<3",
    "boto3>=1.34.132,<2",
    "redis>=6.4.0",
    "owsclient>=0.6.0,<0.7",
    "click>=8.1.7,<9",
    "fansifter-common[cli,db]>=0.148.0",
    "email-validator>=2.3.0,<3",
    "uvicorn[standard]>=0.42.0",
    "python-slugify>=8.0.4,<9",
    "beautifulsoup4>=4.12.5,<5",
    "lxml>=5.3,<7",
    "rich>=13.9.4",
    "itsdangerous>=2.2.0,<3",
    "splitio-client>=10.5.1,<10.6.0",
    "rapidfuzz>=3.0.0,<4",
    "cryptography==48.0.1",
]

[dependency-groups]
dev = [
    "ty>=0.0.31",
    "ruff>=0.15.10",
    "pytest>=9.0.3",
    "pytest-cov>=7.1.0",
    "pytest-mock>=3.15.1,<4",
    "pytest-env>=1.6.0,<2",
    "pytest-docker>=3.2.5,<4",
    "types-pyyaml>=6.0.12.20250915,<7",
    "types-beautifulsoup4>=4.12.0.2025051,<5",
    "dirty-equals>=0.11",
    "faker>=40.1.0",
    "polyfactory>=3.3.0",
    "boto3-stubs>=1.34.132,<2",
    "freezegun>=1.5.5,<2",
    "shandy-sqlfmt[jinjafmt]>=0.29.0",
]

[tool.uv]

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

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

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

[tool.ruff]
line-length = 88
include = [
    "email_campaigns/**/*.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.isort]
combine-as-imports = true
forced-separate = ["tests"]

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

[tool.pytest.ini_options]
markers = []
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
env = [
    "APP_DEBUG = true",
    "Environment = test",
    "CACHE_BACKEND = null",
    "POSTGRES_USER = postgres",
    "POSTGRES_PASSWORD = postgres",
    "D:POSTGRES_HOST = localhost",
    "D:POSTGRES_PORT = 7432",
    "D:POSTGRES_NAME = dmp_test",
    "SNOWFLAKE_USER = postgres",
    "SNOWFLAKE_PASSWORD = postgres",
    "D:SNOWFLAKE_HOST = localhost",
    "D:SNOWFLAKE_PORT = 7443",
    "D:SNOWFLAKE_DATABASE = app_reporting_test",
    "SENTRY_DSN = ",
    "LOGGING_DEBUG = true",
    "JWT_AUTH_ENABLED = false",
    "AUTH_ALLOW_FULL_ACCESS = true",
    "EMAIL_PUBLIC_PREVIEW_SECRET_KEY = test-secret-key",
]

[tool.coverage.run]

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