This repository was archived by the owner on Jun 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
134 lines (120 loc) · 3.28 KB
/
Copy pathpyproject.toml
File metadata and controls
134 lines (120 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[project]
name = "Texas"
version = "1.4.0"
description = "A high-performance, extensible QQ Bot framework based on NapCat / OneBot 11"
requires-python = ">=3.14"
dependencies = [
"fastapi>=0.136.1",
"uvicorn[standard]>=0.46.0",
"pydantic>=2.13.0",
"pydantic-settings>=2.14.0",
"sqlalchemy[asyncio]>=2.0.49",
"asyncpg>=0.31.0",
"psycopg[binary]>=3.3.4",
"alembic>=1.18.4",
"dramatiq[redis]>=1.17",
"apscheduler[sqlalchemy,redis]>=4.0.0a6",
"redis>=5.2",
"prometheus_client>=0.25.0",
"structlog>=25.5.0",
"httpx>=0.28.1",
"openai>=2.33.0",
"boto3>=1.43.3",
"playwright>=1.59.0",
"markdown-it-py>=4.0.0",
"pyarrow>=24.0.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src"]
[project.scripts]
db = "src.core.db.cli:main"
[dependency-groups]
dev = [
"ruff>=0.15.11",
"mypy>=1.20.1",
"commitizen>=4.13.10",
"pre-commit>=4.6.0",
]
test = [
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"freezegun>=1.5.5",
"pytest-cov>=6.0",
"pytest-mock>=3.15.1",
"testcontainers[postgres]>=4.14.2",
]
[tool.ruff]
target-version = "py314"
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "SIM", "TCH"]
ignore = ["B008"] # FastAPI 标准用法:在参数默认值中使用 Depends()
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"sqlalchemy.orm.DeclarativeBase",
"src.core.db.base.Base",
"src.core.db.base.ChatBase",
"pydantic.BaseModel",
]
[tool.ruff.lint.per-file-ignores]
"**/migrations/versions/*.py" = ["E501", "TC003", "UP035", "UP007", "I001"]
[tool.mypy]
python_version = "3.14"
strict = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = ["dramatiq.*", "apscheduler.*", "pyarrow.*", "boto3.*", "botocore.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
testpaths = ["tests"]
addopts = "--tb=short -q"
markers = [
"integration: 需要真实 Docker 容器的集成测试(PostgreSQL + Redis)",
]
[tool.coverage.run]
source = ["src"]
omit = [
# 数据库基础设施(需要真实 DB 连接)
"src/core/db/*",
# Redis/缓存客户端(需要真实 Redis)
"src/core/cache/*",
# WebSocket / NapCat 连接
"src/core/ws/*",
# 应用入口
"src/core/main.py",
"src/core/lifespan.py",
# Dramatiq 任务(需要 Dramatiq Worker)
"src/core/tasks/*",
"src/core/rpc/*",
# 外部协议 API(需要 NapCat 连接)
"src/core/protocol/api*.py",
"src/core/protocol/event.py",
# 浏览器渲染(需要 Playwright + Chromium)
"src/core/browser/*",
# FastAPI 路由(需要完整 app 上下文 + DB)
"src/apis/*",
"src/core/apis/*",
# 迁移文件
"src/core/db/migrations/*",
]
[tool.coverage.report]
show_missing = true
skip_empty = true
# fail_under = 70
[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "pep621"
tag_format = "v$version"
bump_message = "chore(release): v$new_version"
update_changelog_on_bump = true
changelog_incremental = true
version_files = [
"frontend/package.json:version",
"helm/texas/Chart.yaml:version",
"helm/texas/Chart.yaml:appVersion",
]