-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
130 lines (116 loc) · 3.17 KB
/
pyproject.toml
File metadata and controls
130 lines (116 loc) · 3.17 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
[project]
name = "pymcp-template"
version = "0.2.3"
description = "A template for developing MCP servers in Python"
readme = "README.md"
license = "MIT"
license-files = ["LICEN[CS]E*"]
authors = [
{ name = "Anirban Basu", email = "anirbanbasu@users.noreply.github.com" }
]
keywords = ["python3", "example", "server", "model-context-protocol-server", "mcp-server"]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"ddgs>=9.5.4",
"environs>=14.3.0",
"fastmcp",
"pydantic-monty>=0.0.4",
]
[project.scripts]
pymcp = "pymcp.server:main"
[tool.hatch.build.targets.wheel]
packages = ["src/pymcp"]
[tool.uv.sources]
fastmcp = { git = "https://github.com/jlowin/fastmcp.git" }
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = [
"icecream>=2.1.8",
"ty>=0.0.1a29",
]
test = [
"coverage>=7.9.1",
"pytest>=8.4.1",
]
[tool.ty.rules]
possibly-unresolved-reference = "warn"
# Keyword argument expansion is not supported by ty yet? https://github.com/astral-sh/ty/issues/247
invalid-argument-type = "ignore"
[tool.ty.environment]
python-version = "3.12"
[tool.ruff]
line-length = 120
target-version = "py312"
include = [
"src/pymcp/**/*.py",
"tests/**/*.py",
"docs/**/*.py",
]
[tool.ruff.lint]
extend-select = [
"Q",
"RUF100",
"RUF018", # https://docs.astral.sh/ruff/rules/assignment-in-assert/
"C90",
"UP",
"I",
"D",
"TID251",
]
# flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
mccabe = { max-complexity = 15 }
ignore = [
"D100", # ignore missing docstring in module
"D102", # ignore missing docstring in public method
"D104", # ignore missing docstring in public package
"D105", # ignore missing docstring in magic methods
"D107", # ignore missing docstring in __init__ methods
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["pymcp"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
# don't format python in docstrings, pytest-examples takes care of it
docstring-code-format = false
# quote-style = "single"
[tool.coverage.run]
omit = [
"tests/*", # Excludes all files and subdirectories within a 'tests' directory at the project root
]
[tool.coverage.report]
fail_under = 100
skip_covered = true
show_missing = true
ignore_errors = true
precision = 2
exclude_lines = [
# `# pragma: no cover` is standard marker for code that's not covered, this will error if code is covered
'pragma: no cover',
# use `# pragma: lax no cover` if you want to ignore cases where (some of) the code is covered
'pragma: lax no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@deprecated',
'@typing.overload',
'@abstractmethod',
'\(Protocol\):$',
'typing.assert_never',
'$\s*assert_never\(',
'if __name__ == .__main__.:',
'except ImportError as _import_error:',
'$\s*pass$',
'assert False',
]