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

[project]
name = "invoice-ocr-mcp"
version = "1.0.0"
description = "企业发票OCR识别MCP服务器 - 基于ModelScope的专业发票识别解决方案"
authors = [
    {name = "Invoice OCR Team", email = "team@example.com"},
]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.8"
keywords = ["mcp", "ocr", "invoice", "modelscope", "ai"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Office/Business :: Financial",
]
dependencies = [
    "mcp>=1.0.0",
    "modelscope>=1.28.0",
    "opencv-python>=4.8.0",
    "Pillow>=10.0.0",
    "numpy>=1.24.0",
    "torch>=2.0.0",
    "transformers>=4.30.0",
    "asyncio>=3.4.3",
    "aiofiles>=23.0.0",
    "jsonschema>=4.17.0",
    "pydantic>=2.0.0",
    "python-dotenv>=1.0.0",
    "PyYAML>=6.0.0",
    "structlog>=23.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-asyncio>=0.21.0",
    "pytest-mock>=3.11.0",
    "pytest-cov>=4.1.0",
    "black>=23.0.0",
    "flake8>=6.0.0",
    "isort>=5.12.0",
    "mypy>=1.5.0",
]
gpu = [
    "torch[cuda]>=2.0.0",
    "torchvision[cuda]>=0.15.0",
]
monitoring = [
    "prometheus-client>=0.17.0",
    "redis>=4.6.0",
]
performance = [
    "cachetools>=5.3.0",
    "scikit-image>=0.21.0",
]

[project.urls]
Homepage = "https://github.com/your-org/invoice-ocr-mcp"
Documentation = "https://github.com/your-org/invoice-ocr-mcp/docs"
Repository = "https://github.com/your-org/invoice-ocr-mcp.git"
Issues = "https://github.com/your-org/invoice-ocr-mcp/issues"

[project.scripts]
invoice-ocr-mcp = "invoice_ocr_mcp.server:main"

[tool.setuptools.packages.find]
where = ["src"]
include = ["invoice_ocr_mcp*"]

[tool.setuptools.package-data]
"invoice_ocr_mcp" = ["configs/*.yaml", "configs/*.yml"]

# 黑色代码格式化配置
[tool.black]
line-length = 88
target-version = ['py38']
include = '\.pyi?$'
extend-exclude = '''
/(
  # 排除的文件夹
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
)/
'''

# isort导入排序配置
[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 88
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true

# MyPy类型检查配置
[tool.mypy]
python_version = "3.8"
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

# Pytest配置
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --cov=src/invoice_ocr_mcp --cov-report=term-missing"
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",
]

# Coverage配置
[tool.coverage.run]
source = ["src/invoice_ocr_mcp"]
branch = true
omit = [
    "*/tests/*",
    "*/test_*.py",
    "*/__pycache__/*",
    "*/migrations/*",
]

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