-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
182 lines (161 loc) · 4.22 KB
/
pyproject.toml
File metadata and controls
182 lines (161 loc) · 4.22 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
[project]
name = "aci"
version = "0.2.0"
description = "Augmented Codebase Indexer - Semantic code search with precise line-level location results"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [
{ name = "ACI Team" },
]
keywords = ["code-search", "semantic-search", "ast", "embeddings", "qdrant"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
# runtime dependencies
dependencies = [
"fastapi>=0.111.0",
"httpx>=0.25.0",
"mcp>=1.0.0",
"pathspec>=0.11.0",
"prompt_toolkit>=3.0.0",
"python-dotenv>=1.0.1",
"pyyaml>=6.0",
"qdrant-client>=1.9.0",
"tiktoken>=0.5.0",
"tree-sitter>=0.21.0",
"tree-sitter-c>=0.21.0",
"tree-sitter-cpp>=0.21.0",
"tree-sitter-go>=0.21.0",
"tree-sitter-java>=0.21.0",
"tree-sitter-javascript>=0.21.0",
"tree-sitter-python>=0.21.0",
"typer>=0.9.0",
"uvicorn>=0.23.0",
"watchdog>=3.0.0",
]
[project.scripts]
aci = "aci.cli:app"
aci-mcp = "aci.mcp_server:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/aci"]
sources = ["src"]
[tool.hatch.version]
path = "src/aci/__init__.py"
# ==================== 依赖分组 ====================
[dependency-groups]
# 测试套件
test = [
"hypothesis>=6.92.0",
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
]
# 代码质量工具
lint = [
"pre-commit>=3.5.0",
"ruff>=0.1.0",
]
# 类型检查
typecheck = [
"mypy>=1.7.0",
]
# 构建与发布
build = [
"build>=1.0.0",
"twine>=4.0.0",
]
# 完整开发环境(组合所有分组)
dev = [
{ include-group = "test" },
{ include-group = "lint" },
{ include-group = "typecheck" },
{ include-group = "build" },
]
# 用户可选功能扩展
rerank = [
"sentence-transformers>=2.2.0",
]
# 性能优化(生产环境推荐)
performance = [
"orjson>=3.9.0",
"uvloop>=0.19.0; sys_platform != 'win32'",
]
# ==================== 工具配置 ====================
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle 错误
"F", # Pyflakes
"I", # isort
"N", # PEP8 命名
"S", # flake8-bandit(安全)
"T201", # 禁止 print
"UP", # pyupgrade
"W", # pycodestyle 警告
]
ignore = [
"E501", # 行长度由格式化器处理
"S101", # 允许 assert(测试需要)
]
[tool.ruff.lint.per-file-ignores]
# typer/FastAPI 要求在默认参数中调用函数,这是框架惯用写法
"src/aci/cli/__init__.py" = ["B008", "B904"]
"src/aci/http_server.py" = ["B008", "B904"]
# 服务器绑定 0.0.0.0 是故意设计的行为
"src/aci/core/config.py" = ["S104"]
"src/aci/core/qdrant_launcher.py" = ["S104", "S603", "S607"]
# 参数化占位符构造,无 SQL 注入风险
"src/aci/infrastructure/metadata_store/queries.py" = ["S608"]
# 故意的尽力清理(best-effort cleanup),不抛出清理错误
"src/aci/cli/repl/controller.py" = ["S110"]
"src/aci/cli/repl/event_loop.py" = ["S110"]
"src/aci/cli/repl/indexing_ops.py" = ["S110"]
"src/aci/infrastructure/vector_store/qdrant.py" = ["S110"]
"src/aci/mcp/context.py" = ["S110"]
# 测试文件允许使用 /tmp 及文件中段导入
"tests/**/*.py" = ["S108", "E402"]
[tool.ruff.lint.isort]
known-first-party = ["aci"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
pythonpath = ["src"]
addopts = [
"--strict-markers",
"--strict-config",
"-ra",
"-q",
]
markers = [
"slow: 慢速测试",
"integration: 集成测试",
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/__main__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.__:",
"raise NotImplementedError",
]