[project]
name = "jamb"
dynamic = ["version"]
description = "IEC 62304 requirements traceability for pytest"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
    { name = "Andrew Van", email = "vanandrew77@gmail.com" }
]
requires-python = ">=3.10"
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
]
dependencies = [
    "pyyaml>=6.0",
    "pytest>=7.0",
    "click>=8.0",
    "jinja2>=3.0",
    "openpyxl>=3.0",
    "python-docx>=1.0",
    "tomlkit>=0.12",
    "tomli>=2.0; python_version < '3.11'",
]

[project.scripts]
jamb = "jamb.cli.commands:cli"

[project.entry-points.pytest11]
jamb = "jamb.pytest_plugin.plugin"


[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/jamb/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["src/jamb"]

[tool.jamb]
test_documents = ["SRS", "SYS"]
trace_to_ignore = ["PRJ"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--cov=src/jamb"
filterwarnings = [
    "ignore:Could not load requirements:UserWarning:jamb.pytest_plugin.collector",
]

[tool.coverage.run]
source = ["src/jamb"]
omit = ["src/jamb/__init__.py", "src/jamb/*/__init__.py"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "if TYPE_CHECKING:",
    "if __name__ == .__main__.:",
    "@abstractmethod",
    "raise NotImplementedError",
    "^from .* import",
    "^import ",
    "@dataclass",
    "@pytest.fixture",
    "@pytest.hookimpl",
]
exclude_also = [
    "def __repr__",
    "class .*\\(Protocol\\):",
]

[tool.mypy]
strict = true

[tool.ruff]
target-version = "py310"
line-length = 88
src = ["src"]
extend-exclude = ["src/jamb/_version.py"]

[tool.ruff.lint]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort
    "UP",  # pyupgrade
    "B",   # flake8-bugbear
]

[dependency-groups]
dev = [
    "pytest-cov>=7.0.0",
    "mypy",
    "ruff>=0.9.4",
    "pre-commit",
    "types-PyYAML",
    "types-openpyxl",
]
docs = [
    "sphinx>=7.0",
    "myst-parser>=3.0",
    "pydata-sphinx-theme>=0.15",
    "sphinx-copybutton>=0.5",
    "sphinx-autobuild>=2024.0",
    "sphinxcontrib-mermaid>=0.9",
    "sphinx-autodoc-typehints>=2.0",
]
