[project]
name = "ows-url-shortener"
version = "0.1.0"
description = "The Orchard Web Service for Audience Development URL Shortener."
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = "~=3.13.0"
dependencies = [
    "jwtauth>=0.2.0,<0.3",
    "anydi>=0.47.0",
    "fastapi>=0.115.8,<0.116",
    "pydantic-settings>=2.5.2,<3",
    "ddtrace>=2.21.0,<3",
    "sentry-sdk[fastapi]>=2.1.1,<3",
    "boto3>=1.34.132,<2",
    "owsclient>=0.6.0,<0.7",
    "uvicorn[standard]>=0.34.0,<0.35",
    "fansifter-common[cli]>=0.89.0",
    "aiodynamo[httpx]>=24.7",
    "aiokafka>=0.12.0",
    "pycountry>=24.6.1",
    "device-detector>=5.0.1",
    "owslogger>=4.3.0",
    "rich>=13.9.4",
]

[dependency-groups]
dev = [
    "ruff>=0.12.5",
    "pytest>=8.3.4,<9",
    "pytest-cov>=6.0.0,<7",
    "pytest-mock>=3.12.0,<4",
    "pytest-env>=1.1.5,<2",
    "pytest-docker>=3.2.0,<4",
    "types-pyyaml>=6.0.12.20240311,<7",
    "dirty-equals>=0.9.0,<0.10",
    "faker>=36.1.1,<37",
    "polyfactory>=2.19.0,<3",
    "boto3-stubs>=1.34.132,<2",
    "freezegun>=1.5.1,<2",
    "typer>=0.15.1,<0.16",
    "pyright[nodejs]>=1.1.403",
]

[tool.uv]

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

[tool.pyright]
include = [
    "url_shortener/**/*.py",
    "tests/**/*.py",
    "manage.py",
]
typeCheckingMode = "standard"

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

[tool.ruff.lint]
select = ["ARG", "C", "E", "F", "W", "B", "I", "UP", "T20", "TID252", "G", "FURB", "INP"]
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_inject_all = true
env = [
    "APP_DEBUG = true",
    "Environment = test",
    "SENTRY_DSN = ",
    "LOG_FORMAT = console",
    "JWT_AUTH_ENABLED = false",
    "AUTH_ALLOW_FULL_ACCESS = true",
]

[tool.coverage.run]

[tool.coverage.report]
exclude_also = [
    "@abstractmethod",
    "@abc.abstractmethod",
    "if TYPE_CHECKING",
    "raise NotImplementedError",
    "if settings.sentry_dsn:",
]

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

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

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

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
