- 從 strict=true 改為漸進式配置 - 保留核心檢查 (warn_return_any, no_implicit_optional) - 排除 scripts/ 和 tests/ 舊代碼 - TODO: 逐步修復後啟用 strict=true Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
99 lines
2.6 KiB
TOML
99 lines
2.6 KiB
TOML
[project]
|
|
name = "awoooi-api"
|
|
version = "0.1.0"
|
|
description = "AWOOOI BFF API Gateway"
|
|
readme = "README.md"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"fastapi>=0.115.0", # Upgraded for starlette 1.0.0 compatibility (claude-agent-sdk)
|
|
"uvicorn[standard]>=0.27.0",
|
|
"pydantic>=2.5.0",
|
|
"pydantic-settings>=2.1.0",
|
|
"httpx>=0.26.0",
|
|
"redis>=5.0.0",
|
|
"asyncpg>=0.29.0",
|
|
"structlog>=24.1.0",
|
|
# CTO-201: Infrastructure Execution Engine
|
|
"kubernetes-asyncio>=29.0.0",
|
|
"sqlalchemy[asyncio]>=2.0.0",
|
|
# NOTE: 禁止 aiosqlite/SQLite (AWOOOI 鐵律 #2),使用 asyncpg + PostgreSQL
|
|
# OpenTelemetry (SigNoz Integration)
|
|
"opentelemetry-api>=1.20.0",
|
|
"opentelemetry-sdk>=1.20.0",
|
|
"opentelemetry-exporter-otlp>=1.20.0",
|
|
"opentelemetry-instrumentation-fastapi>=0.41b0",
|
|
"opentelemetry-instrumentation-httpx>=0.41b0",
|
|
"opentelemetry-instrumentation-logging>=0.41b0",
|
|
# Phase 6.4g: leWOOOgo Brain - 積木化決策引擎
|
|
# NOTE: Local packages 透過 Dockerfile 預先安裝,無需在此列出
|
|
# 請參閱 apps/api/Dockerfile Phase 6.4i 註解
|
|
# Phase 9: Agent Teams - Claude Agent SDK
|
|
"claude-agent-sdk>=0.1.50",
|
|
]
|
|
|
|
# [tool.uv.sources]
|
|
# lewooogo-brain = { path = "../../packages/lewooogo-brain", editable = true }
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=7.4.0",
|
|
"pytest-asyncio>=0.23.0",
|
|
"pytest-cov>=4.1.0",
|
|
"ruff>=0.1.0",
|
|
"mypy>=1.8.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py311"
|
|
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 formatter)
|
|
]
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-first-party = ["src"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
# 漸進式類型檢查 (業界最佳實踐)
|
|
# strict = true # TODO: 當所有模組都完成類型註解後啟用
|
|
warn_return_any = true
|
|
warn_unused_configs = true
|
|
disallow_untyped_defs = false # 暫時關閉,允許部分函數無類型
|
|
disallow_incomplete_defs = false
|
|
check_untyped_defs = true
|
|
ignore_missing_imports = true
|
|
no_implicit_optional = true
|
|
warn_redundant_casts = true
|
|
warn_unused_ignores = true
|
|
|
|
# 排除舊代碼 (漸進式遷移)
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"scripts.*",
|
|
"tests.*",
|
|
]
|
|
ignore_errors = true
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|