Skip to content

Commit 9eb6108

Browse files
authored
Merge branch 'main' into client_notif_support
2 parents 4734bf7 + 720d713 commit 9eb6108

File tree

119 files changed

+1043
-1090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1043
-1090
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Applied 120 line-length rule to all files: https://github.com/modelcontextprotocol/python-sdk/pull/856
22
543961968c0634e93d919d509cce23a1d6a56c21
3+
4+
# Added 100% code coverage baseline with pragma comments: https://github.com/modelcontextprotocol/python-sdk/pull/1553
5+
89e9c43acf7e23cf766357d776ec1ce63ac2c58e

.gitattribute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Generated
2-
uv.lock linguist-generated=true
2+
uv.lock linguist-generated=true

.github/workflows/shared.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ jobs:
5555
- name: Install the project
5656
run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}
5757

58-
- name: Run pytest
59-
run: uv run ${{ matrix.dep-resolution.install-flags }} --no-sync pytest
58+
- name: Run pytest with coverage
59+
run: |
60+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage run -m pytest
61+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage combine
62+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage report
6063
env:
6164
UV_RESOLUTION: ${{ matrix.dep-resolution.name == 'lowest-direct' && 'lowest-direct' || 'highest' }}
6265

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
fail_fast: true
22

33
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: end-of-file-fixer
8+
49
- repo: https://github.com/pre-commit/mirrors-prettier
510
rev: v3.1.0
611
hooks:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dotenv>=1.0.0
22
requests>=2.31.0
33
mcp>=1.0.0
4-
uvicorn>=0.32.1
4+
uvicorn>=0.32.1

examples/clients/simple-chatbot/mcp_simple_chatbot/servers_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
1010
}
1111
}
12-
}
12+
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dev = [
6060
"pytest-pretty>=1.2.0",
6161
"inline-snapshot>=0.23.0",
6262
"dirty-equals>=0.9.0",
63+
"coverage[toml]==7.10.7",
6364
]
6465
docs = [
6566
"mkdocs>=1.6.1",
@@ -168,3 +169,40 @@ MD033 = false # no-inline-html Inline HTML
168169
MD041 = false # first-line-heading/first-line-h1
169170
MD046 = false # indented-code-blocks
170171
MD059 = false # descriptive-link-text
172+
173+
# https://coverage.readthedocs.io/en/latest/config.html#run
174+
[tool.coverage.run]
175+
branch = true
176+
patch = ["subprocess"]
177+
concurrency = ["multiprocessing", "thread"]
178+
source = ["src", "tests"]
179+
relative_files = true
180+
omit = [
181+
"src/mcp/client/__main__.py",
182+
"src/mcp/server/__main__.py",
183+
"src/mcp/os/posix/utilities.py",
184+
"src/mcp/os/win32/utilities.py",
185+
]
186+
187+
# https://coverage.readthedocs.io/en/latest/config.html#report
188+
[tool.coverage.report]
189+
fail_under = 100
190+
skip_covered = true
191+
show_missing = true
192+
ignore_errors = true
193+
precision = 2
194+
exclude_lines = [
195+
"pragma: no cover",
196+
"if TYPE_CHECKING:",
197+
"@overload",
198+
"raise NotImplementedError",
199+
"^\\s*\\.\\.\\.\\s*$",
200+
]
201+
202+
# https://coverage.readthedocs.io/en/latest/config.html#paths
203+
[tool.coverage.paths]
204+
source = [
205+
"src/",
206+
"/home/runner/work/python-sdk/python-sdk/src/",
207+
'D:\a\python-sdk\python-sdk\src',
208+
]

0 commit comments

Comments
 (0)