[tool.poetry]
name = "backfill"
version = "0.1.0"
description = "🛠️ PP Tools for backfilling to Identities/Roles application_family: permissions-platform"
authors = ["Sony Music PDE"]
readme = "README.md"

[tool.poetry.scripts]
pdpbackfill = "backfill.cli.main:app"

[tool.poetry.dependencies]
python = "^3.13"
pydantic = "2.10.6"
owsclient = "^0.6.1"
tenacity = "^9.1.2"
fansifter-common = "^0.14.0"
environs = "^14.1.1"
typer = "^0.15.2"
sentry-sdk = "^2.25.1"
botocore = "^1.37.31"
boto3 = "^1.37.31"
h11 = "^0.16.0"
# Pinning marshmallow due to CVE-2025-68480; can remove by updating environs once available
marshmallow = "3.26.2"

[tool.poetry.group.dev.dependencies]
ruff = "^0.11.0"
pytest = "^9.0.0"
pytest-cov = "^6.0.0"
pre-commit = "^4.2.0"
mypy = "^1.15.0"
pytest-env = "^1.1.5"
boto3-stubs = "^1.37.30"
botocore-stubs = "^1.37.29"

[[tool.poetry.source]]
name = "theorchard"
url = "https://pypi.theorchard.io/pypi/"
priority = "supplemental"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 88

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

[tool.ruff.lint.per-file-ignores]
"backfill/connectors/ows_pdp/models/*" = [
    "C402", "C405",
    "D200", "D102", "D107", "D400", "D401", "D415",
    "UP007", "UP006", "UP035"
]

[tool.ruff.lint.isort]
combine-as-imports = true
forced-separate = ["tests"]

[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.mypy]
python_version = "3.12"
strict = true
pretty = true
color_output = true
show_error_codes = true

[[tool.mypy.overrides]]
# The following openapi generated files have mypy errors
module = [
    "backfill.connectors.ows_pdp.models.validation_error_loc_inner",
]
disable_error_code = "no-untyped-def, no-any-return"

[tool.pytest.ini_options]
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"

[tool.pytest_env]
LOG_LEVEL = "DEBUG"

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