[project]
name = "formkit-ninja"
version = "0.8.1"
description = "A Django-Ninja backend to specify FormKit schemas"
readme = "README.md"
requires-python = ">=3.10,<3.14"
authors = [
    { name = "Josh Brooks", email = "josh@catalpa.io" }
]
dependencies = [
    "django-ninja<1",
    "Django==4.*",
    "pydantic<2",
    "django-pgtrigger==4.*",
    "rich",
    "django-pghistory==3.*",
]

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

[dependency-groups]
dev = [
    "pytest",
    "pytest-django",
    "ruff",
    "django-extensions",
    "sqlparse",
    "mypy",
    "pre-commit",
    "playwright>=1.39.0",
    "pytest-playwright",
    "mkdocs-material",
    "mkdocstrings[python]",
    "pytest-cov>=4.1.0",
    "psycopg2-binary>=2.9.7",
    "factory-boy>=3.3.0",
    "django-stubs>=4.2.6",
]

[tool.hatch.build.targets.wheel]
packages = ["formkit_ninja"]

[tool.ruff]
line-length = 119
target-version = "py310"

[tool.ruff.lint]
select = [
    "E",  # pycodestyle errors
    "F",  # pyflakes
    "I",  # isort
]
ignore = []

[tool.ruff.lint.per-file-ignores]
"**/migrations/*.py" = ["E501"]  # Ignore line length in migrations

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

[tool.mypy]
python_version = "3.10"
plugins = [
    'mypy_django_plugin.main'
    ]

[tool.django-stubs]
django_settings_module = "testproject.settings"


[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "testproject.settings"
addopts = "--reuse-db --cov=formkit_ninja --cov-report=term-missing --cov-report=html --cov-branch"

# Playwright: uncomment for "headed", interactive tests
#addopts = "--reuse-db --cov=formkit_ninja --cov-report=term-missing --cov-report=html --cov-branch --headed"

[tool.coverage.run]
source = ["formkit_ninja"]
omit = [
    "*/migrations/*",
    "*/tests/*",
    "*/__pycache__/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
]