Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
73 lines (65 loc) · 2.29 KB
/
Copy pathpyproject.toml
File metadata and controls
73 lines (65 loc) · 2.29 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
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "alert-engine"
version = "0.3.0"
description = "运维告警降噪引擎 — 8 阶段管线(去重/聚合/降噪/基线/升级)+ 评分与症状路由"
readme = "README.md"
# PEP 639 写法:字符串 SPDX 标识。旧的 license = { text = ... } 已被 setuptools
# 弃用(setuptools>=77 起告警),license-files 指向仓库内的 LICENSE 全文。
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
authors = [{ name = "CodeCoreLab" }]
keywords = ["alert", "ops", "noise-reduction", "incident", "escalation", "sre"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
# 注意:不再声明 "License :: OSI Approved :: Apache Software License" ——
# PEP 639 规定 license 表达式与 license classifiers 重复,setuptools>=77
# 会直接报 InvalidConfigError 导致构建失败。
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: System :: Monitoring",
]
dependencies = [
"click>=8.1",
"rich>=13.0",
"pydantic>=2.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"ruff>=0.6",
]
llm = [
"openai>=1.0",
]
[project.scripts]
alert-engine = "alert_engine.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
# 显式锁定规则集:ruff 默认规则集随版本变化(0.6 → 0.16 差异明显),
# 不锁定则 CI 会出现"今天绿、升个 ruff 就红"的版本漂移。
select = ["E", "F", "W", "I", "B", "UP", "C4", "SIM", "RUF"]
ignore = [
"E501", # 行长由 formatter 负责,ruff 与 black 容易打架
"B008", # FastAPI/Click 的 Depends()/参数默认值是惯用写法
"SIM108", # 三元表达式不一定比 if/else 清晰
"RUF001", # 中文全角标点在中文项目里是常态
"RUF002",
"RUF003",
]
[tool.ruff.lint.per-file-ignores]
# 测试里长字符串与大量 fixture 断言,宽松一点不影响正确性
"tests/*" = ["E402", "B011"]
[tool.pytest.ini_options]
testpaths = ["tests"]