-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
393 lines (360 loc) · 10.2 KB
/
pyproject.toml
File metadata and controls
393 lines (360 loc) · 10.2 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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
[build-system]
requires = ["hatchling>=1.26.0"]
build-backend = "hatchling.build"
[project]
name = "databeak"
version = "0.1.2"
description = "DataBeak: MCP server for comprehensive CSV file operations with pandas-based tools"
readme = "README.md"
requires-python = ">=3.12"
license = {text = "Apache-2.0"}
authors = [
{name = "Jonathan Springer", email = "jps@s390x.com"},
]
maintainers = [
{name = "Jonathan Springer", email = "jps@s390x.com"},
]
keywords = [
"csv",
"mcp",
"model-context-protocol",
"data-analysis",
"data-manipulation",
"pandas",
"fastmcp",
"data-validation",
"data-quality",
"data-profiling",
"outlier-detection",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Office/Business :: Financial :: Spreadsheet",
"Topic :: Utilities",
"Typing :: Typed",
"Framework :: AsyncIO",
]
dependencies = [
"pandas>=2.2.3",
"numpy>=2.1.3",
"pydantic>=2.10.4",
"aiofiles>=24.1.0",
"python-dateutil>=2.9.0",
"httpx>=0.27.0",
"openpyxl>=3.1.5",
"pyarrow>=17.0.0",
"tabulate>=0.9.0",
"pytz>=2024.2",
"pydantic-settings>=2.10.1",
"psutil>=7.0.0",
"scipy>=1.16.1",
"simpleeval>=1.0.3",
"pandera>=0.26.1",
"fastapi>=0.117.1",
"uvicorn>=0.36.0",
"fastmcp>=2.12.4",
"smithery>=0.4.2",
]
[project.urls]
Homepage = "https://github.com/jonpspri/databeak"
Documentation = "https://github.com/jonpspri/databeak#readme"
Repository = "https://github.com/jonpspri/databeak"
Issues = "https://github.com/jonpspri/databeak/issues"
Changelog = "https://github.com/jonpspri/databeak/blob/main/CHANGELOG.md"
"Release Notes" = "https://github.com/jonpspri/databeak/releases"
[project.scripts]
databeak = "databeak.server:main"
csv = "databeak.server:main" # Legacy alias
sync-versions = "scripts.sync_versions:main" # Version synchronization utility
# Note: We use uv for environment and dependency management
# Hatchling is used only as the build backend for packaging
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/examples",
"README.md",
"LICENSE",
"NOTICE",
"CHANGELOG.md",
"pyproject.toml",
]
exclude = [
"*.pyc",
"__pycache__",
".git",
".github",
".venv",
".env",
".DS_Store",
"*.egg-info",
".pytest_cache",
".mypy_cache",
".ruff_cache",
"htmlcov",
".coverage",
]
[tool.hatch.build.targets.wheel]
packages = ["src/databeak"]
[tool.ruff]
line-length = 100
fix = true
output-format = "grouped"
show-fixes = true
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"ASYNC",# flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"COM", # flake8-commas
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PERF", # Perflint
"PIE", # flake8-pie
"PL", # Pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"T20", # flake8-print
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"D203", # Incompatible with formatter
"D211", "D213", # Incompatible with D203, D212
"E501", # line too long (handled by ruff format)
"COM812", # Missing trailing comma (handled by ruff format)
"RET501", # Copilot and Clyde Code PR reviewers prefer 'return None' to 'return'
"SIM105", # contextlib.suppress is slower that try-except-pass
"SIM108", # Ternary operator - preference
# TODO: Work on bringing these into play
"PLR0911", "PLR0912", "PLR0913", "PLR0915", # Complexity findings that make the AI cry
]
[tool.ruff.lint.per-file-ignores]
# Allow unused arguments, naive datetime, temp files, binding all interfaces, blocking file ops, and assert in tests
"tests/*" = ["ARG", "DTZ", "S108", "S104", "ASYNC230", "S101", "SLF001",
"D", # Docstring requirements (tests don't need comprehensive documentation)
"PLC0415", # Local import
"PLR2004", # Magic numbers are a HUGE part of testing
"RUF043", # Regex in asserts in tests
"RUF059", # Unused unpacked variable
"PT011", # TODO: Revisit post v0.1.0
"TRY300", # TODO: Revisit post v0.1.0
]
"examples/*" = ["T201", "T203", "PL"] # Allow print() in examples
"scripts/*" = [
"T201", "T203", # Allow print() in scripts
"TRY300", # TODO: Revisit post v0.1.0
]
[tool.ruff.lint.isort]
known-first-party = ["src", "databeak"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
[tool.mypy]
python_version = "3.12"
mypy_path = "./src"
namespace_packages = false
explicit_package_bases = false
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_unimported = false
disallow_any_explicit = false
disallow_any_generics = true # From pydantic recommendation
no_implicit_optional = true
no_implicit_reexport = true # From pydantic recommendation
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
show_error_codes = true
strict_equality = true
pretty = true
show_column_numbers = true
show_error_context = true
follow_imports = "silent" # From pydantic recommendation
exclude = ["examples/"]
plugins = [
"pydantic.mypy",
# "pandera.mypy", # TODO: Enable when pre-commit environment supports pandera
]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false # Too many Enums gumming up the works
warn_required_dynamic_aliases = true
[tool.pandera.mypy]
# Enable enhanced DataFrame type checking with Pandera
warn_untyped_dataframes = true
warn_untyped_fields = true
[[tool.mypy.overrides]]
module = [
"fastmcp",
"tabulate",
"openpyxl",
"pyarrow",
"numexpr",
"bottleneck",
"fastparquet",
"pytest",
"simpleeval",
"smithery",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["tests.*", "tests.unit.*", "tests.integration.*", "tests.security.*"]
disallow_untyped_defs = true
disallow_any_explicit = true
#disable_error_code = ["arg-type", "no-untyped-def"]
check_untyped_defs = true
[[tool.mypy.overrides]]
module = "examples.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "src.databeak.models.pandera_schemas"
ignore_errors = true # Complex Pandera/FastMCP type compatibility - TODO: resolve in future PR
[[tool.mypy.overrides]]
module = "tests.unit.models.test_pandera_schemas"
ignore_errors = true # Pandera not available in pre-commit environment
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["./tests"]
pythonpath = ["./src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "module"
asyncio_default_test_loop_scope = "module"
addopts = [
"--strict-markers",
"--tb=short",
"--verbose",
"--color=yes",
"-ra",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"asyncio: marks tests as async",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
[tool.coverage.run]
source = ["src"]
branch = true
parallel = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/site-packages/*",
"src/databeak/__main__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"pass",
"@abstractmethod",
"@abc.abstractmethod",
]
precision = 2
show_missing = true
skip_covered = false
skip_empty = true
sort = "Cover"
fail_under = 80
[tool.coverage.html]
directory = "htmlcov"
title = "DataBeak Coverage Report"
[tool.coverage.json]
output = "coverage.json"
pretty_print = true
# Markdown formatting
[tool.mdformat]
wrap = 80
number = true
end_of_line = "lf"
# Documentation
[tool.mkdocs]
site_name = "DataBeak"
site_description = "Comprehensive CSV manipulation and analysis via Model Context Protocol"
site_author = "Santosh Ray"
repo_url = "https://github.com/jonpspri/databeak"
repo_name = "databeak"
[tool.smithery]
server = "databeak.server:create_server"
[dependency-groups]
dev = [
"mdformat>=0.7.22",
"mdformat-frontmatter>=2.0.8",
"mdformat-gfm>=0.4.1",
"mdformat-ruff>=0.1.3",
"mkdocs>=1.6.1",
"mkdocs-material>=9.6.18",
"mkdocs-mermaid2-plugin>=1.2.2",
"mkdocstrings[python]>=0.30.0",
"mypy>=1.17.1",
"pandas-stubs>=2.3.0",
"pre-commit>=4.3.0",
"pymarkdownlnt>=0.9.32",
"pytest>=8.4.2",
"pytest-asyncio>=1.1.0",
"pytest-cov>=6.2.1",
"pytest-xdist>=3.8.0",
"ruff>=0.12.10",
"twine>=6.1.0",
"ty>=0.0.1a21",
"types-aiofiles>=24.1.0.20250822",
"types-jsonschema>=4.25.1.20250822",
"types-psutil>=7.0.0.20250822",
"types-pytz>=2025.2.0.20250809",
"types-tabulate>=0.9.0.20241207",
]
# Pre-commit hooks configuration (for reference)
# Create .pre-commit-config.yaml separately