Upgrade ty to 0.0.65 - #94
Draft
davegaeddert wants to merge 1 commit into
Draft
Conversation
Picks up two releases (0.0.64, 0.0.65) worth of stricter checking: narrower TypeVar solutions, tagged-union narrowing, and tighter overload resolution surfaced two real gaps. - plain-postgres/meta.py: Field.sort() key functions returned `str | None` (name is only None before contribute_to_class runs), which the new overload resolution correctly rejects for list.sort's key parameter. Fall back to "" since sorting always happens after fields are contributed. - plain-jobs test_otel.py: ty now also flags 4 more of the same bound-method-overwrite pattern that neighboring lines in this file were already ty:ignore'd for; added matching ignores rather than restructuring test-only monkeypatching. No stale ty:ignore comments were found when checking with unused-ignore-comment/blanket-ignore-comment/ignore-comment-unknown-rule enabled, so nothing to remove this round.
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.
Summary
tyfrom0.0.63to0.0.65(latest on PyPI) inpyproject.tomlanduv.lock.ty checkgreen:plain-postgres/plain/postgres/meta.py:Field.nameis typedstr | None(onlyNonebeforecontribute_to_classruns), so thelist.sort(key=...)calls no longer type-checked againstlist.sort's overloads. Sorting always happens after all fields are contributed, so falling back to""is a safe, inert-at-runtime fix.plain-jobs/tests/internal/test_otel.py:tynow also flags 4 more instances of the same bound-method-overwrite pattern that neighboring lines in the same file were already# ty: ignore[invalid-assignment]'d for (test-only monkeypatching of a partially-constructedWorker). Added matching ignore comments rather than restructuring the test.# ty: ignorecomments across the whole workspace withunused-ignore-comment,blanket-ignore-comment, andignore-comment-unknown-ruleenabled as warnings (ty check --warn ... --error-on-warning) — none found, so nothing to remove this round./simplifyand/code-reviewon the diff; both came back clean.Changelog highlights (0.0.64 → 0.0.65)
__replace__.--exclude-scripts/--include-scripts, uv workspace root discovery.Test plan
uv run ty check— all checks pass (including withunused-ignore-comment/blanket-ignore-comment/ignore-comment-unknown-rulepromoted to warnings)uv run plain-code fixon the two changed Python files — no further changes./scripts/test plain-postgres/./scripts/test plain-jobs— could not run in this sandbox (no Postgres/Docker available); please run in CICo-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_016A6qTRAeQhzz3DjL7DfCEb
Generated by Claude Code