-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
249 lines (228 loc) · 6.81 KB
/
Copy pathpyproject.toml
File metadata and controls
249 lines (228 loc) · 6.81 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mxcp"
version = "0.12.3"
description = "Enterprise MCP framework for building production AI tools with SQL/Python, featuring security, audit trails, and policy enforcement"
authors = [{ name = "RAW Labs SA", email = "[email protected]" }]
readme = "README.md"
license = "BUSL-1.1"
requires-python = ">=3.10"
dependencies = [
# MCP Framework
"mcp>=1.23,<1.28", # Official MCP Python SDK
"aiohttp>=3.8.0", # HTTP transport for MCP
"aiofiles>=23.2.1", # Async file I/O for audit backend
"starlette>=0.27.0", # HTTP server framework
# Data & Processing
"duckdb>=1.4.1", # Embedded analytics database
"pandas>=2.0.0", # DataFrame operations with DuckDB
"pyyaml>=6.0.1", # Configuration parsing
"jinja2>=3.1.3", # Template engine for SQL/Python generation
"makefun", # Dynamic function creation
"cel-python>=0.2.0", # Policy enforcement engine
"httpx>=0.28.0", # HTTP client for API calls
"cryptography>=41.0.0", # Fernet encryption for auth token storage
"PyJWT[crypto]>=2.11.0", # JWT validation for verifier mode
# CLI
"click>=8.1.7", # CLI framework
"posthog>=3.0.0", # Usage analytics (always available)
"dbt-core>=1.6.0", # dbt core for data transformations
"dbt-duckdb>=1.6.0", # dbt DuckDB adapter
# Observability
"opentelemetry-api>=1.24.0", # OpenTelemetry API
"opentelemetry-sdk>=1.24.0", # OpenTelemetry SDK
"opentelemetry-exporter-otlp-proto-http>=1.24.0", # OTLP HTTP exporter
# Admin API
"fastapi>=0.110.0", # FastAPI for admin API
"uvicorn[standard]>=0.27.0", # ASGI server for admin API
"psutil>=5.9.0", # System metrics for admin API
]
[project.scripts]
mxcp = "mxcp.__main__:cli"
[project.optional-dependencies]
# === Development Dependencies ===
dev = [
"pytest",
"pytest-asyncio", # For testing async code
"pytest-cov", # For test coverage
"pytest-mock", # For better mock integration with pytest
"pytest-timeout", # For test timeout protection
"aioresponses", # For mocking HTTP requests
"respx>=0.21.0", # For mocking httpx requests
"black", # For code formatting
"ruff", # For linting and import sorting
"mypy", # For type checking
"types-PyYAML", # Type stubs for PyYAML
"types-psutil", # Type stubs for psutil
"pandas-stubs", # Type stubs for pandas
"build", # For building the package
"twine", # For publishing to PyPI
]
# === SDK Secret Providers (optional) ===
vault = [
"hvac>=2.0.0", # HashiCorp Vault client for mxcp.sdk.core.config.resolvers.vault
]
onepassword = [
"onepassword-sdk>=0.3.0", # 1Password SDK for mxcp.sdk.core.config.resolvers.onepassword
]
# === Everything Optional ===
all = [
# Secret providers
"hvac>=2.0.0",
"onepassword-sdk>=0.3.0",
# Development tools
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"pytest-timeout",
"aioresponses",
"respx>=0.21.0",
"black",
"ruff",
"mypy",
"types-psutil",
"pandas-stubs",
"build",
"twine",
]
[tool.setuptools]
package-dir = {"" = "src"}
packages = [
"mxcp",
"mxcp.runtime", # Extension system - kept at top-level for backward compatibility
"mxcp.plugins", # Plugin system - kept at top-level for backward compatibility
# Server
"mxcp.server",
# Server - Admin API
"mxcp.server.admin",
"mxcp.server.admin.endpoints",
# Server - Core modules
"mxcp.server.core",
"mxcp.server.core.auth",
"mxcp.server.core.config",
"mxcp.server.core.refs",
# Server - Definitions
"mxcp.server.definitions",
"mxcp.server.definitions.endpoints",
"mxcp.server.definitions.evals",
# Server - Executor
"mxcp.server.executor",
"mxcp.server.executor.runners",
# Server - Interfaces
"mxcp.server.interfaces",
"mxcp.server.interfaces.cli",
"mxcp.server.interfaces.server",
# Server - Other core modules
"mxcp.server.schemas",
# Server - Services
"mxcp.server.services",
"mxcp.server.services.audit",
"mxcp.server.services.dbt",
"mxcp.server.services.drift",
"mxcp.server.services.endpoints",
"mxcp.server.services.evals",
"mxcp.server.services.tests",
# SDK
"mxcp.sdk",
"mxcp.sdk.audit",
"mxcp.sdk.audit.backends",
"mxcp.sdk.auth",
"mxcp.sdk.auth.providers",
"mxcp.sdk.core",
"mxcp.sdk.core.analytics",
"mxcp.sdk.core.config",
"mxcp.sdk.core.config.resolvers",
"mxcp.sdk.duckdb",
"mxcp.sdk.evals",
"mxcp.sdk.executor",
"mxcp.sdk.executor.plugins",
"mxcp.sdk.executor.plugins.python_plugin",
"mxcp.sdk.mcp",
"mxcp.sdk.policy",
"mxcp.sdk.telemetry",
"mxcp.sdk.validator",
"mxcp.sdk.validator.decorators",
]
include-package-data = true
[tool.setuptools.package-data]
"mxcp" = ["py.typed"]
"mxcp.server.schemas" = ["*.json"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = "-v"
asyncio_mode = "auto" # Enable async test support
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
]
[tool.black]
line-length = 100
target-version = ["py310"]
extend-exclude = '''
^/examples/
'''
[tool.ruff]
line-length = 100
target-version = "py310"
# Exclude paths from linting
extend-exclude = [
"tests/",
"examples/",
"scripts/",
]
[tool.ruff.lint]
# Enable specific rule categories
select = [
"F", # Pyflakes (includes F401 for unused imports)
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
]
# Ignore specific rules
ignore = [
"E501", # Line too long (handled by black)
"B008", # Do not perform function calls in argument defaults
"SIM108", # Use ternary operator instead of if-else block
]
# Configure import sorting to match previous isort config
[tool.ruff.lint.isort]
known-first-party = ["mxcp"]
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
strict_optional = true
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
strict = true
# Use explicit package bases to avoid duplicate module issues
explicit_package_bases = true
# Tell mypy where to find the source code
packages = ["mxcp"]
# Explicitly set the source directory
mypy_path = "src"
# Exclude test and example directories
exclude = [
"tests/",
"examples/",
"scripts/"
]
[dependency-groups]
dev = [
"mypy>=1.16.1",
"pytest>=8.4.1",
"ruff>=0.12.8",
]
# Overrides removed - tests and examples are excluded above