{% for header in license_headers %}
# {{ header }}
{% endfor %}
{% set HATCHLING = config.build_backend.value == "hatchling" %}
{% set FLIT_CORE = config.build_backend.value == "flit_core" %}
{% set NAME = config.name | escape %}

[build-system]
{% if FLIT_CORE %}
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
{% elif HATCHLING %}
requires = ["hatchling"]
build-backend = "hatchling.build"
{% endif %}

[project]
name = "{{ config.name }}"
description = "{{ config.description }}"
dynamic = ["version"]
authors = [{ name = "Maxwell G", email = "maxwell@gtmx.me" }]
readme = "README.md"
{% if FLIT_CORE %}
license = { text = "{{ config.license_id }}" }
{% elif HATCHLING %}
license = "{{ config.license_id }}"
license-files.globs = ["LICENSES/*.txt"]
{% endif %}
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "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",
    "Development Status :: 3 - Alpha",
    "Typing :: Typed",
]
dependencies = [
]
requires-python = ">=3.8"

[project.optional-dependencies]
codeqa = [
    "ruff>=0.2.0",
    "reuse",
]
formatters = [
    "black",
    "isort",
]
typing = [
    "mypy",
    "pytest",
    "typing_extensions",
    # For checking noxfile.py
    "nox",
]
test = [
    "pytest",
]
dev = [
    "{{ config.name }}[codeqa]",
    "{{ config.name }}[formatters]",
    "{{ config.name }}[test]",
    "{{ config.name }}[typing]",
    "nox",
]

[project.urls]
Homepage = "https://sr.ht/~gotmax23/{{ config.name }}"
Source = "https://git.sr.ht/~gotmax23/{{ config.name }}"
"Mailing List" = "https://lists.sr.ht/~gotmax23/{{ config.name }}"
Changelog = "https://git.sr.ht/~gotmax23/{{ config.name }}/tree/main/item/NEWS.md"
{% if HATCHLING %}


[tool.hatch.version]
path = "src/{{ config.name.replace("-", "_") }}/__init__.py"
{% endif %}


[tool.pytest.ini_options]
addopts = [
    "--import-mode=importlib",
]


[tool.isort]
profile = "black"
add_imports = [
    'from __future__ import annotations',
]


[tool.mypy]
check_untyped_defs = true


[tool.coverage.run]
source = [
    "{{ config.name.replace("-", "_") }}",
]

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

[tool.coverage.report]
# https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
# These should use single quotes in TOML, as they're regular expressions.
exclude_lines = [
    'pragma: no cover',
    'raise NotImplementedError',
    'if __name__ == .__main__.:',
    'if TYPE_CHECKING:',
    'if t\.TYPE_CHECKING:',
    '@(abc\.)?abstractmethod',
    '@overload',
]

{#
# vim: ft=toml.jinja2:
#}
