[project]
name = "ows-notifications"
version = "1.0.0"
description = "Notification service for OWS platform."
readme = "README.md"
requires-python = "~=3.13.0"
dependencies = [
    "boto3==1.42.55",
    "cffi==2.0.0",
    "connector-neo4j==1.0.0",
    "ddtrace>=4.0,<=5.0",
    "fakeredis==2.33.0",
    "flask==3.1.3",
    "flask-marshmallow==1.3.0",
    "getstream-connector~=3.0.0",
    "gql[requests]==4.0.0",
    "marshmallow==4.2.0",
    "marshmallow-dataclass==8.7.1",
    "mmh3cffi==0.2.1",
    "neo4j>=5.20.0,<=6.0.0",
    "owsclient==0.10.2",
    "owslogger==4.3.1",
    "owsrequest==2.10.1",
    "pycparser==2.23",
    "python-dotenv~=1.2.2",
    "pythonfeatures==5.0.0",
    "redis==7.1.1",
    "secrets-manager==1.4.6",
    "segment-analytics-python==2.3.5",
    "sentry-sdk[flask]==2.48.0",
    "slack-sdk==3.39.0",
    "stringcase==1.2.0",
]

[dependency-groups]
dev = [
    "callee==0.3.1",
    "pre-commit~=4.5.1",
    "pytest~=9.0.2",
    "pytest-cov~=7.0.0",
    "pytest-env~=1.2.0",
    "pytest-mock~=3.15.1",
    "ruff==0.15.7",
    "ty==0.0.25",
]

prod = [
    "uwsgi==2.0.31",
]

[project.urls]
Repository = "https://github.com/theorchard/ows-notifications"

# --- Coverage ---

[tool.coverage.run]
omit = [
  "tests/*",
]

# --- ty (type checking) ---

[tool.ty.src]
exclude = [
    "tests",
    ".venv",
]

# --- Pytest ---

[tool.pytest.ini_options]
xfail_strict = true
pythonpath = ["."]
testpaths = ["tests"]
env = [
    "DD_TRACE_ENABLED=False",
    "SPLITIO_API_KEY=",
    "AWS_DEFAULT_REGION=us-east-1",
    "SQS_URI=https://sqs.us-east-1.amazonaws.com/437795906767/qa-notifications-test",
    "Environment=test",
]

# --- Ruff ---

[tool.ruff]
line-length = 100
indent-width = 4
include = [
    "notifications/**/*.py",
    "tests/**/*.py",
    "scripts/**/*.py",
    "application.py",
    "render_template.py",
]

[tool.ruff.lint]
select = [
    "E",   # pycodestyle
    "W",   # pycodestyle
    "D",   # pydocestyle
    "F",   # Pyflakes
    "I",   # Isort
    "PL",  # Pylint,
    "T20", # flake-print
    "G",   # flake8-logging-format
    "RUF", # ruff
    "A",   # flake8-builtins
    "B",   # flake8-bugbear
    "G",   # flake8-logging-format
    "S",   # flake8-bandit
    "ANN", # flake8-annotations
    "Q",   # flake8-quotes
]
ignore = [
    "D203",     # incorrect-blank-line-before-class, conflicts with D211
    "D213",     # multi-line-summary-second-line, conflicts with D211
    "G004",     # logging-f-string
    "S104",     # Possible binding to all interfaces
]
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

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

[tool.ruff.lint.per-file-ignores]
"tests/*" = [
    "S",
    "ANN",
    "PLR",
]
"scripts/*" = [
    "S",
    "ANN",
    "PLR",
    "D",
    "T201",
]
"render_template.py" = [
    "D",
]

[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"

[tool.ruff.format]
quote-style = "single"
indent-style = "space"
line-ending = "auto"

# --- uv ---

[tool.uv]
override-dependencies = [
    # waiting for a new version of segment-analytics including fixed version of 'pyjwt'
    # https://github.com/segmentio/analytics-python/pull/527
    "pyjwt[crypto]~=2.12.0"
]

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