[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "pypaperless"
version = "0.0.0"
license = {text = "MIT"}
description = "Little api client for paperless(-ngx)."
readme = "README.md"
authors = [
  {name = "Tobias Schulz", email =  "public.dev@tbsch.de"}
]
keywords = ["library", "async", "api-client", "python3", "paperless-ngx"]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Framework :: AsyncIO",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Software Development :: Libraries :: Python Modules"
]
requires-python = "~=3.13"
dependencies = [
    "aiohttp>=3.12.13",
    "yarl>=1.20.1",
]

[dependency-groups]
dev = [
    "aioresponses>=0.7.8",
    "codespell>=2.4.1",
    "covdefaults>=2.3.0",
    "coverage>=7.9.1",
    "mypy>=1.16.1",
    "pre-commit>=4.2.0",
    "pre-commit-hooks>=5.0.0",
    "pylint>=3.3.7",
    "pytest>=8.4.1",
    "pytest-aiohttp>=1.1.0",
    "pytest-asyncio>=1.0.0",
    "pytest-cov>=6.2.1",
    "ruff>=0.12.0",
    "yamllint>=1.37.1",
]

[project.urls]
"Homepage" = "https://github.com/tb1337/paperless-api"
"Source Code" = "https://github.com/tb1337/paperless-api"
"Bug Reports" = "https://github.com/tb1337/paperless-api/issues"
"Coverage" = "https://codecov.io/gh/tb1337/paperless-api"

[tool.coverage.run]
plugins = ["covdefaults"]
source = ["pypaperless"]

[tool.coverage.report]
fail_under = 95
omit = [
    "pypaperless/models/utils/__init__.py"
]
show_missing = true

[tool.mypy]
platform = "linux"
python_version = "3.13"

follow_imports = "normal"
ignore_missing_imports = true

check_untyped_defs = true
disallow_any_generics = false
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
show_error_codes = true
warn_incomplete_stub = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.pylint.MASTER]
ignore = [
    "tests/",
]

[tool.pylint.BASIC]
good-names = [
  "_",
  "ex",
  "fp",
  "i",
  "id",
  "j",
  "k",
  "on",
  "Run",
  "T",
  "wv",
]

[tool.pylint."MESSAGES CONTROL"]
disable = [
    "duplicate-code",
    "no-name-in-module", # currently throws
    "too-few-public-methods",
    "too-many-ancestors",
    "too-many-arguments",
    "too-many-instance-attributes",
    "too-many-public-methods",
]

[tool.pylint.SIMILARITIES]
ignore-imports = true

[tool.pylint.FORMAT]
max-line-length = 100

[tool.pylint.DESIGN]
max-attributes = 20

[tool.pytest.ini_options]
addopts = "--cov --cov-report=term --cov-report=xml"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"

[tool.ruff]
line-length = 100
target-version = "py313"

[tool.ruff.lint]
ignore = [
  "ANN401", # Opinioated warning on disallowing dynamically typed expressions
  "D203", # Conflicts with other rules
  "D213", # Conflicts with other rules
  "D417", # False positives in some occasions
  "PLR2004", # Just annoying, not really useful
  "RUF012", # Just annoying

  # Conflicts with the Ruff formatter
  "COM812",
  "ISC001",
]
select = ["ALL"]

[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false

[tool.ruff.lint.isort]
known-first-party = ["pypaperless"]

[tool.ruff.lint.mccabe]
max-complexity = 25
