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

[project]
name = "cmvk"
version = "0.3.0"
description = "Mathematical and adversarial verification library for calculating drift/hallucination scores between outputs"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.11"
authors = [
    { name = "Imran Siddique", email = "imran.siddique@example.com" }
]
keywords = [
    "verification",
    "drift-detection",
    "hallucination",
    "adversarial",
    "ai-safety",
    "mathematical",
    "scoring",
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Software Development :: Quality Assurance",
    "Topic :: Software Development :: Testing",
    "Typing :: Typed",
]

# Layer 1: The Primitive - Only scipy/numpy allowed
dependencies = [
    "numpy>=1.24.0",
]

[project.optional-dependencies]
# Optional scipy for enhanced statistical functions
scipy = [
    "scipy>=1.11.0",
]
dev = [
    "pytest>=8.3.0",
    "pytest-cov>=6.0.0",
    "black>=24.10.0",
    "mypy>=1.14.0",
    "ruff>=0.9.0",
]
all = [
    "cmvk[scipy,dev]",
]

[project.urls]
Homepage = "https://github.com/imran-siddique/cmvk"
Documentation = "https://github.com/imran-siddique/cmvk#readme"
Repository = "https://github.com/imran-siddique/cmvk.git"
Issues = "https://github.com/imran-siddique/cmvk/issues"
Changelog = "https://github.com/imran-siddique/cmvk/blob/main/CHANGELOG.md"

[project.scripts]
# CLI entry point for reproduction (research users)
cmvk-reproduce = "cross_model_verification_kernel.cli:app"

[tool.hatch.build.targets.sdist]
include = [
    "/src/cmvk",
]
exclude = [
    "/.github",
    "/notebooks",
    "/logs",
    "/experiments",
    "/paper",
    "/docs",
    "/examples",
    "/config",
    "*.pyc",
    "__pycache__",
]

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

[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
    "-ra",
    "-q",
    "--strict-markers",
    "--cov=src/cmvk",
    "--cov-report=term-missing",
    "--cov-report=html:coverage_html",
    "--ignore=tests/unit",
    "--ignore=tests/integration",
]
testpaths = ["tests"]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
]

[tool.coverage.run]
source = ["src/cmvk"]
branch = true
omit = [
    "*/tests/*",
    "*/__pycache__/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
]

[tool.black]
line-length = 100
target-version = ["py311", "py312"]
include = '\.pyi?$'
exclude = '''
/(
    \.eggs
  | \.git
  | \.hatch
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
)/
'''

[tool.isort]
profile = "black"
line_length = 100
skip_gitignore = true
known_first_party = ["cmvk"]

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

[tool.ruff.lint]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # Pyflakes
    "I",   # isort
    "B",   # flake8-bugbear
    "C4",  # flake8-comprehensions
    "UP",  # pyupgrade
    "ARG", # flake8-unused-arguments
    "SIM", # flake8-simplify
]
ignore = [
    "E501",   # line too long (handled by black)
    "B008",   # do not perform function calls in argument defaults
    "B904",   # raise-without-from-inside-except
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ARG001"]

[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
ignore_missing_imports = true
exclude = [
    "tests/",
    "experiments/",
    "notebooks/",
]
