[tool.poetry]
name = "python-pdp-sdk"
version = "6.6.0"
description = "Python sdk client for Policy Decision Point (ows-pdp)."
authors = ["Sony Music PDE <webdev@theorchard.com>"]
readme = "README.md"

[tool.poetry.dependencies]
owsclient = { git = "ssh://git@github.com/theorchard/python-owsclient#v0.13.1", optional = true}
datadog = { version = ">=0.49", optional = true }
boto3 = { version = ">=1.43.16", optional = true }
python = "^3.11"
pydantic = ">=2"

[tool.poetry.group.dev.dependencies]
ruff = "^0.4.8"
mypy = "^1.10.0"
pytest = "^9.0.3"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
bump2version = "^1.0.1"
idna = "^3.8"
certifi = "^2024.8.30"
datadog = ">=0.49"
boto3 = "^1.43.16"
boto3-stubs = {version = "^1.43.16", extras = ["secretsmanager"]}

[tool.poetry.extras]
owsclient = ["owsclient"]
migration = ["datadog", "boto3"]

[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", "D"]
ignore = ["E501", "B008", "B009", "D203", "D213", "D407"]

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

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

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

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

[[tool.mypy.overrides]]
# datadog has no type stubs
module = ["datadog", "datadog.*"]
ignore_missing_imports = true

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

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