Repository navigation
Upgrade ruff to 0.17.1 and ty to 0.0.89 - #163
Merged
Merged
Conversation
Apply ruff 0.17 autofixes, switch @contextmanager return annotations from Iterator to Generator (ty deprecation), and drop redundant casts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjNAvzqKcPsGCk5KdkaCQ8
Contributor
|
Next steps:
|
- Pin the lint job to Python 3.14: a bare `uv python install` picked up 3.15, which psycopg-binary has no wheel for, so lint never ran. - ty 0.0.86+ checks attribute/property override types and 0.0.87 enables invalid-mutable-override by default. Fixed the underlying annotations where they were wrong: admin `cards`/`parent_view_class` hold classes, card `filters` holds an Enum class, `background_command` is a tuple, `success_url` is `str | None`, `oauth_error` is declared instead of read through getattr, `UploadedFile` no longer shadows `File.size` with None, and streaming responses define a raising `content` setter. - plain-postgres: `Lookup.lookup_name` is a ClassVar (drops 4 asserts), `on_delete` lives only on ForeignKeyRel, SQLWriteCompiler is generic over its query, ChoicesMeta properties are typed against TextChoices (drops 2 ignores), and Query.chain checks for UpdateQuery directly (drops 1 ignore). - Admin list `filters` accepts the dict form at the base, so the model view's get_filter_names override goes away. - Remaining narrowings ty can't verify (FK remote_field/rel.field, AdminView.user, the MCP `mcp: AppMCP` pattern, two non-cacheable identity/output_field properties) carry targeted ignores with reasons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SDZ9zhE4BiReFLFQ9sH2tW
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
plain-codepin>=0.17.1,<0.18), ty 0.0.84 → 0.0.89@contextmanagerreturns switched fromIteratortoGenerator(ty deprecation)uv python install, which now picks Python 3.15, and psycopg-binary has no cp315 wheel, souv syncfailed before lint ran. It's now pinned to 3.14, like the test matrix.invalid-mutable-overrideby default, which produced 51 new diagnostics. Where the annotation was wrong, I fixed the annotation:cards/parent_view_classhold classes (type[...]), and cardfiltersholds an Enum classbackground_commandis a tuple,FormView.success_urlisstr | NoneOAuthCallbackView.oauth_erroris declared (twogetattrworkarounds gone)UploadedFile(size=None)no longer shadowsFile.sizewithNone(a latent bug)contentsetter that matches the read-only getterLookup.lookup_nameis nowClassVar[str](4 asserts removed),on_deletelives only onForeignKeyRel,SQLWriteCompileris generic over its query, theChoicesMetaproperties are typed againstTextChoices(2 ignores removed), andQuery.chainchecksisinstance(UpdateQuery)(1 ignore removed)dict[str, Q]form offilters, so the model view'sget_filter_namesoverride is goneremote_fieldandrel.field,AdminView.user, the documented MCPmcp: AppMCPpattern,Lookup.identity/Query.output_field(can't be cached like the base), and one test that deliberately exercises a property override.Net: ty ignores +9/−3, asserts −4, casts −4.
Testing
./scripts/test(all packages, local Postgres 16): all passplain-code check . --skip-ty,./scripts/type-validate,./scripts/test-package-imports: clean🤖 Generated with Claude Code
https://claude.ai/code/session_01SDZ9zhE4BiReFLFQ9sH2tW