[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ai-tax-agent"
version = "1.0.0"
description = "Production-grade AI Tax Agent system for UK Self Assessment"
authors = [{name = "AI Tax Agent Team", email = "team@aitaxagent.com"}]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.12"
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Financial and Insurance Industry",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.12",
]

dependencies = [
    "fastapi>=0.104.0",
    "uvicorn[standard]>=0.24.0",
    "pydantic>=2.5.0",
    "structlog>=23.2.0",
    "neo4j>=5.15.0",
    "qdrant-client>=1.7.0",
    "minio>=7.2.0",
    "redis>=5.0.0",
    "psycopg2-binary>=2.9.0",
    "sqlalchemy>=2.0.0",
    "alembic>=1.13.0",
    "opentelemetry-api>=1.21.0",
    "opentelemetry-sdk>=1.21.0",
    "opentelemetry-instrumentation-fastapi>=0.42b0",
    "opentelemetry-instrumentation-httpx>=0.42b0",
    "opentelemetry-exporter-jaeger>=1.21.0",
    "prometheus-client>=0.19.0",
    "prometheus-fastapi-instrumentator>=6.1.0",
    "httpx>=0.25.0",
    "python-multipart>=0.0.6",
    "python-jose[cryptography]>=3.3.0",
    "passlib[bcrypt]>=1.7.4",
    "python-dateutil>=2.8.0",
    "ulid-py>=1.1.0",
    "sentence-transformers>=2.2.0",
    "transformers>=4.36.0",
    "torch>=2.1.0",
    "numpy>=1.24.0",
    "pandas>=2.1.0",
    "scikit-learn>=1.3.0",
    "PyPDF2>=3.0.0",
    "reportlab>=4.0.0",
    "pytesseract>=0.3.10",
    "Pillow>=10.1.0",
    "playwright>=1.40.0",
    "pyshacl>=0.25.0",
    "rdflib>=7.0.0",
    "spacy>=3.7.0",
    "presidio-analyzer>=2.2.0",
    "presidio-anonymizer>=2.2.0",
    "jsonschema>=4.0.0",
    "boto3>=1.0.0",
    "aiokafka>=0.8.0",
    "hvac>=1.0.0",
    "nats-py>=2.0.0",
    "pydantic-settings>=2.0.0",
    "opentelemetry-exporter-otlp>=1.0.0",
    "opentelemetry-instrumentation-psycopg2>=0.42b0",
    "opentelemetry-instrumentation-redis>=0.42b0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.1.0",
    "pytest-mock>=3.12.0",
    "black>=23.11.0",
    "isort>=5.12.0",
    "ruff>=0.1.6",
    "mypy>=1.7.0",
    "pre-commit>=3.5.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["libs*", "apps*", "pipeline*", "retrieval*"]

[tool.black]
line-length = 88
target-version = ['py312']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | build
  | dist
)/
'''

[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 88
known_first_party = ["libs", "apps", "pipeline", "retrieval"]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

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

[tool.ruff.lint]
select = [
    "E",  # pycodestyle errors
    "W",  # pycodestyle warnings
    "F",  # pyflakes
    "I",  # isort
    "B",  # flake8-bugbear
    "C4", # flake8-comprehensions
    "UP", # pyupgrade
]
ignore = [
    "E501",  # line too long, handled by black
    "B008",  # do not perform function calls in argument defaults
    "C901",  # too complex
    "B904",  # raise from
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["B011"]

[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
module = [
    "neo4j.*",
    "qdrant_client.*",
    "minio.*",
    "redis.*",
    "structlog.*",
    "ulid.*",
    "sklearn.*",
    "sentence_transformers.*",
    "transformers.*",
    "torch.*",
    "sklearn.*",
    "PyPDF2.*",
    "reportlab.*",
    "pytesseract.*",
    "PIL.*",
    "playwright.*",
    "pyshaql.*",
    "rdflib.*",
    "spacy.*",
    "presidio_analyzer.*",
    "presidio_anonymizer.*",
    "prometheus_client.*",
    "prometheus_fastapi_instrumentator.*",
    "opentelemetry.*",
]
ignore_missing_imports = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests as integration tests",
    "unit: marks tests as unit tests",
]

[tool.coverage.run]
source = ["libs", "apps", "pipeline", "retrieval"]
omit = [
    "*/tests/*",
    "*/test_*",
    "*/__pycache__/*",
    "*/migrations/*",
]

[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",
]
