Repository navigation
Bound ruff and mypy so an upgrade is a decision - #36
Merged
Merged
Conversation
CI runs both with no configuration of its own: pyproject has no [tool.ruff] section, there is no ruff.toml anywhere in the tree, and ci.yml runs a bare ruff check. So the rules in force are whatever the installed version happens to default to, and those defaults are not stable across releases. When they grow, CI goes red on a pull request that changed nothing related to the new rule, and whoever opened it has to fix unrelated findings to land their work. Bounded, that becomes a deliberate pull request whose subject is the new findings. Not an explicit select list. The broad defaults are doing real work: during #10 they caught an unparenthesized implicit string concatenation in a parametrize list, which is the shape a missing comma takes and silently turns a 2-tuple into one string, and a datetime() built without tzinfo. Freezing a hand-written list would risk losing that and leaves something to maintain. The issue suggested mypy>=1.11,<2. That bound would move CI backwards: mypy 2.0 shipped in May, CI has been installing 2.x since, and 2.3.1 passes this codebase clean today. The bound is >=2,<3, which keeps what is already running and guards the next major. ruff is pre-1.0, so its minor is the equivalent boundary and stays <0.17. Verified against the three commands CI runs: ruff check . passes, mypy reports no issues in 27 source files, and 1106 tests pass, with ruff 0.16.5 and mypy 2.3.1 resolved inside the bounds. Closes #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 #11.
CI runs both linters with no configuration of its own — no
[tool.ruff]section, no
ruff.tomlanywhere in the tree, andci.ymlruns a bareruff check .. So the rules in force are whatever the installed version happensto default to, and those defaults are not stable across releases. When they
grow, CI goes red on a pull request that changed nothing related to the new
rule.
One deviation from the issue
The issue suggested
mypy>=1.11,<2. That bound would move CI backwards.mypy 2.0 shipped 2026-05-06, three months before the issue was filed, and CI has
been installing 2.x on every run since. mypy 2.3.1 passes this codebase clean
today:
Pinning
<2would have silently dropped CI to a two-major-versions-olderchecker. The bound is
>=2,<3, which keeps what is already running and guardsthe next major.
ruff is pre-1.0, so its minor is the equivalent boundary and stays
<0.17.Not an explicit select list
Deliberately, per the issue. The broad defaults are doing real work: during #10
they caught an unparenthesized implicit string concatenation in a
parametrizelist — the shape a missing comma takes, which silently turns a 2-tuple into one
string — and a
datetime()built withouttzinfo. A hand-written list wouldrisk losing that and leaves something to maintain.
Verified
Against the three commands CI actually runs, with the bounds in place:
Development tooling only; the published package is unaffected and this needs no
release of its own.