[project]
name = "ows-text-campaigns"
version = "0.1.0"
description = "The Orchard Web Service for Audience Development Text Campaigns."
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.13.0, <3.14"
dependencies = [
    "owslogger==4.3.1",
    "jwtauth>=0.2.0,<0.3",
    "anydi>=0.75.0",
    "psycopg[binary, pool]>=3.2.9,<4",
    "snowflake-sqlalchemy>=1.7.7,<2",
    "sqlalchemy>=2.0.45",
    "sqlalchemy-utils>=0.42.1",
    "fastapi>=0.138.2",
    "pydantic-settings>=2.14.2,<3",
    "ddtrace>=4.10.6",
    "sentry-sdk[fastapi]>=2.48.0,<3",
    "boto3>=1.40.31,<2",
    "redis>=6.4.0",
    "owsclient>=0.7.0",
    "fansifter-common[db]==0.154.0",
    "uvicorn[standard]>=0.51.0",
    "python-slugify>=8.0.4,<9",
    "beautifulsoup4>=4.13.5",
    "pillow>=12.0.0",
    "pygifsicle>=1.1.0",
    "imageio>=2.37.0",
    "opencv-python>=4.12.0.88",
    "filetype>=1.2.0",
    "rich>=13.9.4",
    "phonenumbers>=9.0.21",
    "typer>=0.21.1",
    "pycountry>=24.6.1",
    "snowflake-snowpark-python>=1.52.0",
    "snowflake-ml-python>=1.44.0",
    "twilio>=9.8.7",
    "confluent-kafka>=2.12.2",
    "types-confluent-kafka>=1.4.0",
    "boto3-stubs[dynamodb,kms,s3,sts]>=1.40.31",
    "cachetools>=5.5.2",
]

[dependency-groups]
dev = [
    "ty>=0.0.57",
    "ruff>=0.15.20",
    "pytest>=9.0.3",
    "pytest-cov>=7.0.0",
    "pytest-mock>=3.15.0,<4",
    "pytest-env>=1.1.5,<2",
    "pytest-docker>=3.2.2,<4",
    "dirty-equals>=0.11",
    "faker>=39.0.0",
    "polyfactory>=3.1.0",
    "freezegun>=1.5.5,<2",
    "twilio-stubs>=0.2.0",
]

[tool.uv]

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

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

[tool.ruff]
line-length = 88
target-version = "py312"
include = [
    "src/**/*.py",
    "tests/**/*.py",
    "manage.py",
]

[tool.ruff.lint]
select = [
    "ARG",
    "C",
    "E",
    "F",
    "W",
    "B",
    "I",
    "UP",
    "T20",
    "TID252",
    "G",
    "FURB",
]
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"
anydi_autoinject = true
filterwarnings = [
    "ignore::pydantic.warnings.PydanticDeprecatedSince20",
]
env = [
    "Environment = test",
    "APP_DEBUG = true",
    "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",
    "ASSETS_CDN_DOMAIN = test-cdn.com",
    "OWSREQUEST_SERVICE_MAP = {{\"ows-url-shortener\": \"http://test-ows-url-shortener/\"}}",
]

[tool.coverage.run]

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