Skip to content

fix+ci(pyvolca): resolve pre-existing pyright errors and gate pyright in CI#187

Merged
ccomb merged 3 commits into
mainfrom
chore/pyvolca-pyright-diagnostics
Jul 8, 2026
Merged

fix+ci(pyvolca): resolve pre-existing pyright errors and gate pyright in CI#187
ccomb merged 3 commits into
mainfrom
chore/pyvolca-pyright-diagnostics

Conversation

@ccomb

@ccomb ccomb commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Two type-only fixes in the pyvolca client, both flagged by pyright and both pre-existing (unrelated to any feature work), plus a CI gate so this class of error fails the build from now on.

Fixes (no behavior or wire change, no version bump):

  • _call typed its substitutions parameter as list[dict], but every caller passes list[SubstitutionLike] and it forwards the value straight to _substitution_body, which already accepts that wider type. Because list is invariant, the narrower annotation rejected valid callers. Widened to match.
  • ConsumersResponse.from_json declared inner_fetch and then shadowed it with a same-named nested def, which pyright reported as a redeclaration and an invalid None assignment. The closure now has its own name and captures the narrowed non-None fetch.

CI gate: pyright was editor-only, so type regressions never failed CI — which is exactly how these errors accumulated unnoticed. A pinned pyright (dev extra) and a pyright step now run on the pyvolca workflow, scoped to src/volca in basic mode via [tool.pyright]. Clean at 0 errors; the suite stays green (184 passed, 7 skipped).

AGENTS.md: one line — fix a diagnostic the moment you see it, including a pre-existing one surfaced in passing, in its own small commit rather than deferring it.

ccomb added 3 commits July 8, 2026 06:33
Two type-only fixes, no behavior change:
- _call's `substitutions` parameter was typed `list[dict]`, but every caller
  passes `list[SubstitutionLike]` and it forwards straight to
  `_substitution_body`, which already accepts that. Widen the annotation to
  match — list invariance made the narrower type reject valid callers.
- ConsumersResponse.from_json declared `inner_fetch` then shadowed it with a
  same-named nested `def`, which pyright flagged as a redeclaration plus an
  invalid None assignment. Give the closure its own name and capture the
  narrowed fetch.
pyright was editor-only, so type regressions never failed CI — which is how
the errors fixed in this branch accumulated unnoticed. Add a pinned pyright
(dev extra) and a `pyright` step to the pyvolca workflow, scoped to
`src/volca` in basic mode via `[tool.pyright]`. Clean at 0 errors.
@ccomb ccomb changed the title fix(pyvolca): resolve pre-existing pyright type errors fix+ci(pyvolca): resolve pre-existing pyright errors and gate pyright in CI Jul 8, 2026
@ccomb ccomb merged commit 786d08a into main Jul 8, 2026
10 checks passed
@ccomb ccomb deleted the chore/pyvolca-pyright-diagnostics branch July 8, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant