[build-system]
requires = ["flit-core"]
build-backend = "flit_core.buildapi"

[project]
name = "pyproject-metadata"
dynamic = ["version"]
description = "PEP 621 metadata parsing"
readme = "README.md"
requires-python = ">=3.7"
authors = [
    { name = "Filipe Laíns", email = "lains@riseup.net" },
]
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.7",
    "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",
]
dependencies = [
    "packaging>=19.0",
    "typing_extensions; python_version<'3.8'",
]

[project.optional-dependencies]
docs = [
    "furo>=2023.9.10",
    "sphinx-autodoc-typehints>=1.10.0",
    "sphinx>=7.0",
    "sphinx-autodoc-typehints",
    "myst-parser",
]
test = [
    "pytest-cov[toml]>=2",
    "pytest>=6.2.4",
    'tomli>=1.0.0;python_version<"3.11"',
    'exceptiongroup;python_version<"3.11"',  # Optional
]

[project.urls]
changelog = "https://pep621.readthedocs.io/en/stable/changelog.html"
homepage = "https://github.com/pypa/pyproject-metadata"

[tool.flit.sdist]
include = ["LICENSE", "tests/**", "docs/**", ".gitignore"]

[tool.uv]
dev-dependencies = ["pyproject-metadata[test]"]
environments = [
  "python_version >= '3.10'",
]


[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
log_cli_level = "info"
testpaths = ["tests"]


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


[tool.ruff.lint]
extend-select = [
  "C90",         # mccabe
  "B",           # flake8-bugbear
  "I",           # isort
  "ARG",         # flake8-unused-arguments
  "C4",          # flake8-comprehensions
  "ICN",         # flake8-import-conventions
  "ISC",         # flake8-implicit-str-concat
  "EM",          # flake8-errmsg
  "G",           # flake8-logging-format
  "PGH",         # pygrep-hooks
  "PIE",         # flake8-pie
  "PL",          # pylint
  "PT",          # flake8-pytest-style
  "RET",         # flake8-return
  "RUF",         # Ruff-specific
  "SIM",         # flake8-simplify
  "T20",         # flake8-print
  "UP",          # pyupgrade
  "YTT",         # flake8-2020
  "EXE",         # flake8-executable
  "NPY",         # NumPy specific rules
  "PD",          # pandas-vet
]
ignore = [
  "ISC001",  # conflicts with formatter
  "PLR09",   # Design related (too many X)
  "PLR2004", # Magic value in comparison
]

[tool.ruff.format]
docstring-code-format = true

[tool.coverage]
html.show_contexts = true
report.exclude_also = [
    "if typing.TYPE_CHECKING:",
]

[tool.repo-review]
ignore = ["PC140"]
