-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
207 lines (183 loc) · 5.51 KB
/
pyproject.toml
File metadata and controls
207 lines (183 loc) · 5.51 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
207
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "chuk-mcp-runtime"
version = "0.11.4"
description = "Generic CHUK MCP Runtime for MCP servers"
readme = "README.md"
requires-python = ">=3.11"
license = {text = "Apache-2.0"}
dependencies = [
"pydantic>=2.10.6",
"pyyaml>=6.0.2",
"pyjwt>=2.12.0",
"cryptography>=46.0.6",
"uvicorn>=0.34.0",
"chuk-artifacts>=0.11.1",
"chuk-sessions>=0.6.1",
"mcp>=1.26.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.3.5",
"pytest-asyncio>=0.23.0",
"pytest-cov>=6.0.0",
"ruff>=0.4.6",
"mypy>=1.13.0",
"bandit>=1.7.0",
]
websocket = [
"websockets>=14.1",
]
[project.scripts]
chuk-mcp-runtime = "chuk_mcp_runtime.main:main"
chuk-mcp-server = "chuk_mcp_runtime.main:main"
chuk-mcp-proxy = "chuk_mcp_runtime.proxy_cli:cli"
[tool.setuptools.packages.find]
where = ["src"]
include = ["chuk_mcp_runtime*"]
[tool.setuptools.package-data]
chuk_mcp_runtime = [
"config.yaml", # default runtime config
"py.typed", # typing marker
]
[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-asyncio>=0.26.0",
"pytest-cov>=6.0.0",
"ruff>=0.4.6",
"mypy>=1.13.0",
"bandit>=1.7.0",
]
[tool.pytest.ini_options]
# Pytest configuration
testpaths = ["tests"]
pythonpath = ["src"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--verbose",
"--tb=short",
"--strict-markers",
"--strict-config",
"--durations=10",
"-ra"
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"security: marks tests as security-focused tests",
"performance: marks tests as performance tests",
"asyncio: marks tests as async tests"
]
filterwarnings = [
"ignore::DeprecationWarning:chuk_sessions.*",
"ignore::pytest.PytestDeprecationWarning",
"ignore::pytest.PytestUnknownMarkWarning",
# Test fixtures deliberately use short keys to exercise JWT validation paths.
# Match by message text so this works across all PyJWT versions.
"ignore:.*below the minimum recommended length.*"
]
[tool.coverage.run]
omit = [
"*/main.py",
"*/proxy_cli.py",
"*/entry.py",
"*/grid/*",
"*/artifacts/__init__.py",
"*/proxy/manager.py",
"*/session/native_session_management.py",
"*/session/session_management.py",
"*/tools/artifacts_tools.py",
"*/tools/session_tools.py",
"*/server/event_store.py",
"*/server/server.py",
"*/server/server_registry.py",
"*/tools/__init__.py",
"*/common/mcp_tool_decorator.py",
"*/common/openai_compatibility.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
]
[tool.setuptools]
license-files = []
[tool.mypy]
# Mypy configuration
python_version = "3.11"
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
no_implicit_optional = false
check_untyped_defs = false
# Per-module options for external libraries without stubs
[[tool.mypy.overrides]]
module = [
"mcp.*",
"chuk_artifacts.*",
"chuk_tool_processor.*",
]
ignore_missing_imports = true
# Allow dynamic attributes in decorator modules
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.common.mcp_tool_decorator"
disable_error_code = ["attr-defined", "no-redef"]
# Allow type issues in tool modules (they use dict unpacking from external sources)
[[tool.mypy.overrides]]
module = ["chuk_mcp_runtime.tools.*"]
disable_error_code = ["attr-defined", "no-redef"]
# Server has conditional ASGI signatures
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.server.server"
disable_error_code = ["misc", "arg-type"]
# Config loader - yaml stubs are installed but mypy complains
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.server.config_loader"
disable_error_code = ["import-untyped"]
# Grid hub_sandbox imports from session module (provider_factory may not exist)
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.grid.hub_sandbox"
disable_error_code = ["attr-defined"]
# Artifacts tools - uses external library types
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.tools.artifacts_tools"
disable_error_code = ["index", "return-value", "misc"]
# Event store - override signature compatibility
[[tool.mypy.overrides]]
module = "chuk_mcp_runtime.server.event_store"
disable_error_code = ["override"]
[tool.ruff]
# Ruff configuration
line-length = 100
target-version = "py311"
[tool.ruff.lint]
# Enable specific rule sets
select = ["E", "F", "I", "N", "W"]
# Ignore specific rules
ignore = []
[tool.ruff.lint.per-file-ignores]
# Examples often need to modify sys.path before imports, have long lines, and use uppercase vars
"examples/**/*.py" = ["E402", "E501", "N806", "W291"]
# Entry points need to set up logging before imports
"src/chuk_mcp_runtime/entry.py" = ["E402"]
"src/chuk_mcp_runtime/proxy_cli.py" = ["E402"]
# Test files may have imports after fixtures and long lines
"tests/**/*.py" = ["E402", "E501", "F811", "N806"]
# Tool decorators use MCP-style naming conventions
"src/chuk_mcp_runtime/common/mcp_tool_decorator.py" = ["N803", "N806"]
# Tool files use uppercase constants for tool lists
"src/chuk_mcp_runtime/tools/*.py" = ["E501", "N802", "N806"]
"src/chuk_mcp_runtime/session/native_session_management.py" = ["N806"]