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

[project]
name = "elspais"
version = "0.54.0"
description = "Requirements validation and traceability tools - L-Space connects all libraries"
readme = "README.md"
requires-python = ">=3.12"
authors = [{ name = "Anspar", email = "dev@anspar.io" }]
keywords = ["requirements", "traceability", "validation", "documentation", "specifications"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: GNU Affero General Public License v3",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Software Development :: Quality Assurance",
    "Topic :: Software Development :: Documentation",
    "Typing :: Typed",
]
# Minimal dependency: tomlkit for correct TOML parsing and round-trip editing
dependencies = ["tomlkit>=0.12"]

[project.optional-dependencies]
dev = [
    "pytest>=7.0",
    "pytest-cov>=4.0",
    "black>=23.0",
    "ruff>=0.1.0",
    "mypy>=1.0",
]
binary = ["pyinstaller>=6.0"]
mcp = ["mcp>=1.0"]
# Shell tab-completion support (bash, zsh, fish, tcsh)
completion = ["argcomplete>=3.0"]
# REQ-int-d00002-B: HTML generation requires jinja2
trace-view = ["jinja2>=3.0", "pygments>=2.0"]
# REQ-int-d00002-C: Review server requires flask
trace-review = [
    "jinja2>=3.0",
    "pygments>=2.0",
    "flask>=2.0",
    "flask-cors>=4.0",
]
# All optional features
all = [
    "jinja2>=3.0",
    "pygments>=2.0",
    "flask>=2.0",
    "flask-cors>=4.0",
    "mcp>=1.0",
    "argcomplete>=3.0",
]

[project.scripts]
elspais = "elspais.cli:main"

[project.urls]
Homepage = "https://github.com/anspar/elspais"
Documentation = "https://github.com/anspar/elspais#readme"
Repository = "https://github.com/anspar/elspais"
Issues = "https://github.com/anspar/elspais/issues"
Changelog = "https://github.com/anspar/elspais/blob/main/CHANGELOG.md"

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

# Include CLI documentation files in the wheel
[tool.hatch.build.targets.wheel.force-include]
"docs/cli" = "elspais/docs/cli"

# REQ-int-d00001-D: Bundle Jinja2 templates for trace-view
[tool.hatch.build.targets.wheel.shared-data]
# Templates are included automatically since they're in the package directory

[tool.hatch.build.targets.sdist]
include = [
    "/src",
    "/tests",
    "/docs",
    "/README.md",
    "/LICENSE",
    "/CHANGELOG.md",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short --ignore=tests/_obsolete"

[tool.black]
line-length = 100
target-version = ["py312", "py313"]

[tool.ruff]
line-length = 100
target-version = "py312"

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

[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_ignores = true
disallow_untyped_defs = true
