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

[project]
name = "django-tree-queries"
description = "Tree queries with explicit opt-in, without configurability"
readme = "README.rst"
license = { text = "BSD-3-Clause" }
authors = [
  { name = "Matthias Kestenholz", email = "mk@feinheit.ch" },
]
requires-python = ">=3.8"
classifiers = [
  "Environment :: Web Environment",
  "Framework :: Django",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: BSD License",
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.8",
  "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",
  "Programming Language :: Python :: 3.14",
  "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
  "Topic :: Software Development",
]
dynamic = [
  "version",
]
dependencies = [
]
optional-dependencies.admin = [
  "django-js-asset",
]
optional-dependencies.tests = [
  "coverage",
  "django-js-asset",
  "pytest",
  "pytest-cov",
  "pytest-django",
]
urls.Homepage = "https://github.com/matthiask/django-tree-queries/"

[tool.hatch.build]
include = [
  "tree_queries/",
]

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

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

preview = true
fix = true
show-fixes = true
lint.extend-select = [
  # flake8-builtins
  "A",
  # flake8-bugbear
  "B",
  # flake8-comprehensions
  "C4",
  # mmcabe
  "C90",
  # flake8-django
  "DJ",
  "E",
  # pyflakes, pycodestyle
  "F",
  # flake8-boolean-trap
  "FBT",
  # flake8-logging-format
  "G",
  # isort
  "I",
  # flake8-gettext
  "INT",
  # pep8-naming
  "N",
  # pygrep-hooks
  "PGH",
  # flake8-pie
  "PIE",
  # pylint
  "PLC",
  "PLE",
  "PLW",
  # flake8-pytest-style
  "PT",
  # unused noqa
  "RUF100",
  # flake8-simplify
  "SIM",
  # pyupgrade
  "UP",
  "W",
  # flake8-2020
  "YTT",
]
lint.extend-ignore = [
  # Allow zip() without strict=
  "B905",
  # No line length errors
  "E501",
]
lint.per-file-ignores."*/migrat*/*" = [
  # Allow using PascalCase model names in migrations
  "N806",
  # Ignore the fact that migration files are invalid module names
  "N999",
]
lint.isort.combine-as-imports = true
lint.isort.lines-after-imports = 2
lint.mccabe.max-complexity = 15

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "testapp.settings"
python_files = [ "tests.py", "test_*.py", "*_tests.py" ]
testpaths = [ "tests" ]
addopts = "-v --tb=short --strict-markers --ds=testapp.settings --cov=tree_queries --cov-report=term-missing"
markers = [
  "django_db: mark test to use django database",
  "postgresql: mark test as PostgreSQL-specific",
  "mysql: mark test as MySQL-specific",
]
