Skip to content

Commit 15e06ce

Browse files
committed
Merge branch 'main' into feat/sep-2207
2 parents ba50af6 + 62eb08e commit 15e06ce

File tree

161 files changed

+5509
-6712
lines changed

Some content is hidden

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

161 files changed

+5509
-6712
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v6
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
fetch-depth: 1
2525

2626
- name: Run Claude Code Review
2727
id: claude-review
28-
uses: anthropics/claude-code-action@v1
28+
uses: anthropics/claude-code-action@2f8ba26a219c06cfb0f468eef8d97055fa814f97 # v1.0.53
2929
with:
3030
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3131
plugin_marketplaces: "https://github.com/anthropics/claude-code.git"

.github/workflows/claude.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
actions: read # Required for Claude to read CI results on PRs
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131
with:
3232
fetch-depth: 1
3333

3434
- name: Run Claude Code
3535
id: claude
36-
uses: anthropics/claude-code-action@v1
36+
uses: anthropics/claude-code-action@2f8ba26a219c06cfb0f468eef8d97055fa814f97 # v1.0.53
3737
with:
3838
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3939
use_commit_signing: true

.github/workflows/publish-docs-manually.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ jobs:
3131
3232
- run: uv sync --frozen --group docs
3333
- run: uv run --frozen --no-sync mkdocs gh-deploy --force
34+
env:
35+
ENABLE_SOCIAL_CARDS: "true"

.github/workflows/shared.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@ jobs:
2626
with:
2727
extra_args: --all-files --verbose
2828
env:
29-
SKIP: no-commit-to-branch
29+
SKIP: no-commit-to-branch,readme-v1-frozen
30+
31+
# TODO(Max): Drop this in v2.
32+
- name: Check README.md is not modified
33+
if: github.event_name == 'pull_request'
34+
run: |
35+
git fetch --no-tags --depth=1 origin "$BASE_SHA"
36+
if git diff --name-only "$BASE_SHA" -- README.md | grep -q .; then
37+
echo "::error::README.md is frozen at v1. Edit README.v2.md instead."
38+
exit 1
39+
fi
40+
env:
41+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
3042

3143
test:
3244
name: test (${{ matrix.python-version }}, ${{ matrix.dep-resolution.name }}, ${{ matrix.os }})
@@ -58,6 +70,7 @@ jobs:
5870
- name: Run pytest with coverage
5971
shell: bash
6072
run: |
73+
uv run --frozen --no-sync coverage erase
6174
uv run --frozen --no-sync coverage run -m pytest -n auto
6275
uv run --frozen --no-sync coverage combine
6376
uv run --frozen --no-sync coverage report

.github/workflows/weekly-lockfile-update.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
update-lockfile:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

19-
- uses: astral-sh/setup-uv@v7.2.1
19+
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
2020
with:
2121
version: 0.9.5
2222

@@ -32,6 +32,7 @@ jobs:
3232
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7
3333
with:
3434
commit-message: "chore: update uv.lock with latest dependencies"
35+
sign-commits: true
3536
title: "chore: weekly dependency update"
3637
body-path: pr_body.md
3738
branch: weekly-lockfile-update

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ repos:
5555
language: system
5656
files: ^(pyproject\.toml|uv\.lock)$
5757
pass_filenames: false
58+
# TODO(Max): Drop this in v2.
59+
- id: readme-v1-frozen
60+
name: README.md is frozen (v1 docs)
61+
entry: README.md is frozen at v1. Edit README.v2.md instead.
62+
language: fail
63+
files: ^README\.md$
5864
- id: readme-snippets
5965
name: Check README snippets are up to date
6066
entry: uv run --frozen python scripts/update_readme_snippets.py --check

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ This document contains critical information about working with this codebase. Fo
2828
- Bug fixes require regression tests
2929
- IMPORTANT: The `tests/client/test_client.py` is the most well designed test file. Follow its patterns.
3030
- IMPORTANT: Be minimal, and focus on E2E tests: Use the `mcp.client.Client` whenever possible.
31+
- Coverage: CI requires 100% (`fail_under = 100`, `branch = true`).
32+
- Full check: `./scripts/test` (~20s, matches CI exactly)
33+
- Targeted check while iterating:
34+
35+
```bash
36+
uv run --frozen coverage erase
37+
uv run --frozen coverage run -m pytest tests/path/test_foo.py
38+
uv run --frozen coverage combine
39+
uv run --frozen coverage report --include='src/mcp/path/foo.py' --fail-under=0
40+
```
41+
42+
Partial runs can't hit 100% (coverage tracks `tests/` too), so `--fail-under=0`
43+
and `--include` scope the report to what you actually changed.
44+
- Avoid `anyio.sleep()` with a fixed duration to wait for async operations. Instead:
45+
- Use `anyio.Event` — set it in the callback/handler, `await event.wait()` in the test
46+
- For stream messages, use `await stream.receive()` instead of `sleep()` + `receive_nowait()`
47+
- Exception: `sleep()` is appropriate when testing time-based features (e.g., timeouts)
48+
- Wrap indefinite waits (`event.wait()`, `stream.receive()`) in `anyio.fail_after(5)` to prevent hangs
3149
3250
Test files mirror the source tree: `src/mcp/client/streamable_http.py` → `tests/client/test_streamable_http.py`
3351
Add tests to the existing file for that module.

0 commit comments

Comments
 (0)