-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
206 lines (181 loc) · 5.74 KB
/
pyproject.toml
File metadata and controls
206 lines (181 loc) · 5.74 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
[build-system]
requires = ["setuptools>=80.9", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mcp-testing"
version = "0.1.0-beta.5"
description = "Local testing framework for MCP (Model Context Protocol) servers"
authors = [
{name = "Antoni Gmitruk", email = "antoni@golf.dev"}
]
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.12"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Quality Assurance",
"Environment :: Console",
"Operating System :: OS Independent",
]
keywords = ["mcp", "testing", "ai", "claude", "protocol", "cli", "local"]
# Minimal dependencies for standalone CLI tool
dependencies = [
"pydantic>=2.0.0",
"anthropic>=0.69.0",
"openai>=1.0.0",
"httpx>=0.25.0",
"click>=8.0.0",
"rich>=13.0.0",
"PyYAML>=6.0.0", # For configuration file handling
"mcp>=1.15.0", # Official MCP Python SDK for compliance testing
"PyJWT>=2.10.1", # For OAuth JWT token creation and validation in testing (security fix)
"packaging>=21.0", # For semantic version comparison in version checker
"beautifulsoup4>=4.12.0", # For web scraping in auto test generation
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.21.0",
"pytest-httpx>=0.21.0", # For HTTP mocking in compliance tests
"ruff>=0.13.0",
"mypy>=1.18.0",
"pre-commit>=4.0.0",
]
ci = [
"pytest>=8.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0",
]
[project.urls]
Homepage = "https://github.com/golf-mcp/golf-testing"
Documentation = "https://github.com/golf-mcp/golf-testing#readme"
Repository = "https://github.com/golf-mcp/golf-testing"
"Bug Tracker" = "https://github.com/golf-mcp/golf-testing/issues"
# CLI entry points
[project.scripts]
mcp-t = "test_mcp.cli.main:mcpt_main"
[tool.setuptools.packages.find]
where = ["src"]
include = ["test_mcp*"]
[tool.setuptools.package-data]
"test_mcp" = ["templates/*"]
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
select = [
"E", "F", "W", # pycodestyle + pyflakes (existing)
"I", # isort (existing)
"N", # pep8-naming (existing)
"B", # flake8-bugbear (existing)
"C4", # flake8-comprehensions (existing)
"UP", # pyupgrade (existing)
"S", # Security (bandit) - NEW
"PERF", # Performance - NEW
"C901", # Complexity - NEW
"PLR", # Pylint refactor - NEW
"RUF", # Ruff-specific - NEW
]
ignore = [
"E501", # Line length (handled by formatter) - existing
"B008", # Do not perform function calls in argument defaults - existing
"S101", # Use of assert (legitimate in tests) - NEW
"PLR0913", # Too many arguments (config patterns need this) - NEW
"S602", # subprocess-shell-command - false positive for our secure usage - NEW
]
[tool.ruff.lint.mccabe]
max-complexity = 10 # Reduced from 15
[tool.ruff.lint.pylint]
max-args = 8 # Limit argument count
max-branches = 12 # Limit branching
max-returns = 6 # Limit return statements
max-statements = 50 # Limit total statements per function
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # existing
"src/test_mcp/security/oauth_tester.py" = ["S105", "S106"] # Ignore hardcoded test strings
"tests/" = ["S101", "S102", "S103"] # Allow assertions and other test patterns
[tool.mypy]
python_version = "3.12"
ignore_missing_imports = true
warn_unused_ignores = true
warn_return_any = true
# Gradually enable strict checking
allow_untyped_calls = true
allow_untyped_defs = true
no_implicit_optional = false
# Reduced error suppressions - keeping only essential ones
disable_error_code = [
"attr-defined", # Third-party library issues
"union-attr", # Click parameter handling
"call-arg", # Complex function signatures
"import-untyped" # External dependencies
]
# Only keep suppressions for external libraries
[[tool.mypy.overrides]]
module = "mcp.*"
ignore_missing_imports = true
ignore_errors = true
[[tool.mypy.overrides]]
module = "anthropic.*"
ignore_missing_imports = true
ignore_errors = true
[[tool.mypy.overrides]]
module = "openai.*"
ignore_missing_imports = true
ignore_errors = true
[[tool.mypy.overrides]]
module = "click.*"
ignore_missing_imports = true
ignore_errors = true
[[tool.mypy.overrides]]
module = "rich.*"
ignore_missing_imports = true
ignore_errors = true
# Enable strict typing for well-typed modules
[[tool.mypy.overrides]]
module = "test_mcp.models.*"
# Remove all disable_error_code suppressions for our code
exclude = [
"venv/",
".venv/",
".env",
"build/",
"dist/",
"thoughts/",
"tests/",
"test_results/",
"configs/",
".mypy_cache/",
".pytest_cache/",
".ruff_cache/",
".claude/",
"CLAUDE.md",
".pre-commit-config.yaml",
".gitignore",
]
# Handle MCP SDK and external dependencies with pattern matching issues
[[tool.mypy.overrides]]
module = [
"mcp.*",
"anthropic.*",
"openai.*",
]
ignore_errors = true
ignore_missing_imports = true
# Specifically ignore MCP client session pattern matching issues (Python 3.10+ syntax)
[[tool.mypy.overrides]]
module = "mcp.client.session"
ignore_errors = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"