Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
107 lines (93 loc) · 2.89 KB
/
Copy pathpyproject.toml
File metadata and controls
107 lines (93 loc) · 2.89 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
# aivis —— Claude API web-search 可见度(代理测量)
# 依赖与所有检查员(ruff / mypy / import-linter / pytest)的配置都集中在本文件(CLAUDE.md §8)。
[build-system]
requires = ["setuptools>=69"]
build-backend = "setuptools.build_meta"
[project]
name = "aivis"
version = "0.1.0"
description = "Claude API web-search 可见度(代理测量)—— 可复现的提及/引用测量框架"
requires-python = ">=3.12"
# 🟥 CLAUDE.md §3:不经人确认禁止新增第三方依赖。
# 当前白名单:pydantic(§2 契约要求)、PyYAML(§2 questions.yml/brands.yml 要求)、
# anthropic(第二步接真引擎时经人确认加入;只许 providers 层 import,由 import-linter 保证)。
dependencies = [
"pydantic>=2.7",
"PyYAML>=6.0",
"anthropic>=0.60",
]
[project.optional-dependencies]
dev = [
"pytest>=8",
"ruff==0.15.16", # 钉死:与 .pre-commit-config ruff rev 一致,避免格式门禁跨版本漂移
"mypy>=1.10",
"import-linter>=2.0",
"types-PyYAML",
"pre-commit>=3.7",
"build>=1.0", # 发布构建工具:`python -m build` 产出 wheel/sdist(非运行时依赖)
]
[project.scripts]
aivis = "aivis.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
aivis = ["gui/static/*.html"] # 本地向导前端随包分发
# ---------- 格式/质量检查员(CLAUDE.md §10.5 第 4 条) ----------
[tool.ruff]
line-length = 100
target-version = "py312"
src = ["src", "tests"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
# ---------- 类型检查员(CLAUDE.md §10.5 第 3 条) ----------
[tool.mypy]
python_version = "3.12"
strict = true
plugins = ["pydantic.mypy"]
mypy_path = "src"
files = ["src/aivis", "tests"]
# ---------- 测试报警器(CLAUDE.md §10.5 第 5 条) ----------
[tool.pytest.ini_options]
testpaths = ["tests"]
# ---------- 层级检查员(CLAUDE.md §10.5 第 1 条) ----------
[tool.importlinter]
root_packages = ["aivis"]
include_external_packages = true
[[tool.importlinter.contracts]]
name = "contracts 是载重墙,不依赖任何上层"
type = "forbidden"
source_modules = ["aivis.contracts"]
forbidden_modules = [
"aivis.pipeline",
"aivis.providers",
"aivis.storage",
"aivis.stats",
"aivis.cli",
"aivis.configio",
]
[[tool.importlinter.contracts]]
name = "纯层(extract/score/stats)禁止网络/SDK/存储/适配器"
type = "forbidden"
source_modules = [
"aivis.pipeline.extract",
"aivis.pipeline.score",
"aivis.stats",
"aivis.templater",
"aivis.matching",
]
forbidden_modules = [
"requests",
"httpx",
"aiohttp",
"urllib3",
"anthropic",
"openai",
"aivis.storage",
"aivis.providers",
"aivis.cli",
]
[[tool.importlinter.contracts]]
name = "storage 不反向依赖流水线/适配器/CLI"
type = "forbidden"
source_modules = ["aivis.storage"]
forbidden_modules = ["aivis.pipeline", "aivis.providers", "aivis.cli"]