generated from loonghao/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpyproject.toml
168 lines (146 loc) · 4.01 KB
/
pyproject.toml
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
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "wecom-bot-mcp-server"
version = "0.6.7"
description = "WeCom Bot MCP Server - A Python server for WeCom (WeChat Work) bot following the Model Context Protocol (MCP)"
authors = ["longhao <[email protected]>"]
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
[tool.poetry.dependencies]
python = ">=3.10,<4.0"
mcp = ">=1.3.0"
notify-bridge = ">=0.3.0"
platformdirs = ">=4.2.0"
pydantic = ">=2.6.1"
ftfy = ">=6.3.1"
httpx = ">=0.28.1"
pillow = ">=10.2.0"
svglib = ">=1.5.1"
tenacity = ">=9.0.0"
loguru = ">=0.7.3"
aiohttp = ">=3.11.13"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
pytest-cov = "^6.0.0"
pytest-asyncio = "^0.21.1"
mypy = "^1.5.1"
ruff = "^0.9.0"
pyfakefs = "^5.8.0"
[tool.poetry.scripts]
wecom-bot-mcp-server = "wecom_bot_mcp_server.server:main"
[tool.poetry.urls]
Homepage = "https://github.com/loonghao/wecom-bot-mcp-server"
Issues = "https://github.com/loonghao/wecom-bot-mcp-server/issues"
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.6.7"
tag_format = "v$version"
version_files = [
"pyproject.toml:version",
"src/wecom_bot_mcp_server/__version__.py",
"smithery.yaml:version",
"marketplace.yaml:version",
]
[tool.pytest.ini_options]
addopts = ""
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
[tool.pytest-asyncio]
mode = "auto"
[tool.coverage.run]
source = ["wecom_bot_mcp_server"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
ignore_missing_imports = true
disable_error_code = ["type-arg", "misc", "no-any-return"]
[tool.ruff]
line-length = 120
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
# "I", # isort - 禁用导入排序检查
"D", # pydocstyle
"UP", # pyupgrade
"RUF", # ruff-specific rules
]
ignore = ["D203", "D213", "ARG001", "D107", "D105", "D102", "F811", "I001"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"noxfile.py" = ["E402", "I001"]
"tests/*.py" = ["ARG001", "F401", "F811", "D107", "D105", "D102", "E501", "I001"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.isort]
# Enforce import section headers.
import_heading_future = "Import future modules"
import_heading_stdlib = "Import built-in modules"
import_heading_thirdparty = "Import third-party modules"
import_heading_firstparty = "Import local modules"
profile = "black"
line_length = 120
force_sort_within_sections = true
force_single_line = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
[tool.pyright]
include = ["src/wecom_bot_mcp_server"]
venvPath = "."
venv = ".venv"
[tool.nox]
sessions = ["lint", "pytest"]
python = ["3.10"]
reuse_venv = true
[tool.nox.session.lint]
deps = ["ruff", "mypy", "isort"]
commands = [
"mypy --install-types --non-interactive",
"ruff check .",
"ruff format --check .",
"isort --check-only .",
"mypy src/wecom_bot_mcp_server --strict"
]
[tool.nox.session.lint_fix]
deps = ["ruff", "mypy", "isort"]
commands = [
"ruff check --fix .",
"ruff format .",
"isort ."
]
[tool.nox.session.pytest]
deps = ["pytest", "pytest-cov", "pytest-asyncio", "pillow", "svglib", "reportlab", "httpx"]
commands = [
"pytest tests/ --cov=wecom_bot_mcp_server --cov-report=xml:coverage.xml --cov-report=term-missing"
]