-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (217 loc) · 7.48 KB
/
Copy pathpyproject.toml
File metadata and controls
240 lines (217 loc) · 7.48 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
[project]
name = "rmcp"
# The git tag is the version -- derived from the latest v* tag by
# uv-dynamic-versioning. No bump commits, no version edits.
dynamic = ["version"]
description = "Model Context Protocol server bringing R statistical analysis to Claude Desktop and Claude web, over stdio and Streamable HTTP"
authors = [{name = "Gaurav Sood", email = "gsood07@gmail.com"}]
license = {text = "MIT"}
readme = "README.md"
keywords = ["mcp", "r", "statistics", "econometrics", "model-context-protocol", "data-analysis", "http", "fastapi", "sse", "configuration", "claude-web", "connector", "anthropic"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: R",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
]
requires-python = ">=3.11"
dependencies = [
"click>=8.1.0", # CLI interface
"jsonschema>=4.0.0", # Schema validation
"mcp>=2,<3", # Official MCP SDK (protocol, stdio + Streamable HTTP)
"psutil>=5.0.0", # R process management
"uvicorn>=0.31.1", # ASGI server for the Streamable HTTP transport
"structlog>=23.1.0", # Structured logging for MCP observability
# subprocess module is built-in for Python 3.8+
]
[project.optional-dependencies]
# The Streamable HTTP transport ships with the base install (via the mcp SDK).
# These extras carry test/data tooling only; kept for install compatibility.
http = [
"httpx>=0.25.0",
"pandas>=1.5.0", # Test Excel file creation
"openpyxl>=3.0.0", # Test Excel support
]
all = [
"httpx>=0.25.0",
"pandas>=1.5.0", # Test Excel file creation
"openpyxl>=3.0.0", # Test Excel support
]
[dependency-groups]
# Hybrid approach: Docker for R integration, uv for cross-platform Python testing
dev = [
# Development and testing tools
"pytest>=8.2.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"ruff>=0.4.0",
"pre-commit>=3.8.0",
"pydoclint>=0.3.0",
"pyright>=1.1.0",
# Test scaffolding dependencies (what tests actually import)
"httpx>=0.25.0", # For HTTP transport tests
"pandas>=1.5.0", # For Excel test scenario creation
"openpyxl>=3.0.0", # For Excel test support
"numpy>=1.21.0", # For Docker test validation
]
docs = [
# Documentation build dependencies
"sphinx>=5.0.0",
"furo>=2024.0.0",
"myst-parser>=0.18.0",
# Additional Sphinx extensions used in conf.py
"sphinx-copybutton>=0.5.0",
# MyST extensions
"linkify-it-py>=2.0.0",
]
[project.scripts]
rmcp = "rmcp.cli:cli"
[project.urls]
Homepage = "https://github.com/finite-sample/rmcp"
Repository = "https://github.com/finite-sample/rmcp"
Documentation = "https://github.com/finite-sample/rmcp#readme"
Issues = "https://github.com/finite-sample/rmcp/issues"
[build-system]
requires = ["hatchling>=1.27", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
# The Docker build copies only pyproject.toml and rmcp/ (.dockerignore
# excludes .git), so there is no repository to read a tag from. Without a
# fallback the backend raises "This does not appear to be a Git project" and
# the image build fails. Release builds run in a full checkout and derive the
# real version from the tag; the publish workflow asserts that it matches.
fallback-version = "0.0.0"
# Flat layout: the package lives at the repo root, not under src/.
[tool.hatch.build.targets.wheel]
packages = ["rmcp"]
[tool.hatch.build.targets.sdist]
include = ["rmcp", "README.md", "LICENSE", "CHANGELOG.md"]
# uv_build packaged from the working directory, so local Finder metadata
# could reach a distribution. Keep it out explicitly.
[tool.hatch.build]
exclude = ["**/.DS_Store"]
# Tool configurations
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
"--strict-config",
]
filterwarnings = [
# A test that returns instead of asserting silently passes no matter what
# it computed. Make that a hard failure rather than a warning.
"error::pytest.PytestReturnNotNoneWarning",
]
asyncio_mode = "auto"
# asyncio_default_fixture_loop_scope removed for backwards compatibility with older pytest-asyncio versions
markers = [
"asyncio: marks tests as async",
"local: marks tests that require local IDE setup (not run in CI)",
]
[tool.ruff]
line-length = 88
target-version = "py311"
src = ["rmcp", "tests", "docs", "streamlit"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by formatter
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"B904", # raise ... from err - not needed for our error patterns
"E722", # bare except - allowed in test cleanup
"E402", # module level import not at top - conditional imports needed
"B023", # function definition does not bind loop variable - false positive
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pydoclint]
style = "google"
exclude = [
"tests/",
"scripts/",
"streamlit/",
]
require-return-section-when-returning-nothing = false
check-return-types = false
check-yield-types = false
arg-type-hints-in-docstring = false
[tool.pyright]
include = ["rmcp"]
exclude = [
"tests/",
"scripts/",
"streamlit/",
"**/__pycache__",
]
pythonVersion = "3.11"
typeCheckingMode = "basic"
useLibraryCodeForTypes = true
reportMissingImports = true
reportMissingTypeStubs = false
reportUntypedFunctionDecorator = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnknownMemberType = false
[tool.coverage.run]
source = ["rmcp"]
omit = [
"*/tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.deptry]
pep621_dev_dependency_groups = ["dev"]
extend_exclude = [
"scripts/", # Development scripts have their own dependency scope
"streamlit/", # Streamlit app is optional component
"tests/scenarios/test_deployment_scenarios.py", # Tests all optional deps
]
[tool.deptry.per_rule_ignores]
DEP002 = ["httpx", "pandas", "openpyxl"] # Test-only dependencies via pandas backend
DEP003 = ["requests", "anthropic"] # Transitive dependencies we import directly
DEP001 = ["package_whitelist_comprehensive"] # Internal module
DEP004 = ["pytest", "numpy"] # Dev dependencies in scripts/streamlit
[tool.deptry.package_module_name_map]
structlog = "structlog"
linkify-it-py = "linkify_it_py"