[tool.uv.workspace]
members = [
  "apps/api",
  "packages/shared",
  "packages/config",
  "packages/db",
  "packages/llm_gateway",
  "packages/core",
  "packages/agents",
  "packages/skills",
]

[dependency-groups]
dev = [
  "pytest>=8",
  "pytest-asyncio>=0.24",
  "pytest-cov>=5",
  "ruff>=0.6",
  "mypy>=1.11",
  "httpx>=0.27",
  "asgi-lifespan>=2.1",
]

[tool.ruff]
line-length = 100
target-version = "py312"
src = ["apps", "packages"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]

[tool.mypy]
python_version = "3.12"
mypy_path = [
  "packages/shared",
  "packages/config",
  "packages/db",
  "packages/llm_gateway",
  "packages/core",
  "packages/agents",
  "packages/skills",
  "apps/api",
]
namespace_packages = true
strict = true
ignore_missing_imports = true
explicit_package_bases = true
# 跨包聚合 mypy 时，多个无包 tests 目录的 conftest.py 会撞成同名模块 `conftest`。
# conftest 仅含测试 fixtures；从聚合检查中排除（test_*.py / fakes_* 仍按唯一名受检）。
exclude = ["(^|/)conftest\\.py$"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests", "apps", "packages"]

[tool.coverage.run]
branch = true
source = ["apps", "packages"]
omit = [
  "*/tests/*",
  "*/conftest.py",
  "*/migrations/*",
  "*/alembic/*",
]

[tool.coverage.report]
show_missing = true
# 排除无需覆盖的纯防御/类型分支
exclude_lines = [
  "pragma: no cover",
  "raise NotImplementedError",
  "if TYPE_CHECKING:",
  "@(abc\\.)?abstractmethod",
]
