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

[project]
name = "django-debug-toolbar"
description = "A configurable set of panels that display various debug information about the current request/response."
readme = "README.rst"
license = { text = "BSD-3-Clause" }
authors = [
  { name = "Rob Hudson" },
]
requires-python = ">=3.9"
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Environment :: Web Environment",
  "Framework :: Django",
  "Framework :: Django :: 4.2",
  "Framework :: Django :: 5.0",
  "Framework :: Django :: 5.1",
  "Framework :: Django :: 5.2",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: BSD License",
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = [
  "version",
]
dependencies = [
  "django>=4.2.9",
  "sqlparse>=0.2",
]

urls.Changelog = "https://django-debug-toolbar.readthedocs.io/en/latest/changes.html"
urls.Documentation = "https://django-debug-toolbar.readthedocs.io/"
urls.Download = "https://pypi.org/project/django-debug-toolbar/"
urls.Homepage = "https://github.com/django-commons/django-debug-toolbar"
urls.Issues = "https://github.com/django-commons/django-debug-toolbar/issues"
urls.Source = "https://github.com/django-commons/django-debug-toolbar"

[tool.hatch.build.targets.wheel]
packages = [
  "debug_toolbar",
]

[tool.hatch.version]
path = "debug_toolbar/__init__.py"

[tool.ruff]
target-version = "py39"

fix = true
show-fixes = true
lint.extend-select = [
  "ASYNC",  # flake8-async
  "B",      # flake8-bugbear
  "C4",     # flake8-comprehensions
  "C90",    # McCabe cyclomatic complexity
  "DJ",     # flake8-django
  "E",      # pycodestyle errors
  "F",      # Pyflakes
  "FBT",    # flake8-boolean-trap
  "I",      # isort
  "INT",    # flake8-gettext
  "PGH",    # pygrep-hooks
  "PIE",    # flake8-pie
  "RUF100", # Unused noqa directive
  "SLOT",   # flake8-slots
  "UP",     # pyupgrade
  "W",      # pycodestyle warnings
]
lint.extend-ignore = [
  "B905",  # Allow zip() without strict=
  "E501",  # Ignore line length violations
  "UP031", # It's not always wrong to use percent-formatting
]
lint.per-file-ignores."*/migrat*/*" = [
  "N806", # Allow using PascalCase model names in migrations
  "N999", # Ignore the fact that migration files are invalid module names
]
lint.isort.combine-as-imports = true
lint.mccabe.max-complexity = 16

[tool.coverage.html]
skip_covered = true
skip_empty = true

[tool.coverage.run]
branch = true
parallel = true
source = [
  "debug_toolbar",
]

[tool.coverage.paths]
source = [
  "src",
  ".tox/*/site-packages",
]

[tool.coverage.report]
# Update coverage badge link in README.rst when fail_under changes
fail_under = 94
show_missing = true
