ci: test the supported Python range, and gate ruff and mypy - #92
Merged
Conversation
`[tool.mypy]` has been `strict = true` since the package was set up, but nothing ran it, so 54 errors accumulated across five test files. All but five were missing annotations on test functions and their fixture parameters. The five that were not: - `spec_from_file_location` returns `ModuleSpec | None`, narrowed before use rather than after. - `update_changelog_text` comes off a dynamically loaded module and so is `Any`; bound to a declared `str` on the way out. - `FakeOpener.requests` held `object`, which made `.headers` unreachable on the `Request` the fetch actually appends. - `vector_distance_sql` is passed an invalid metric on purpose, so that call carries a scoped ignore. Package source was already clean.
`requires-python` is `>=3.10` and CI ran 3.12 alone, so neither end of the range was exercised. The suite now runs on 3.10 through 3.14 with `fail-fast` off, and a second job fails the build on `ruff check`, `ruff format --check`, or `mypy`. All five versions pass. `test_the_agents_extra_provides_the_package_create_agent_lives_in` skips on 3.10, where `tomllib` is not in the standard library. Closes #42
rohan-hotdata
requested review from
eddietejeda
and removed request for
a team
August 31, 2026 14:11
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.
Closes #42.
CI ran
pyteston Python 3.12 alone whilerequires-pythonclaimed>=3.10, so neither end of the supported range was exercised. Ruff and mypy were configured and installed but never run, so lint and type regressions could land on main freely.What changed
A matrix over 3.10–3.14, with
fail-fast: falseso one version failing does not mask the others. I ran all five locally before writing a workflow that asserts they pass: the suite is green on every one.test_the_agents_extra_provides_the_package_create_agent_lives_inskips on 3.10, wheretomllibis not in the standard library — it still runs on 3.11 and up, so the claim it guards stays covered, and atomlidependency for one test did not seem worth it.A second job gating
ruff check,ruff format --check, andmypy. Ruff was already clean on main. Mypy was not, and getting there is the bulk of this diff.The mypy baseline was 54, not the 18 the issue records
The issue's figure was measured a while ago and the shape had drifted too. 49 were
no-untyped-defas described — missing annotations on test functions and their fixture parameters. Five were not, and those are the ones worth reviewing:spec_from_file_locationreturnsModuleSpec | None, andtests/test_update_changelog.pynarrowed it after passing it tomodule_from_spec. The assert was one line too late.FakeOpener.requestswas typedlist[object], which makes.headersunreachable on theRequestthe fetch actually appends. The annotation was describing the double inaccurately.update_changelog_textcomes off a dynamically loaded module and so isAny; it is now bound to a declaredstron the way out.vector_distance_sqlis passed an invalid metric on purpose intest_search.py, so that one call carries a scoped# type: ignore[arg-type].warn_unused_ignoresis on, so it will be flagged if it ever stops being needed.Package source was already clean, as the issue said.
The 49 annotations were generated mechanically and then read through as a diff. Under
from __future__ import annotationsa wrong annotation cannot fail a test — it can only mislead the next reader — so the diff review is the check, not the suite.ruff formatreflowed the fifteen signatures that went over 100 characters.Two things checked rather than assumed
The status-check rename.
Test (Python 3.12)becomes a matrix, which would break a ruleset requiring that exact name. Neither the branch-protection API nor the three org rulesets on this repo pin any status check by name, so the rename does not strand a required check.Docs. The audit found one claim this change made stale: README's Development section listed
uv sync --lockedanduv run pytest, which is now an incomplete recipe — someone following it gets a red build on lint or types without knowing why. It now lists the three gating commands too. CHANGELOG has an entry under[Unreleased].Verification
ruff checkclean,ruff format --checkclean,mypy54 errors to 0, 575 tests passing on 3.11–3.14 and 574 plus one skip on 3.10.