mcp-server-espn 2.3.0__tar.gz → 2.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_server_espn-2.3.2/.github/dependabot.yml +67 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/.github/workflows/ci.yml +53 -1
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/.github/workflows/dependabot-automerge.yml +30 -4
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/AGENTS.md +5 -5
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/CONTRIBUTING.md +1 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/Dockerfile +10 -3
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/PKG-INFO +3 -3
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/fastmcp.json +2 -2
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/pyproject.toml +13 -6
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/gen_build_backend.py +92 -5
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/setup_repo_governance.sh +4 -5
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/client.py +332 -13
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/conftest.py +32 -2
- mcp_server_espn-2.3.2/tests/test_build_backend_lock.py +325 -0
- mcp_server_espn-2.3.2/tests/test_ci_workflow.py +123 -0
- mcp_server_espn-2.3.2/tests/test_conftest_live_gate.py +104 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_dockerfile.py +9 -5
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_e2e_isolation.py +7 -7
- mcp_server_espn-2.3.2/tests/test_fastmcp_json_floor.py +151 -0
- mcp_server_espn-2.3.0/tests/test_e2e_live.py → mcp_server_espn-2.3.2/tests/test_live.py +6 -6
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_retry_after.py +112 -14
- mcp_server_espn-2.3.2/tests/test_upstream_http_errors.py +632 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/uv.lock +42 -41
- mcp_server_espn-2.3.0/.github/dependabot.yml +0 -41
- mcp_server_espn-2.3.0/skills/espn-mcp/SKILL.md +0 -115
- mcp_server_espn-2.3.0/tests/test_build_backend_lock.py +0 -145
- mcp_server_espn-2.3.0/tests/test_fastmcp_json_floor.py +0 -75
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/.github/CODEOWNERS +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/.github/workflows/release.yml +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/.gitignore +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/CHANGELOG.md +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/CODE_OF_CONDUCT.md +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/LICENSE +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/README.md +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/SECURITY.md +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/conformance-baseline.yml +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/docker/build-backend.txt +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/docker/pip-bootstrap.txt +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/docker/uv-bootstrap.txt +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/check_conformance.sh +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/check_openapi_drift.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/check_tool_contract.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/check_version.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/scripts/release_notes.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/server.json +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/__init__.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/auth.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/config.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/errors.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/middleware.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/server.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/tools/__init__.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/tools/games.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/tools/news.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/tools/params.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/src/espn_mcp/tools/teams.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/fake_network.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/fixtures/mlb_yankees_schedule_2023.json +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_check_version.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_client.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_config.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_drift.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_errors.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_eval_search_fixes.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_http_auth.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_layered.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_league_events_dates.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_otel_spans.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_protocol.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_redaction.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_redaction_linear.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_redaction_probes.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_redaction_python_repr.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_release_notes.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_release_workflow.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_scoreboard_date_ranges.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_server.py +0 -0
- {mcp_server_espn-2.3.0 → mcp_server_espn-2.3.2}/tests/test_version.py +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "uv"
|
|
4
|
+
directory: "/"
|
|
5
|
+
# Generated from uv.lock by scripts/gen_build_backend.py. The uv scan treats
|
|
6
|
+
# requirements-shaped *.txt files as pip manifests, so ignore this one.
|
|
7
|
+
# Lock bumps still land in uv.lock; regenerate the file with the script.
|
|
8
|
+
exclude-paths:
|
|
9
|
+
- "docker/build-backend.txt"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
day: "sunday"
|
|
13
|
+
time: "09:30"
|
|
14
|
+
timezone: "America/New_York"
|
|
15
|
+
open-pull-requests-limit: 10
|
|
16
|
+
groups:
|
|
17
|
+
dependencies:
|
|
18
|
+
patterns:
|
|
19
|
+
- "*"
|
|
20
|
+
python-security:
|
|
21
|
+
applies-to: "security-updates"
|
|
22
|
+
patterns:
|
|
23
|
+
- "*"
|
|
24
|
+
update-types:
|
|
25
|
+
- "minor"
|
|
26
|
+
- "patch"
|
|
27
|
+
|
|
28
|
+
- package-ecosystem: "github-actions"
|
|
29
|
+
directory: "/"
|
|
30
|
+
schedule:
|
|
31
|
+
interval: "weekly"
|
|
32
|
+
day: "sunday"
|
|
33
|
+
time: "09:30"
|
|
34
|
+
timezone: "America/New_York"
|
|
35
|
+
open-pull-requests-limit: 10
|
|
36
|
+
groups:
|
|
37
|
+
actions:
|
|
38
|
+
patterns:
|
|
39
|
+
- "*"
|
|
40
|
+
actions-security:
|
|
41
|
+
applies-to: "security-updates"
|
|
42
|
+
patterns:
|
|
43
|
+
- "*"
|
|
44
|
+
update-types:
|
|
45
|
+
- "minor"
|
|
46
|
+
- "patch"
|
|
47
|
+
|
|
48
|
+
- package-ecosystem: "docker"
|
|
49
|
+
directory: "/"
|
|
50
|
+
schedule:
|
|
51
|
+
interval: "weekly"
|
|
52
|
+
day: "saturday"
|
|
53
|
+
time: "09:30"
|
|
54
|
+
timezone: "America/New_York"
|
|
55
|
+
open-pull-requests-limit: 10
|
|
56
|
+
ignore:
|
|
57
|
+
# Keep python 3.12; a Python minor upgrade is a separate decision. Digest updates still come through.
|
|
58
|
+
- dependency-name: "python"
|
|
59
|
+
update-types: ["version-update:semver-minor", "version-update:semver-major"]
|
|
60
|
+
groups:
|
|
61
|
+
docker-security:
|
|
62
|
+
applies-to: "security-updates"
|
|
63
|
+
patterns:
|
|
64
|
+
- "*"
|
|
65
|
+
update-types:
|
|
66
|
+
- "minor"
|
|
67
|
+
- "patch"
|
|
@@ -101,6 +101,23 @@ jobs:
|
|
|
101
101
|
- name: Run unit test suite
|
|
102
102
|
run: uv run pytest
|
|
103
103
|
|
|
104
|
+
# One required check for the whole matrix. The name stays "Tests" when a
|
|
105
|
+
# Python version is added or removed, so branch protection does not change
|
|
106
|
+
# with the matrix. It runs even when a leg fails and fails unless every leg
|
|
107
|
+
# succeeded.
|
|
108
|
+
tests:
|
|
109
|
+
name: Tests
|
|
110
|
+
needs: test
|
|
111
|
+
if: always()
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
steps:
|
|
114
|
+
- name: Fail unless the test matrix succeeded
|
|
115
|
+
run: |
|
|
116
|
+
if [ "${{ needs.test.result }}" != "success" ]; then
|
|
117
|
+
echo "test matrix result: ${{ needs.test.result }}"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
104
121
|
tool-contract:
|
|
105
122
|
name: Tool contract assertions
|
|
106
123
|
runs-on: ubuntu-latest
|
|
@@ -135,11 +152,36 @@ jobs:
|
|
|
135
152
|
- name: Protocol & stdio verification
|
|
136
153
|
run: uv run pytest tests/test_protocol.py --no-cov
|
|
137
154
|
|
|
155
|
+
conformance:
|
|
156
|
+
name: Protocol conformance
|
|
157
|
+
runs-on: ubuntu-latest
|
|
158
|
+
steps:
|
|
159
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
160
|
+
with:
|
|
161
|
+
fetch-depth: 0
|
|
162
|
+
persist-credentials: false
|
|
163
|
+
|
|
164
|
+
- name: Install uv
|
|
165
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
166
|
+
with:
|
|
167
|
+
# Newest uv that meets pyproject.toml's [tool.uv] required-version (>=0.13.4, from
|
|
168
|
+
# FastMCP's October 2026 certificate authority incident notice).
|
|
169
|
+
version-file: "pyproject.toml"
|
|
170
|
+
enable-cache: true
|
|
171
|
+
|
|
172
|
+
- name: Set up Python
|
|
173
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
174
|
+
with:
|
|
175
|
+
python-version: "3.11"
|
|
176
|
+
|
|
138
177
|
- name: Set up Node.js 22
|
|
139
178
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
140
179
|
with:
|
|
141
180
|
node-version: "22"
|
|
142
181
|
|
|
182
|
+
- name: Install dependencies
|
|
183
|
+
run: uv sync --locked --extra dev --python 3.11
|
|
184
|
+
|
|
143
185
|
- name: Protocol conformance suite
|
|
144
186
|
run: ./scripts/check_conformance.sh
|
|
145
187
|
|
|
@@ -177,7 +219,7 @@ jobs:
|
|
|
177
219
|
run: uv run twine check dist/*
|
|
178
220
|
|
|
179
221
|
docker-build:
|
|
180
|
-
name: Container
|
|
222
|
+
name: Container image build
|
|
181
223
|
runs-on: ubuntu-latest
|
|
182
224
|
steps:
|
|
183
225
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
@@ -192,6 +234,16 @@ jobs:
|
|
|
192
234
|
load: true
|
|
193
235
|
tags: mcp-server-ci:test
|
|
194
236
|
|
|
237
|
+
- name: Image label matches server.json name
|
|
238
|
+
run: |
|
|
239
|
+
EXPECTED="$(jq -r .name server.json)"
|
|
240
|
+
ACTUAL="$(docker inspect --format '{{ index .Config.Labels "io.modelcontextprotocol.server.name" }}' mcp-server-ci:test)"
|
|
241
|
+
if [ "$ACTUAL" != "$EXPECTED" ]; then
|
|
242
|
+
echo "::error::image label '${ACTUAL}' does not match server.json name '${EXPECTED}'"
|
|
243
|
+
exit 1
|
|
244
|
+
fi
|
|
245
|
+
echo "Image label matches ${EXPECTED}"
|
|
246
|
+
|
|
195
247
|
- name: Runtime image has the project and no build backend
|
|
196
248
|
# The builder installs the build backend to /tmp/build-backend, outside the venv the
|
|
197
249
|
# runtime stage copies. These are build-only packages, and this repo's lock has none of
|
|
@@ -18,9 +18,18 @@ jobs:
|
|
|
18
18
|
# The PR author, not github.actor (the last actor on the event, which can be spoofed),
|
|
19
19
|
# and only for branches in this repository.
|
|
20
20
|
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == github.event.pull_request.head.repo.full_name
|
|
21
|
+
# Wait for the CI run on the pull request head, then squash-merge that exact
|
|
22
|
+
# commit. This does not use `gh pr merge --auto`. With branch protection, the
|
|
23
|
+
# required checks still gate the merge; without it, the wait is what keeps an
|
|
24
|
+
# untested commit off the default branch. `--match-head-commit` refuses the
|
|
25
|
+
# merge if the head moved after CI ran.
|
|
26
|
+
# A merge made with GITHUB_TOKEN does not trigger the push CI workflow. The
|
|
27
|
+
# weekly schedule on the CI workflow still tests the default branch.
|
|
28
|
+
timeout-minutes: 30
|
|
21
29
|
permissions:
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
actions: read # find and watch the CI run for the PR head
|
|
31
|
+
contents: write # squash the PR into main after CI succeeds
|
|
32
|
+
pull-requests: write # merge the PR
|
|
24
33
|
steps:
|
|
25
34
|
- name: Dependabot metadata
|
|
26
35
|
id: metadata
|
|
@@ -42,12 +51,29 @@ jobs:
|
|
|
42
51
|
# Allowlist, not a major-version denylist: update-type is the highest change in the PR
|
|
43
52
|
# (a grouped PR with one major is skipped), and it is empty when the PR carries a
|
|
44
53
|
# non-Dependabot commit, so only minor and patch updates are auto-merged.
|
|
45
|
-
|
|
54
|
+
# A failed or cancelled CI run fails this step and nothing merges. --match-head-commit
|
|
55
|
+
# refuses the merge if the PR head moved after CI ran.
|
|
56
|
+
- name: Merge semver-minor and semver-patch updates after CI succeeds
|
|
46
57
|
if: >-
|
|
47
58
|
steps.metadata.outputs.package-ecosystem != 'docker' &&
|
|
48
59
|
(steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
|
49
60
|
steps.metadata.outputs.update-type == 'version-update:semver-patch')
|
|
50
|
-
run:
|
|
61
|
+
run: |
|
|
62
|
+
run_id=""
|
|
63
|
+
for _ in $(seq 1 30); do
|
|
64
|
+
run_id="$(gh run list --repo "$REPO" --workflow ci.yml --event pull_request \
|
|
65
|
+
--commit "$HEAD_SHA" --limit 1 --json databaseId --jq '.[0].databaseId // empty')"
|
|
66
|
+
if [ -n "$run_id" ]; then break; fi
|
|
67
|
+
sleep 10
|
|
68
|
+
done
|
|
69
|
+
if [ -z "$run_id" ]; then
|
|
70
|
+
echo "::error::No CI run found for $HEAD_SHA"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
gh run watch "$run_id" --repo "$REPO" --exit-status --interval 10
|
|
74
|
+
gh pr merge --squash --match-head-commit "$HEAD_SHA" "$PR_URL"
|
|
51
75
|
env:
|
|
52
76
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
77
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
78
|
+
REPO: ${{ github.repository }}
|
|
53
79
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -49,8 +49,8 @@ Both ecosystems publish live, queryable Documentation MCP servers exposing full
|
|
|
49
49
|
- `scripts/check_tool_contract.py` — source of truth for the expected tool set and annotations. Do not hard-code tool counts elsewhere.
|
|
50
50
|
- `scripts/check_openapi_drift.py`, `scripts/check_conformance.sh` + `conformance-baseline.yml`.
|
|
51
51
|
- `scripts/release_notes.py` — release body from squash commits since the previous `v*` tag. `scripts/check_version.py` — runs after `uv build` and reads the version from the single wheel in `dist/` (the file that ships, as release.yml's tag check does); fails on `0.0.0` (no git metadata) or `0.0.1.devN` (no reachable tag, a shallow checkout).
|
|
52
|
-
- `tests/` — offline unit, layered-composition, and protocol tests; `
|
|
53
|
-
- `.github/workflows/` — `ci.yml` (
|
|
52
|
+
- `tests/` — offline unit, layered-composition, and protocol tests; `test_live.py` is opt-in (`uv run pytest -m live --no-cov`). The public ESPN API needs no credential, so `-m live` runs that sweep unskipped.
|
|
53
|
+
- `.github/workflows/` — `ci.yml` (Lint and types, Tests on py3.11–3.14 plus an aggregate Tests check, Tool contract assertions with OpenAPI drift and stdio verification, Protocol conformance, Build and package check, Container image build, and Check API Drift on `drift-check` for scheduled and manual runs only), `release.yml` (on a `v*` tag, five jobs: `build` (contents: read) builds with full history, checks the wheel version matches the tag, builds the release notes, checks the packages and the SBOM; `publish` (id-token and contents: write) uploads to PyPI and creates the GitHub Release from `scripts/release_notes.py` with the wheel, sdist and SBOM; `docker` (packages: write) pushes the GHCR image with no buildx provenance or SBOM and exposes its digest; `attest` (the only job with attestations: write) attests `dist/*` and the image digest; `registry` publishes to the MCP Registry last, with the tag version stamped into `server.json`), `dependabot-automerge.yml` (waits for CI, then squash-merges that head commit, only for Dependabot PRs whose highest update is minor or patch; major updates wait for a human review; Docker base image updates always wait for review).
|
|
54
54
|
- `server.json` (MCP Registry metadata), `Dockerfile`, `fastmcp.json`, `pyproject.toml` (console scripts `mcp-server-espn`, which must equal the `server.json` identifier, and `espn-mcp`, which the README configs and Dockerfile run).
|
|
55
55
|
|
|
56
56
|
---
|
|
@@ -81,9 +81,10 @@ Both ecosystems publish live, queryable Documentation MCP servers exposing full
|
|
|
81
81
|
- All errors and logs pass through regex redaction (`_redact_secrets`). PEM blocks run from `-----BEGIN <label>-----` to the `-----END <label>-----` with the same label (any case; an END with another label does not end it), and a `-----BEGIN` with no matching END is masked to the end of the text. A `{...}`/`[...]`/`(...)` value after a credential key or a token key, quoted or not (a Python `repr` such as `{'api_key': ['x']}` or `{'api_key': ('a', 'x')}`), is masked to its balanced bracket, with brackets inside double- or single-quoted strings skipped (or the end of the line when it never balances); a bare number, `True` or word under a quoted key (`{'password': 12345}`) is masked, `None`/`null` stays, and `next_token`/`page_token`/`max_tokens` are untouched. A single-quoted value that contains a newline is masked only to the end of its line (a known limit), with bracket scans cached so many unbalanced values cost one pass. In `redact_message`, a tuple is masked whole when a credential key sits in the 256 characters before its `(`, and a `(` never counts toward the cap; once 64 brackets have failed to parse (abusive input), the rest of the message is masked. A flood of `(` right after `:` or `=` costs about 25 times more per byte than plain text, because each one checks the 256 characters before it for a key; it stays linear and nothing leaks, but hundreds of KB of it take seconds (a known limit). A value on the line after `password=` (or any credential key) is not masked (a known limit).
|
|
82
82
|
3. **Multi-Stage Non-Root Containers**:
|
|
83
83
|
- `Dockerfile` runs as non-root `USER mcp` with virtual environment `/opt/venv` and `ENTRYPOINT ["espn-mcp"]`.
|
|
84
|
+
- Base image: `python:3.12-slim-trixie AS builder` → runtime, pinned by digest (both stages share the same pin); glibc is keyed by the Debian release in the tag, not the digest.
|
|
84
85
|
- Trust stores follow FastMCP's [certificate authority incident notice (October 2026)](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026): both stages upgrade the OS `ca-certificates` package and fail the build below the patched Debian version ([DSA-6572-1](https://security-tracker.debian.org/tracker/DSA-6572-1); `ARG CA_CERTIFICATES_FLOOR`, declared once), the builder does so before any pip runs because pip trusts the OS store as well as its bundled certifi, the builder bootstraps pip 26.2.2, and `certifi>=2026.10.19` is a direct dependency. `tests/test_dockerfile.py` and CI's `docker-build` job enforce the order and the floor.
|
|
85
86
|
- The pip bootstrap is hash-pinned in `docker/pip-bootstrap.txt` and installed with `--require-hashes`, so it does not depend on the TLS trust of the base image's older pip and certifi; whoever raises the pip floor updates that pin and its sha256 from PyPI (`https://pypi.org/pypi/pip/<version>/json`, the `py3-none-any` wheel's `digests.sha256`), because Dependabot does not track the file.
|
|
86
|
-
- Runtime dependencies install from `uv.lock`, so the image runs the versions CI tests: the builder installs uv from `docker/uv-bootstrap.txt` (hash-pinned, `--require-hashes`, into `/tmp/uv` outside the venv, so the runtime image has no uv), runs `uv export --locked --no-dev --no-emit-project --format requirements.txt` (base dependencies only, a hash for every package, and the build fails if `uv.lock` is stale), installs that file with pip in hash-checking mode, then installs the project build backend from `docker/build-backend.txt` (hash-pinned hatchling, uv-dynamic-versioning, and every transitive build dependency, `--require-hashes --only-binary=:all:`, into `/tmp/build-backend` outside the venv, so the runtime image has no build backend) and the project with `PYTHONPATH=/tmp/build-backend pip install --no-deps --no-build-isolation .`. Never install the project with its dependencies (`pip install .`), which resolves them fresh at build time. Whoever changes `[tool.uv] required-version` keeps the uv pin within it and updates its sha256 values from `https://pypi.org/pypi/uv/<version>/json` (the manylinux x86_64 and aarch64 wheels' `digests.sha256`), because Dependabot does not track the file. The build-backend pins are the `build-backend` dependency group in `pyproject.toml` (exact versions inside the `[build-system]` ranges, not installed by default), so `uv.lock` carries their closure with hashes. After `uv lock`, `uv run python scripts/gen_build_backend.py` rewrites `docker/build-backend.txt` from `uv.lock` (`--check` reports drift instead), and `tests/test_build_backend_lock.py` fails if the file, the lock or the ranges disagree.
|
|
87
|
+
- Runtime dependencies install from `uv.lock`, so the image runs the versions CI tests: the builder installs uv from `docker/uv-bootstrap.txt` (hash-pinned, `--require-hashes`, into `/tmp/uv` outside the venv, so the runtime image has no uv), runs `uv export --locked --no-dev --no-emit-project --format requirements.txt` (base dependencies only, a hash for every package, and the build fails if `uv.lock` is stale), installs that file with pip in hash-checking mode, then installs the project build backend from `docker/build-backend.txt` (hash-pinned hatchling, uv-dynamic-versioning, and every transitive build dependency, `--require-hashes --only-binary=:all:`, into `/tmp/build-backend` outside the venv, so the runtime image has no build backend) and the project with `PYTHONPATH=/tmp/build-backend pip install --no-deps --no-build-isolation .`. Never install the project with its dependencies (`pip install .`), which resolves them fresh at build time. Whoever changes `[tool.uv] required-version` keeps the uv pin within it and updates its sha256 values from `https://pypi.org/pypi/uv/<version>/json` (the manylinux x86_64 and aarch64 wheels' `digests.sha256`), because Dependabot does not track the file. The build-backend pins are the `build-backend` dependency group in `pyproject.toml` (exact versions inside the `[build-system]` ranges, not installed by default), so `uv.lock` carries their closure with hashes. After `uv lock`, `uv run python scripts/gen_build_backend.py` rewrites `docker/build-backend.txt` from `uv.lock` (`--check` reports drift instead), and `tests/test_build_backend_lock.py` fails if the file, the lock or the ranges disagree. The file is generated from `uv.lock` by `scripts/gen_build_backend.py`, must never be edited by hand, and the `uv` Dependabot entry excludes it via `exclude-paths`. `tests/test_dockerfile.py` enforces the install steps and the pins.
|
|
87
88
|
- Lowering `CA_CERTIFICATES_FLOOR` with `--build-arg` is unsupported; the build-arg exists only so CI can raise it for the negative floor check, and CI and the release workflow never pass it otherwise.
|
|
88
89
|
4. **Registry Metadata Constraint**:
|
|
89
90
|
- In `server.json`, root `description` must be $\le$ 100 characters.
|
|
@@ -93,7 +94,6 @@ Both ecosystems publish live, queryable Documentation MCP servers exposing full
|
|
|
93
94
|
- **Breaking changes:** every `feat!` / `fix!` PR (any `type!:` title) carries a `BREAKING CHANGE:` footer as the final paragraph of the PR body, and the footer text must include the migration steps. `BREAKING CHANGE:` (or its synonym `BREAKING-CHANGE:`) is the only footer token; do not add a separate migration token. `scripts/release_notes.py` stops at the CodeRabbit marker line (outside a code fence) `<!-- This is an auto-generated comment: release notes by coderabbit.ai -->` and ignores everything after it, so the footer goes before CodeRabbit's generated summary, never inside it.
|
|
94
95
|
- **Squash merges use the PR body as the commit message** (repo settings: PR title as squash title, PR body as squash message). Keep the PR body accurate up to the merge, because `scripts/release_notes.py` reads it from the squash commit.
|
|
95
96
|
- **`CHANGELOG.md` is frozen** as of 1.2.9. GitHub Releases are the changelog: `scripts/release_notes.py` builds each release body from the squash commits since the previous tag (every `BREAKING CHANGE:` footer verbatim, then the commit subjects). Do not add CHANGELOG entries.
|
|
96
|
-
- `skills/espn-mcp/SKILL.md` carries no version: the [Agent Skills specification](https://agentskills.io/specification) has no top-level `version` field. Do not add one. Update the skill only when its operator guidance changes.
|
|
97
97
|
- **README is outside the release version ceremony.** Do not add or chase `README.md` `==X.Y.Z` install pins. Update `README.md` only when project behavior, install method, config, or commands actually change. Prefer unpinned install examples (`uvx --from mcp-server-espn espn-mcp`) or point readers to GitHub Releases.
|
|
98
98
|
|
|
99
99
|
---
|
|
@@ -135,7 +135,7 @@ coderabbit review --agent --uncommitted
|
|
|
135
135
|
|
|
136
136
|
## 🔄 CI & Releases
|
|
137
137
|
|
|
138
|
-
CI is defined in `.github/workflows/ci.yml` (jobs:
|
|
138
|
+
CI is defined in `.github/workflows/ci.yml` (jobs: Lint and types, Tests on Python 3.11–3.14 at 100% coverage with an aggregate Tests check, Tool contract assertions with OpenAPI drift and stdio verification, Protocol conformance as its own job, Build and package check with `scripts/check_version.py` and `twine check`, Container image build (`docker-build` builds the full image without pushing it and checks that the runtime image has the project and none of the build-only packages (runtime dependencies such as `packaging` stay), checks that the image answers `initialize` and `tools/list` over stdio with no network, then checks that the builder stage fails at its `ca-certificates` floor check, before any pip step, when the floor is above the installed version), and Check API Drift (`drift-check`, the same OpenAPI drift check as its own job; scheduled and manual runs only)). CodeQL code scanning runs through GitHub's default setup, not a workflow job. Jobs that install or build the package check out with `fetch-depth: 0`, because a shallow checkout has no reachable tag and reports `0.0.1.devN`. The published Docker image is built only in `release.yml` (CI's `docker-build` image is never pushed), with `UV_DYNAMIC_VERSIONING_BYPASS` set to the tag version (the build context has no `.git`). CI runs on pushes and pull requests to `main`, weekly on `main` on Sunday at 15:37 America/New_York (`schedule` with `timezone`, after the Sunday 09:30 America/New_York Dependabot run in `.github/dependabot.yml`), and on manual dispatch (`workflow_dispatch`); the weekly run exists because merges by `dependabot-automerge.yml` use `GITHUB_TOKEN` and so never trigger the `push` run. Run the commands above before opening a PR.
|
|
139
139
|
|
|
140
140
|
Do not create tags or releases unless the maintainer asks. There is no release PR: merged commits accumulate on `main`, and releases go out on any weekday on the maintainer's go; no fixed release day. Before the tag:
|
|
141
141
|
|
|
@@ -8,3 +8,4 @@ Thank you for your interest in contributing!
|
|
|
8
8
|
4. Validate tool contracts: `python scripts/check_tool_contract.py`.
|
|
9
9
|
5. Open a Pull Request. Merges are performed via **Squash Merge** with Conventional Commit titles (`feat:`, `fix:`, `docs:`, `chore:`).
|
|
10
10
|
6. Do not edit version numbers or `CHANGELOG.md`: the git tag is the version, and GitHub Releases are the changelog. The squash commit message is the PR body, so a breaking (`feat!:` / `fix!:`) PR ends its body with a `BREAKING CHANGE:` footer that includes the migration steps.
|
|
11
|
+
7. Do not edit `docker/build-backend.txt` by hand.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
|
+
# The base image is the Docker Official python image pulled from Docker Hub,
|
|
3
|
+
# pinned by its multi-arch index digest. Dependabot's docker ecosystem keeps the
|
|
4
|
+
# digest current.
|
|
2
5
|
# Multi-stage build for mcp-server-espn
|
|
3
6
|
# Produces a minimal runtime image (~150MB) with no dev tooling.
|
|
4
7
|
|
|
5
8
|
# FastMCP's October 2026 certificate authority incident notice says to update the
|
|
6
9
|
# container's OS trust store: older base images ship a ca-certificates that predates the fix.
|
|
7
|
-
# python:3.12-slim is Debian trixie, where Debian shipped 20250419+deb13u1 in trixie-security.
|
|
10
|
+
# python:3.12-slim-trixie is Debian trixie, where Debian shipped 20250419+deb13u1 in trixie-security.
|
|
8
11
|
# Both stages upgrade the package and fail the build if the installed version is older than
|
|
9
12
|
# this floor, so a base image change cannot drop the fix. The builder does it before any pip
|
|
10
13
|
# runs, because pip trusts the OS store as well as its bundled certifi.
|
|
@@ -13,7 +16,7 @@
|
|
|
13
16
|
ARG CA_CERTIFICATES_FLOOR=20250419+deb13u1
|
|
14
17
|
|
|
15
18
|
# ─── Stage 1: Builder ─────────────────────────────────────────────────────────
|
|
16
|
-
FROM python:3.12-slim AS builder
|
|
19
|
+
FROM python:3.12-slim-trixie@sha256:5e2bdb1b0d542d5039cffb8181c65930093949194a65c365dfb1b0fe13a4fa5b AS builder
|
|
17
20
|
|
|
18
21
|
ARG CA_CERTIFICATES_FLOOR
|
|
19
22
|
RUN apt-get update && \
|
|
@@ -70,7 +73,11 @@ RUN pip install --no-cache-dir --require-hashes --only-binary=:all: -r /tmp/pip-
|
|
|
70
73
|
PYTHONPATH=/tmp/build-backend pip install --no-cache-dir --no-deps --no-build-isolation .
|
|
71
74
|
|
|
72
75
|
# ─── Stage 2: Runtime ─────────────────────────────────────────────────────────
|
|
73
|
-
FROM python:3.12-slim AS runtime
|
|
76
|
+
FROM python:3.12-slim-trixie@sha256:5e2bdb1b0d542d5039cffb8181c65930093949194a65c365dfb1b0fe13a4fa5b AS runtime
|
|
77
|
+
|
|
78
|
+
# MCP Registry ownership check for the OCI package: must equal server.json "name".
|
|
79
|
+
# https://modelcontextprotocol.io/registry/package-types#docker%2Foci-images
|
|
80
|
+
LABEL io.modelcontextprotocol.server.name="io.github.christianclaudio/espn"
|
|
74
81
|
|
|
75
82
|
# OS trust store update and floor check, the same as the builder (see CA_CERTIFICATES_FLOOR).
|
|
76
83
|
ARG CA_CERTIFICATES_FLOOR
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcp-server-espn
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: Model Context Protocol (MCP) server for live & historical sports stats, odds, and schedules via ESPN
|
|
5
5
|
Project-URL: Homepage, https://github.com/christianclaudio/mcp-server-espn
|
|
6
6
|
Project-URL: Documentation, https://github.com/christianclaudio/mcp-server-espn#readme
|
|
@@ -22,8 +22,8 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
24
|
Requires-Python: >=3.11
|
|
25
|
-
Requires-Dist: certifi>=2026.10.
|
|
26
|
-
Requires-Dist: fastmcp>=4.
|
|
25
|
+
Requires-Dist: certifi>=2026.10.23
|
|
26
|
+
Requires-Dist: fastmcp>=4.2.0
|
|
27
27
|
Requires-Dist: httpx>=0.28.1
|
|
28
28
|
Requires-Dist: mcp>=2.3.0
|
|
29
29
|
Requires-Dist: pydantic-settings>=2.15.0
|
|
@@ -27,11 +27,12 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
dependencies = [
|
|
29
29
|
"mcp>=2.3.0",
|
|
30
|
-
"fastmcp>=4.
|
|
31
|
-
# certifi floor from FastMCP's October 2026 certificate authority incident notice
|
|
30
|
+
"fastmcp>=4.2.0",
|
|
31
|
+
# certifi floor from FastMCP's October 2026 certificate authority incident notice,
|
|
32
|
+
# raised to the 2026.10.23 fleet floor. httpx verifies upstream TLS against this bundle.
|
|
32
33
|
# https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026
|
|
33
|
-
#
|
|
34
|
-
"certifi>=2026.10.
|
|
34
|
+
# https://github.com/certifi/python-certifi/pull/445
|
|
35
|
+
"certifi>=2026.10.23",
|
|
35
36
|
"httpx>=0.28.1",
|
|
36
37
|
"pydantic>=2.13.5",
|
|
37
38
|
"pydantic-settings>=2.15.0",
|
|
@@ -113,9 +114,15 @@ asyncio_mode = "auto"
|
|
|
113
114
|
testpaths = ["tests"]
|
|
114
115
|
pythonpath = ["src", "."]
|
|
115
116
|
markers = [
|
|
116
|
-
"
|
|
117
|
+
"live: live network tests against the public ESPN API (run with -m live)",
|
|
117
118
|
]
|
|
118
|
-
|
|
119
|
+
# Category only. A module regex is matched against the warning's stacklevel
|
|
120
|
+
# caller, so it would miss our own FastMCP calls and would fail on a
|
|
121
|
+
# third-party DeprecationWarning raised inside fastmcp.
|
|
122
|
+
filterwarnings = [
|
|
123
|
+
"error::fastmcp.exceptions.FastMCPDeprecationWarning",
|
|
124
|
+
]
|
|
125
|
+
addopts = "-m 'not live' --strict-markers --cov=src/espn_mcp --cov-report=term-missing --cov-fail-under=100"
|
|
119
126
|
|
|
120
127
|
[tool.coverage.report]
|
|
121
128
|
exclude_lines = [
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
The Dockerfile installs the project build backend from that file with ``--require-hashes``,
|
|
4
4
|
outside the runtime venv. uv.lock already records the group's closure with every wheel hash,
|
|
5
5
|
so this keeps only the wheels the base image can install: ``py3-none-any``, or for compiled
|
|
6
|
-
packages
|
|
6
|
+
packages one manylinux x86_64 wheel and one manylinux aarch64 wheel for the base image's CPython ABI
|
|
7
|
+
whose glibc floor that image can load. A higher floor installs and then fails to load.
|
|
7
8
|
|
|
8
9
|
Usage: ``uv run python scripts/gen_build_backend.py`` writes the file; ``--check`` exits 1 and
|
|
9
10
|
lists the differences instead. tests/test_build_backend_lock.py runs the same check.
|
|
@@ -25,6 +26,29 @@ ROOT = Path(__file__).resolve().parent.parent
|
|
|
25
26
|
GROUP = "build-backend"
|
|
26
27
|
TARGET = ROOT / "docker" / "build-backend.txt"
|
|
27
28
|
ARCHES = ("x86_64", "aarch64")
|
|
29
|
+
# glibc of the Debian release named by the base image tag (python:X.Y-slim-<release>).
|
|
30
|
+
# The digest is not the key. Sources are the libc6 packages for each release:
|
|
31
|
+
# trixie (Debian 13): https://packages.debian.org/trixie/libc6 is 2.41
|
|
32
|
+
# bookworm (Debian 12): https://packages.debian.org/bookworm/libc6 is 2.36
|
|
33
|
+
_DEBIAN_GLIBC: dict[str, tuple[int, int]] = {
|
|
34
|
+
"trixie": (2, 41),
|
|
35
|
+
"bookworm": (2, 36),
|
|
36
|
+
}
|
|
37
|
+
# PEP 600: manylinux_X_Y_<arch> means glibc X.Y. Legacy aliases: manylinux1 = 2.5
|
|
38
|
+
# (PEP 513), manylinux2010 = 2.12 (PEP 571), manylinux2014 = 2.17 (PEP 599).
|
|
39
|
+
_MANYLINUX_ALIAS: dict[str, tuple[int, int]] = {
|
|
40
|
+
"manylinux1": (2, 5),
|
|
41
|
+
"manylinux2010": (2, 12),
|
|
42
|
+
"manylinux2014": (2, 17),
|
|
43
|
+
}
|
|
44
|
+
# The image reference ends at whitespace (`` AS builder``) or end of line. Without
|
|
45
|
+
# that anchor a longer token matches as a prefix, and image_glibc then accepts it
|
|
46
|
+
# or reports the wrong error.
|
|
47
|
+
_FROM_SLIM = re.compile(
|
|
48
|
+
r"^FROM python:\d+\.\d+-slim(?:-(?P<release>[A-Za-z0-9.]+))?"
|
|
49
|
+
r"(?:@(?P<digest>sha256:[0-9a-f]{64}))?(?=\s|$)",
|
|
50
|
+
re.MULTILINE,
|
|
51
|
+
)
|
|
28
52
|
HEADER = (
|
|
29
53
|
"# Build backend for the Dockerfile project install: the build-backend dependency group in",
|
|
30
54
|
"# pyproject.toml and its closure from uv.lock. Generated by scripts/gen_build_backend.py;",
|
|
@@ -42,6 +66,37 @@ def base_python(dockerfile: str) -> str:
|
|
|
42
66
|
return versions.pop()
|
|
43
67
|
|
|
44
68
|
|
|
69
|
+
def image_glibc(dockerfile: str) -> tuple[int, int]:
|
|
70
|
+
"""Return the glibc of the Debian release named by the base image tag.
|
|
71
|
+
|
|
72
|
+
``base_python`` still requires one ``python:X.Y-slim`` version. The floor is
|
|
73
|
+
the ``_DEBIAN_GLIBC`` entry for the release suffix, so a digest change within
|
|
74
|
+
that release does not move it. An unpinned base, a tag with no release, a
|
|
75
|
+
``FROM python:`` line the pattern does not match, two FROM lines that name
|
|
76
|
+
different releases, or an unknown release raises ``ValueError``.
|
|
77
|
+
"""
|
|
78
|
+
base_python(dockerfile)
|
|
79
|
+
images = list(_FROM_SLIM.finditer(dockerfile))
|
|
80
|
+
# Every FROM python: line has to match. A malformed stage must not disappear
|
|
81
|
+
# behind a valid one.
|
|
82
|
+
from_python = re.findall(r"^FROM python:", dockerfile, re.MULTILINE)
|
|
83
|
+
if len(from_python) != len(images):
|
|
84
|
+
raise ValueError("expected a pinned python:X.Y-slim-<release>@sha256 base image")
|
|
85
|
+
if not images or any(image.group("digest") is None for image in images):
|
|
86
|
+
raise ValueError("expected a pinned python:X.Y-slim-<release>@sha256 base image")
|
|
87
|
+
releases = [image.group("release") for image in images]
|
|
88
|
+
if any(release is None for release in releases):
|
|
89
|
+
raise ValueError("python:X.Y-slim has no Debian release suffix")
|
|
90
|
+
names = sorted({release for release in releases if release is not None})
|
|
91
|
+
if len(names) != 1:
|
|
92
|
+
raise ValueError(f"expected one Debian release, found {names}")
|
|
93
|
+
release = names[0]
|
|
94
|
+
glibc = _DEBIAN_GLIBC.get(release)
|
|
95
|
+
if glibc is None:
|
|
96
|
+
raise ValueError(f"Debian release {release} has no glibc entry; update _DEBIAN_GLIBC")
|
|
97
|
+
return glibc
|
|
98
|
+
|
|
99
|
+
|
|
45
100
|
def _environment(python: str, machine: str) -> dict[str, str]:
|
|
46
101
|
return {
|
|
47
102
|
"implementation_name": "cpython",
|
|
@@ -103,7 +158,34 @@ def _closure(lock: dict[str, Any], python: str) -> list[dict[str, Any]]:
|
|
|
103
158
|
return [seen[name] for name in sorted(seen)]
|
|
104
159
|
|
|
105
160
|
|
|
106
|
-
def
|
|
161
|
+
def _manylinux_tag(platform: str) -> tuple[tuple[int, int], str] | None:
|
|
162
|
+
"""Return ``(glibc floor, arch)`` for a manylinux tag, or None for anything else."""
|
|
163
|
+
perennial = re.fullmatch(r"manylinux_(\d+)_(\d+)_(.+)", platform)
|
|
164
|
+
if perennial:
|
|
165
|
+
floor = (int(perennial.group(1)), int(perennial.group(2)))
|
|
166
|
+
return floor, perennial.group(3)
|
|
167
|
+
legacy = re.fullmatch(r"(manylinux2010|manylinux2014|manylinux1)_(.+)", platform)
|
|
168
|
+
if legacy is None:
|
|
169
|
+
return None
|
|
170
|
+
return _MANYLINUX_ALIAS[legacy.group(1)], legacy.group(2)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _loads_on(platform: str, arch: str, glibc: tuple[int, int]) -> bool:
|
|
174
|
+
"""True when ``platform`` is manylinux for ``arch`` and its floor is <= ``glibc``."""
|
|
175
|
+
parsed = _manylinux_tag(platform)
|
|
176
|
+
if parsed is None:
|
|
177
|
+
return False
|
|
178
|
+
floor, tag_arch = parsed
|
|
179
|
+
return tag_arch == arch and floor <= glibc
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _digests(package: dict[str, Any], python: str, glibc: tuple[int, int]) -> list[str]:
|
|
183
|
+
"""Return wheel hashes the base image can install.
|
|
184
|
+
|
|
185
|
+
A ``py3-none-any`` wheel wins. Otherwise exactly one cp wheel per architecture,
|
|
186
|
+
counting a wheel when any dotted manylinux tag for that arch has a glibc floor
|
|
187
|
+
at or below ``glibc``. musllinux never qualifies.
|
|
188
|
+
"""
|
|
107
189
|
abi = "cp" + python.replace(".", "")
|
|
108
190
|
universal: list[str] = []
|
|
109
191
|
native: dict[str, list[str]] = {arch: [] for arch in ARCHES}
|
|
@@ -116,7 +198,7 @@ def _digests(package: dict[str, Any], python: str) -> list[str]:
|
|
|
116
198
|
elif py_tag == abi and abi_tag == abi:
|
|
117
199
|
platforms = platform_tag.split(".")
|
|
118
200
|
for arch in ARCHES:
|
|
119
|
-
if any(
|
|
201
|
+
if any(_loads_on(platform, arch, glibc) for platform in platforms):
|
|
120
202
|
native[arch].append(digest)
|
|
121
203
|
if universal:
|
|
122
204
|
return sorted(universal)
|
|
@@ -128,9 +210,14 @@ def _digests(package: dict[str, Any], python: str) -> list[str]:
|
|
|
128
210
|
def expected() -> dict[str, tuple[str, list[str]]]:
|
|
129
211
|
"""Map package name to (version, sha256 digests) for the group closure in uv.lock."""
|
|
130
212
|
lock = tomllib.loads((ROOT / "uv.lock").read_text(encoding="utf-8"))
|
|
131
|
-
|
|
213
|
+
dockerfile = (ROOT / "Dockerfile").read_text(encoding="utf-8")
|
|
214
|
+
python = base_python(dockerfile)
|
|
215
|
+
glibc = image_glibc(dockerfile)
|
|
132
216
|
return {
|
|
133
|
-
canonicalize_name(package["name"]): (
|
|
217
|
+
canonicalize_name(package["name"]): (
|
|
218
|
+
package["version"],
|
|
219
|
+
_digests(package, python, glibc),
|
|
220
|
+
)
|
|
134
221
|
for package in _closure(lock, python)
|
|
135
222
|
}
|
|
136
223
|
|
|
@@ -31,12 +31,11 @@ gh api -X PUT "/repos/${REPO_NAME}/branches/main/protection" --input - << 'JSON_
|
|
|
31
31
|
"strict": true,
|
|
32
32
|
"contexts": [
|
|
33
33
|
"Lint and types",
|
|
34
|
-
"Tests
|
|
35
|
-
"Tests (py3.12)",
|
|
36
|
-
"Tests (py3.13)",
|
|
37
|
-
"Tests (py3.14)",
|
|
34
|
+
"Tests",
|
|
38
35
|
"Tool contract assertions",
|
|
39
|
-
"
|
|
36
|
+
"Protocol conformance",
|
|
37
|
+
"Build and package check",
|
|
38
|
+
"Container image build"
|
|
40
39
|
]
|
|
41
40
|
},
|
|
42
41
|
"enforce_admins": false,
|