[project]
name = "abacus-common-logic"
version = "5.16.0"
description = "Shareable static data for abacus applications."
authors = [
    {name = "The Orchard", email = "webdev@theorchard.com"}
]
readme = "README.md"
requires-python = ">=3.13"

dependencies = [
    "cryptography~=49.0",
    "flask>=2.3,<4",
    "flask-marshmallow~=1.2",
    "flask-SQLAlchemy~=3.0",
    "httpx~=0.27",
    "markupSafe~=2.1",
    "marshmallow<4",
    "marshmallow-sqlalchemy~=1.0",
    "owsresponse>=3.0.1,<3.1",
    "psutil~=7.2",
    "python-dateutil~=2.9",
    "pythonfeatures~=5.0",
    "sqlalchemy>=1.4,<3",
    "snowflake-connector-etl~=1.2",
]

[project.urls]
Repository = "https://github.com/theorchard/python-abacus-common-logic"

[dependency-groups]
dev = [
    "bumpversion==0.6",
    "email-validator~=2.2",
    "factory-boy~=3.3",
    "httpx~=0.27",
    "owsclient~=0.7",
    "pytest>=9.0.3",
    "pytest-cov~=6.2",
    "ruff~=0.14",
]
integration = [
    {include-group = "dev"},
    "marshmallow<4",
]

[build-system]
requires = ["setuptools", "abacus_common_logic"]
build-backend = "setuptools.build_meta"

# --- Pytest ---

[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = ["env/*"]

# --- Ruff ---

[tool.ruff]
indent-width = 4
line-length = 88
exclude = ["tests/integration/env/*"]

[tool.ruff.lint]
select = [
  # builtins
  "A",
  # isort
  "I",
  # pycodestyle
  "E",
  "W",
  # pydocstyle
  "D",
  # quotes
  "Q"
]

ignore = [
  # builtin-module-shadowing (from flake8)
  "A005",
  # missing-docstring-in-public-class
  "D101",
  # incorrect-blank-line-before-class, conflicts with D211
  "D203",
  # multi-line-summary-second-line, conflicts with D212
  "D213",
  # first-line-should-end-with-a-period (from flake8)
  "D400",
  # missing-blank-line-after-last-section (from flake8)
  "D413",
  # line-too-long, the formatter makes a best-effort at wrapping lines
  "E501",
]

[tool.ruff.format]
quote-style = "single"

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

[tool.ruff.lint.isort]
combine-as-imports = true
forced-separate = ["tests"]
known-first-party = ["abacus_common_logic", "tests"]
section-order = [
    "future",
    "standard-library",
    "third-party",
    "first-party",
    "local-folder"
]

# --- uv ---

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