[project]
name = "ows-carveouts-python"
version = "0.1.0"
description = "Python microservice for ows-carveouts - handles carveout CRUD"
authors = [
    {name = "Sony Music PDE"},
]
requires-python = ">=3.13.0,<4.0"
dependencies = [
    "ddtrace (>=3.9,<4.0)",
    "Flask (>=3.1,<4.0)",
    "marshmallow (>=4.1,<5.0)",
    "owslogger (>=4.3,<5.0)",
    "owsrequest (>=2.6,<3.0)",
    "owsresponse (>=3.0,<4.0)",
    "pydantic (>=2.11,<3.0)",
    "PyMySQL (>=1.1,<2.0)",
    "secrets_manager (>=1.4,<5.0)",
    "sentry-sdk[flask] (>=2.27,<3.0)",
    "sqlalchemy (>=2.0,<3.0)",
    "uWSGI (>=2.0,<2.1)",
]

[project.optional-dependencies]
dev = [
    "mypy (>=1.9,<2.0)",
    "ruff (>=0.6,<1.0)",
    "pytest (>=8.3,<10.0)",
    "pytest-cov (>=6.1,<7.0)",
    "pytest-mock (>=3.13.0,<4.0.0)",
    "types-requests (>=2.31.0.20240311,<3.0.0)",
    "types-uWSGI (>=2.0.0.20240516,<2.0.1)",
]

[tool.poetry]
package-mode = false

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

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

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

[tool.pytest.ini_options]
markers = [
    "smoke: fast read-only checks that the service is up and responding",
    "read: read-only endpoint tests (safe against shared environments)",
    "negative: invalid-input / error-path tests (no data mutation)",
    "write: tests that create/update/delete data (require throwaway data)",
]

[tool.ruff]
line-length = 88

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

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

[tool.mypy]
strict = true
show_error_codes = true
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = [
    "secrets_manager.*",
    "owslogger.*",
    "owsrequest.*",
    "owsresponse.*",
]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = [
    "carveouts.handlers",
]
disable_error_code = [
    "no-any-return"
]
