[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.setuptools.packages.find]
include = ["talk_box*"]

[tool.setuptools.package-data]
talk_box = [
    "web_components/**/*",
]

[project]
name = "talk-box"
dynamic = ["version"]
description = "The best way to generate, test, and deploy LLM chatbots"
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
authors = [
    {name = "Richard Iannone", email = "riannone@me.com"},
]
keywords = [
    "chatbot",
    "llm",
    "ai",
    "conversation",
    "testing",
    "deployment",
]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
    "chatlas>=0.1.0",
    "typing-extensions>=4.4.0",
    "python-dotenv>=1.0.0",
    "requests>=2.25.0", # For server health checks
    "fastapi>=0.68.0", # For React chat server
    "uvicorn>=0.15.0", # For running FastAPI server
    "rich>=13.0.0", # For tool debugging UI
]

[project.optional-dependencies]
# Development dependencies
dev = [
    "pytest>=7.0.0",
    "pytest-cov>=4.0.0",
    "pytest-asyncio>=0.21.0",
    "pytest-mock>=3.10.0",
    "pytest-randomly>=3.16.0",
    "pytest-xdist>=3.6.1",
    "pytest-rerunfailures>=15.0",
    "ruff>=0.1.0",
    "pre-commit>=3.0.0",
    "quartodoc>=0.7.0",
]

# Rich reporting dependencies
reporting = [
    "great-tables>=0.2.0",
    "pandas>=1.3.0",
]

# Documentation dependencies
docs = [
    "quartodoc>=0.7.0",
    "jupyter>=1.0.0",
]

# All optional dependencies
all = [
    "talk-box[dev,docs]",
]

[project.urls]
Homepage = "https://github.com/rich-iannone/talk-box"
Documentation = "https://talk-box.readthedocs.io"
Repository = "https://github.com/rich-iannone/talk-box"
"Bug Tracker" = "https://github.com/rich-iannone/talk-box/issues"

[project.scripts]
talk-box = "talk_box.cli:main"

[tool.ruff]
line-length = 100

[tool.ruff.lint]
exclude = ["docs", ".venv", "tests/*", "playground.qmd", "*.ipynb", "**/playground/**", "**/examples/**"]

ignore = [
    "E402", # module level import not at top of file
    "E501", # line too long (maximum 100 characters)
    "F811", # redefinition of unused name
    "E203", # whitespace before ':'
    "F841", # local variable assigned but never used
    "E702", # multiple statements on one line (semicolon)
    "B008", # do not perform function calls in argument defaults
    "C901", # too complex
]

# Pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
    "--strict-markers",
    "--strict-config",
    "--cov=talk_box",
    "--cov-report=term-missing",
    "--cov-report=html",
    "--cov-report=xml",
    "--cov-fail-under=25",  # Temporarily lowered for current development
]
testpaths = ["tests"]
pythonpath = ["."]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests as integration tests",
    "unit: marks tests as unit tests",
]

# Coverage configuration
[tool.coverage.run]
source = ["talk_box"]
branch = true
omit = [
    "*/tests/*",
    "*/test_*",
    "*/__init__.py",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "if self.debug:",
    "if settings.DEBUG",
    "raise AssertionError",
    "raise NotImplementedError",
    "if 0:",
    "if __name__ == .__main__.:",
    "class .*\\bProtocol\\):",
    "@(abc\\.)?abstractmethod",
]
