fix+ci(pyvolca): resolve pre-existing pyright errors and gate pyright in CI#187
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
_calltyped itssubstitutionsparameter aslist[dict], but every caller passeslist[SubstitutionLike]and it forwards the value straight to_substitution_body, which already accepts that wider type. Becauselistis invariant, the narrower annotation rejected valid callers. Widened to match.ConsumersResponse.from_jsondeclaredinner_fetchand then shadowed it with a same-named nesteddef, which pyright reported as a redeclaration and an invalidNoneassignment. 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
pyrightstep now run on the pyvolca workflow, scoped tosrc/volcain 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.