[project]
name = "feedparser-sgmllib"
description = "sgmllib from Python 2.7. For feedparser use only."
version = "2.1.0"
maintainers = [
    { name = "Kurt McKee", email = "contactme@kurtmckee.org" },
]
readme = "README.rst"
requires-python = ">=3.10"
license = "PSF-2.0"

[project.urls]
Source = "https://github.com/python-syndication/feedparser-sgmllib"
Documentation = "https://feedparser-sgmllib.readthedocs.io"
Changelog = "https://feedparser-sgmllib.readthedocs.io/en/latest/changelog/"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"


# coverage
# --------

[tool.coverage.run]
relative_files = true
parallel = true
branch = true
source = [
    "feedparser_sgmllib",
    "tests",
]

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

[tool.coverage.report]
skip_covered = true
fail_under = 75


# flake8
# ------

[tool.flake8]
max-line-length = 80
extend-select = ["B950"]
extend-ignore = ["E203", "E501", "E701"]


# isort
# -----

[tool.isort]
profile = "black"
force_single_line = true


# mypy
# ----

[tool.mypy]
packages = "feedparser_sgmllib"
strict = true
sqlite_cache = true
enable_error_code = [
    "ignore-without-code",
    "redundant-expr",
    "truthy-bool",
]
warn_unreachable = true


# poetry
# ------

[tool.poetry]
include = [
    { path = ".gitignore", format = "sdist" },
    { path = "CHANGELOG.rst", format = "sdist" },
    { path = "docs/", format = "sdist" },
    { path = "requirements/", format = "sdist" },
    { path = "tests/", format = "sdist" },
    { path = "tox.ini", format = "sdist" },
]


# pytest
# ------

[tool.pytest]
addopts = [
    "--color=yes",
]
filterwarnings = [
    "error",
]
strict = true


# scriv
# -----

[tool.scriv]
version = "literal: pyproject.toml: project.version"
categories = [
    "Breaking changes",
    "Python support",
    "Added",
    "Fixed",
    "Removed",
    "Changed",
    "Deprecated",
    "Security",
    "Documentation",
    "Development",
]
entry_title_template = "{{ version }} - {{ date.strftime('%Y-%m-%d') }}"
format = "rst"
fragment_directory = "changelog.d"
insert_marker = "scriv-insert-here"
main_branches = ["main", "releases"]
new_fragment_template = "file: fragment-template.rst.jinja2"
