pyproject.toml
2.05 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
[project]
name = "mcp-hive"
version = "0.2.0"
description = "公司统一 MCP 服务中心:把各业务线的数据接口封装成 MCP 工具,带调用审计与可视化控制台"
requires-python = ">=3.10"
dependencies = [
"mcp>=1.27,<2.0",
"httpx>=0.27",
"python-dotenv>=1.0",
"sqlalchemy[asyncio]>=2.0",
"aiomysql>=0.2",
"starlette>=0.37",
"uvicorn[standard]>=0.30",
]
[project.optional-dependencies]
gateway = [
"fastapi>=0.115",
"itsdangerous>=2.1", # Starlette 的 SessionMiddleware 用它给会话 cookie 签名
]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.24",
"respx>=0.21",
"ruff>=0.6",
"mypy>=1.11",
]
[project.scripts]
# 统一入口:--all 挂载全部服务,--service <key> 单服务独立进程
mcp-hive-serve = "mcp_hive.serve:main"
mcp-hive-gateway = "mcp_hive.gateway.app:main"
mcp-hive-admin = "mcp_hive.admin.cli:main"
[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
"mcp_hive.gateway" = ["static/**/*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
asyncio_mode = "auto"
# --basetemp:本机 %TEMP%\pytest-of-admin 是一个 2026-07 遗留的只读目录,
# 会让 tmp_path fixture 直接 PermissionError。指到仓库内(已 gitignore)绕开它。
addopts = "-q --strict-markers --basetemp=.pytest-tmp"
filterwarnings = ["ignore::DeprecationWarning"]
[tool.ruff]
line-length = 110
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "C4", "SIM", "BLE", "RUF"]
ignore = [
"E501", # 行长交给 formatter
"RUF001", # 中文注释里的全角标点是有意的
"RUF002",
"RUF003",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
[tool.mypy]
python_version = "3.10"
mypy_path = "src"
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false