[project]
name = "ows-dmp"
version = "0.1.0"
description = "The Orchard Web Service for Audience development Data Management Platform"
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.13.0, <3.14"
dependencies = [
    "fansifter-common[db]>=0.141.0",
    "jwtauth>=0.2.0,<0.3",
    "owsclient>=0.12.0",
    "anydi>=0.74.2",
    "fastapi>=0.135.1",
    "fastapi-debug-toolbar>=0.6.3,<0.7",
    "SQLAlchemy>=2.0.48,<3",
    "SQLAlchemy-Utils>=0.42.1",
    "snowflake-sqlalchemy>=1.9.0,<2",
    "psycopg[binary, pool]>=3.2.12,<4",
    "pydantic-settings>=2.11.0,<3",
    "redis>=5.0.0,<6",
    "httpx>=0.27.2",
    "respx>=0.21.1",
    "orjson>=3.11.6,<4",
    "botocore>=1.27.2,<2",
    "uvicorn[standard]>=0.42.0",
    "jinja2>=3.1.6,<4",
    "jinja2sql~=0.10.0",
    "click>=8.1.6,<9",
    "boto3>=1.24.66,<2",
    "python-slugify>=8.0.1,<9",
    "python-dotenv>=1.0.0,<2",
    "tldextract>=5.0.0,<6",
    "ddtrace>=4.6.0",
    "sentry-sdk[fastapi]>=2.1.1,<3",
    "cachelib>=0.13.0,<0.14",
    "splitio-client[cpphash]>=10.5.1,<11",
    "haversine>=2.9.0,<3",
    "owslogger==4.3.1",
    "rich>=14.2.0",
    "snowflake-snowpark-python>=1.48.1",
    "snowflake-ml-python>=1.33.0",
]

[dependency-groups]
dev = [
    "ty==0.0.28",
    "ruff>=0.15.8",
    "pre-commit>=3.2.2,<4",
    "pytest>=9.0.2",
    "pytest-cov>=7.0.0",
    "pytest-mock>=3.15.1,<4",
    "pytest-env>=1.5.0,<2",
    "pytest-docker>=3.2.5,<4",
    "types-tabulate>=0.9.0.0,<0.10",
    "types-pyyaml>=6.0.12.20240808,<7",
    "freezegun>=1.5.5,<2",
    "polyfactory>=2.22.3,<3",
    "boto3-stubs[s3]>=1.26.10,<2",
    "dirty-equals>=0.11.0",
    "secrets_manager>=1.4.0,<2",
]
scripts = ["pandas>=2.2.3,<3"]

[tool.uv]
default-groups = [
    "dev",
    "scripts",
]
override-dependencies = [
    "snowflake-connector-python==4.2.0",
    "pyopenssl==25.3.0"
]


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

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

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

[tool.ruff]
line-length = 88
include = [
    "dmp/**/*.py",
    "tests/**/*.py",
    "scripts/sync_geonames_data.py",
    "scripts/sync_fivetran_tables_state.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 = [
    "order",
]
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
env = [
    "APP_DEBUG = false",
    "Environment = test",
    "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",
    "SNOWFLAKE_SHOPIFY_SCHEMA = public",
    "SNOWFLAKE_SHOPIFY_INTEGRATIONS_DATABASE = ",
    "DEBUG_TOOLBAR_ENABLED = false",
    "CACHE_BACKEND = null",
    "SENTRY_DSN = ",
    "LOGGING_DEBUG = true",
    "JWT_AUTH_ENABLED = false",
    "AUTH_ALLOW_FULL_ACCESS = true",
    "KMS_ENABLED = false",
    "SPLIT_IO_API_KEY = localhost",
    "OWSREQUEST_SERVICE_MAP = {{\"ows-permission\": \"http://test-ows-permission/\", \"ows-account\": \"http://test-ows-account/\"}}",
]

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