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

[project]
name = "{{ cookiecutter.project_name }}"
version = "0.1.0"
description = "{{ cookiecutter.description }}"
license = "MIT"
requires-python = ">={{ cookiecutter.python_version }}"
authors = [{ name = "slaid098" }]
keywords = []
classifiers = [
    "Development Status :: 4 - Beta",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3.13",
]

dependencies = [
    "fastapi",
    "uvicorn[standard]",
    "pydantic-settings",
    "loguru",
{% if cookiecutter.use_db == "yes" %}
    "tortoise-orm",
    "asyncpg",
{% endif %}
{% if cookiecutter.use_auth == "yes" %}
    "passlib[bcrypt]",
    "pyjwt",
{% endif %}
]

[project.optional-dependencies]
dev = [
    "pytest>=8.0",
    "pytest-cov>=5.0",
    "pytest-asyncio>=0.23",
    "pytest-timeout>=2.2",
    "httpx",
    "mypy>=1.10",
    "ruff>=0.5",
    "pre-commit>=3.7",
]

[project.urls]
Homepage = "https://github.com/slaid098/{{ cookiecutter.project_name }}"
Repository = "https://github.com/slaid098/{{ cookiecutter.project_name }}"
Issues = "https://github.com/slaid098/{{ cookiecutter.project_name }}/issues"

[tool.hatch.build.targets.wheel]
packages = ["src/{{cookiecutter.project_name}}"]

# ── Ruff ──────────────────────────────────────────────────────────────────

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

[tool.ruff.lint]
select = [
    "E", "W",
    "F",
    "I",
    "B",
    "UP",
    "SIM",
    "C90",
    "PL",
    "RUF",
    "S",
    "TRY",
    "LOG",
]
ignore = [
    "S101",
    "S311",
    "RUF001",
    "RUF002",
    "RUF003",
    "TRY003",
    "PLR2004",
    "S106",
]

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

[tool.ruff.lint.pylint]
max-args = 5
max-branches = 12
max-returns = 5
max-statements = 50

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "PLR2004", "S106", "S603", "S607", "PLR0913"]

# ── mypy ──────────────────────────────────────────────────────────────────

[tool.mypy]
python_version = "{{ cookiecutter.python_version }}"
strict = true
explicit_package_bases = true
warn_return_any = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true

# ── pytest ────────────────────────────────────────────────────────────────

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = "--cov=src --cov-report=term-missing --timeout=120"

# ── coverage ──────────────────────────────────────────────────────────────

[tool.coverage.run]
source = ["src"]
branch = true

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
]

# ── project-status ─────────────────────────────────────────────────────────

[tool.project-status]
route_line_limit = 50
min_test_count = 1
require_branch_protection = false