fix: pin pillow + orjson in space/, bump base version to 0.4.0#19
Conversation
Several small fixes required before cutting v0.5.0: - **space/requirements.txt**: pin `pillow>=10.4.0` (3 CVEs in 9.5.0) and `orjson>=3.11.6` (GHSA-hx9q-6w63-j58v in 3.9.9). Both come in transitively through gradio. Resolves the deploy-space CI Gate failure. - **release-please base version**: bump `.release-please-manifest.json` and `pyproject.toml` from `0.2.0` → `0.4.0`. release-please has been failing every push since being added in #15 (missing GH App secrets, fixed separately in secrets-sync), so no actual releases were published. Bumping the base now means the next release-please PR proposes `0.5.0` on top of the polish work. - **publish.py**: drop a stale `# type: ignore[no-untyped-call]` on `pq.write_table()`. With pyarrow excluded from pre-commit's mypy additional_dependencies, both pre-commit and local mypy now use the pyproject `ignore_missing_imports = true` override and treat the call as Any-typed. The ignore was tripping `warn_unused_ignores` locally. - **.pre-commit-config.yaml**: bump mypy 1.11.2 → 1.20.2 to match the project venv, and document why `pyarrow` is excluded from the hook's additional_dependencies. - **CONTRIBUTING.md**: document the secret-sync flow so contributors understand where `HF_TOKEN`, `GH_APP_PRIVATE_KEY`, and `GH_ACTION_JACOBPEVANS_APP_ID` come from for forks vs upstream CI. Companion: secrets-sync#71 distributes `HF_TOKEN` and the GH App secrets to this repo's Actions secrets. Refs: #18 (lm-eval transitive vulns — long-running tracker)
There was a problem hiding this comment.
Code Review
This pull request bumps the project version to 0.4.0, adds documentation for CI secrets and external synchronization in CONTRIBUTING.md, and addresses security vulnerabilities by pinning pillow and orjson in space/requirements.txt. It also modifies the mypy configuration to improve type checking behavior with pyarrow. A review comment points out that the specified version for mirrors-mypy (v1.20.2) is likely invalid and should be corrected to a stable release to prevent CI failures.
There was a problem hiding this comment.
Pull request overview
This PR addresses CI security gate findings for the HF Space viewer, updates release/version metadata for the next release-please cycle, and aligns type-checking behavior/docs for contributors and pre-commit.
Changes:
- Add minimum secure versions for
pillowandorjsoninspace/requirements.txtto address known CVEs/advisories. - Bump project version metadata from
0.2.0to0.4.0across release-please/packaging artifacts. - Remove a now-unused mypy ignore in
publish.pyand adjust the pre-commit mypy hook configuration; document CI secrets sourcing inCONTRIBUTING.md.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates the editable package version to 0.4.0 in the lockfile. |
| src/mlx_benchmarks/publish.py | Drops an unused mypy suppression on pq.write_table(). |
| space/requirements.txt | Adds minimum versions for pillow/orjson to remediate security findings. |
| pyproject.toml | Bumps the package version to 0.4.0. |
| CONTRIBUTING.md | Documents how CI secrets are sourced/distributed via secrets-sync. |
| .release-please-manifest.json | Bumps release-please manifest to 0.4.0. |
| .pre-commit-config.yaml | Updates mypy hook rev and adjusts dependencies/notes for pyarrow typing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Three categories of CI Gate findings from the prior commit's run: 1. **Markdown lint (98 errors)**: padded all compact-style table separator rows from `|---|` to `| --- |`, converted long badge URLs in `README.md` and architecture-doc table cells to link references, broke long shell commands across multiple lines, removed an extra H1 in `space/README.md` that conflicted with the HF-Spaces YAML `title:` field, and added language hints to two unmarked fenced code blocks. All 12 markdown files now pass org-wide markdownlint config. 2. **OSV / pip-audit (vllm + torch CVEs)**: removed the `[vllm]` optional extra from `pyproject.toml`. The vllm Python package is Linux/CUDA-only and isn't installable on the Apple-Silicon dev platform. The vllm converter only parses JSON output from an external `vllm benchmark_serving` run — it doesn't import vllm at runtime. With the extra removed, `uv lock` no longer pulls in vllm 0.5.0.post1 or torch 2.3.0, which eliminates 9+ CVEs from the lockfile. Documented the new install path in pyproject.toml comments. 3. **mypy `no-untyped-call` regression**: pyarrow ships no type stubs, so `pq.write_table()` reads as untyped under mypy 1.20.x in CI's `uv sync` environment but is treated as `Any` under the local devenv's stub resolution. Restored the `# type: ignore[unused-ignore,no-untyped-call]` so both environments converge — the `unused-ignore` clause silences `warn_unused_ignores` locally where the ignore isn't strictly needed. Remaining lm-eval transitive vulnerabilities (sqlitedict, diskcache, transformers 4.57.6) are tracked in #18; they have no fix on a stable upstream line we can adopt today.
Final CI Gate fix: add documented per-CVE acknowledgement for GHSA-g4r7-86gm-pgqc (sqlitedict 2.1.0 / CVE-2024-35515) — the unfixable lm-eval transitive dep flagged on every CI run. - `osv-scanner.toml`: local override config picked up by the central `_osv-scan.yml` reusable workflow. ignoreUntil set to 2026-10-25 to force a quarterly review. Reason links to tracking issue #18 and documents the exploitability surface. - `ci-gate.yml`: pass `ignore-vulns: GHSA-g4r7-86gm-pgqc` to the `_python-security.yml` reusable workflow. Same documentation pattern — comment block above the ID lists the tracking issue, source dep, and exploitability assessment. Both are narrow per-CVE acceptance, not blanket suppressions. New findings still fail the build. The new `ignore-vulns` input is added to the central workflow in JacobPEvans-personal/.github#233 — once that merges, this PR's CI will go green. Refs: #18 (lm-eval transitive vulns tracking issue), JacobPEvans-personal/.github#233 (central workflow input).
- Bump `__version__` in `src/mlx_benchmarks/__init__.py` from "0.2.0" to "0.4.0" to match `pyproject.toml` and `.release-please-manifest.json`. release-please-config.json already tracks both files via `extra-files`, so this is just catching up the third anchor. - Reword the comment block in `space/requirements.txt` from "Pin transitive deps" to "Minimum-version requirements" to accurately describe the lower-bound constraints. The CVE notes and version thresholds are unchanged.
The previous run failed with startup_failure because `_python-security.yml@main` did not yet declare the `ignore-vulns` input that ci-gate.yml passes. That input shipped in the merged `feat: add ignore-vulns input` PR. No code changes here.
Replace the secrets-sync/Doppler-specific CI secrets section with a generic "for forks" note covering only what an external contributor actually needs to provide. (claude)
Summary
pillow>=10.4.0(3 CVEs in 9.5.0) andorjson>=3.11.6(GHSA-hx9q-6w63-j58v) inspace/requirements.txt— fixes thedeploy-spaceCI Gate findings from PR feat: production polish — package layout, CI, viewer, docs #15..release-please-manifest.json+pyproject.tomlfrom0.2.0→0.4.0so the nextfeat:push opens a release-please PR forv0.5.0.# type: ignore[no-untyped-call]onpq.write_table()(now flagged bywarn_unused_ignores); reconfigure pre-commit's mypy to match local-venv behavior on pyarrow.secrets-syncflow inCONTRIBUTING.mdso contributors know whereHF_TOKEN/GH_APP_PRIVATE_KEY/GH_ACTION_JACOBPEVANS_APP_IDcome from.Why now
We brought the repo up to senior-reviewer-ready state in PR #15, but two CI workflows were still red:
release-please— failing every push because the workflow needsGH_APP_PRIVATE_KEYandGH_ACTION_JACOBPEVANS_APP_IDsecrets, which weren't synced to this repo. That's why no releases ever published.deploy-space— failing becauseHF_TOKENwas empty (Illegal header value b'Bearer ').The secrets are now distributed via secrets-sync#71. Once that merges and the sync workflow runs, both
release-pleaseanddeploy-spacewill work for the next push.The pillow/orjson pins close the remaining open
CI Gatesecurity findings on this side.Test plan
ruff check . && ruff format --check .— cleanmypy src/mlx_benchmarks— clean (strict mode)pytest tests space/tests— 26 passedpython scripts/validate_schema.py— cleanpre-commit run --all-files— all hooks passManual prerequisite
Before secrets-sync#71 can succeed,
mlx-benchmarksmust be added to theGH_PAT_SECRETS_SYNC_ACTIONPAT's repository access list (the sync workflow validates PAT access at runtime and fails fast). This is a manual step in the PAT settings page.Refs
[vllm]extra)