Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
67 lines (59 loc) · 2.63 KB
/
Copy pathpyproject.toml
File metadata and controls
67 lines (59 loc) · 2.63 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
# CodeRef-AI 打包配置(v4.9.2 新增):支持 `pip install .` 规范化安装与依赖声明。
# 与 requirements.txt 维护同一份依赖清单;要求 pip>=21.3 / setuptools>=77(>=77 才支持 SPDX license 字符串)。
# 版本号与 __init__.py 保持一致(运行时 _pkg_version 读 __init__.py,此处为打包元数据)。
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "coderef-ai"
# 版本号动态取自 core/version.py 唯一真源(与 __init__.py 一致,杜绝双写漂移)
dynamic = ["version"]
description = "静态图驱动的 LLM 代码审计工具 —— 非编程人员也可验证 AI 项目是否按期望执行、架构是否健康、文档是否可信"
readme = "README.md"
# SPDX 标识(新 setuptools 要求字符串而非 {text=...},否则 pip install . 构建失败)
license = "PolyForm-Noncommercial-1.0.0"
license-files = ["LICENSE", "LICENSE-MIT-v4.md"]
authors = [{ name = "CodeRef Team" }]
keywords = ["code-audit", "llm", "static-analysis", "audit", "mcp"]
requires-python = ">=3.10"
dependencies = [
"openai>=1.10.0",
"requests>=2.31.0",
"numpy>=1.26.0",
"pyyaml>=6.0.1",
"loguru>=0.7.2",
"packaging>=23.0",
]
[tool.setuptools.dynamic]
version = { attr = "core.version.__version__" }
[project.optional-dependencies]
# 多语言高级解析(可选,未安装时 code_analyzer 自动降级到标准库 ast)
lang = [
"tree-sitter==0.20.4; python_version < '3.13'",
"tree-sitter-languages>=1.10.0; python_version < '3.13'",
]
[project.scripts]
# 以 MCP stdio server 方式启动(等价 `python -m core.mcp_server`)
coderef-mcp = "core.mcp_server:main"
[tool.setuptools.packages.find]
# 自动发现含 __init__.py 的包(约束在 config*/core*,未来 core 下新增子包无需手工补列)
include = ["config*", "core*"]
exclude = ["tests*", "samples*", "workspace*", "*.tests"]
[tool.setuptools.package-data]
config = ["*.json"]
# ─── 覆盖率监控(dev 依赖:pip install -r requirements-dev.txt)───
[tool.coverage.run]
source = ["core"]
# 排除引导/入口/生成类(无业务逻辑,拉低覆盖率读数)
omit = [
"core/mcp_server.py", # MCP 入口(stdio 交互,测试经 handler 层)
"core/cli.py",
"core/gitnexus_client.py", # 外部 npx 依赖,未装时降级
]
branch = true
[tool.coverage.report]
show_missing = true
skip_covered = true
# 阈值:低于此值 CI 失败。起点 15%(当前基线约 18%,留下降空间),
# 随测试覆盖提升逐步上调——覆盖率监控的目的是趋势追踪,不是一夜达标。
fail_under = 15