Skip to content

Upgrade ruff to 0.17.1 and ty to 0.0.89 - #163

Merged
davegaeddert merged 2 commits into
masterfrom
claude/funny-maxwell-obs9g9
Oct 20, 2026
Merged

davegaeddert merged 2 commits into
masterfrom
claude/funny-maxwell-obs9g9

Conversation

@davegaeddert

@davegaeddert davegaeddert commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • ruff 0.16.10 → 0.17.1 (plain-code pin >=0.17.1,<0.18), ty 0.0.84 → 0.0.89
  • ruff 0.17 autofixes; @contextmanager returns switched from Iterator to Generator (ty deprecation)
  • CI fix: the lint job ran a bare uv python install, which now picks Python 3.15, and psycopg-binary has no cp315 wheel, so uv sync failed before lint ran. It's now pinned to 3.14, like the test matrix.
  • ty 0.0.86 added attribute/property override checks and 0.0.87 turned on invalid-mutable-override by default, which produced 51 new diagnostics. Where the annotation was wrong, I fixed the annotation:
    • admin cards / parent_view_class hold classes (type[...]), and card filters holds an Enum class
    • background_command is a tuple, FormView.success_url is str | None
    • OAuthCallbackView.oauth_error is declared (two getattr workarounds gone)
    • UploadedFile(size=None) no longer shadows File.size with None (a latent bug)
    • streaming responses get a raising content setter that matches the read-only getter
    • plain-postgres: Lookup.lookup_name is now ClassVar[str] (4 asserts removed), on_delete lives only on ForeignKeyRel, SQLWriteCompiler is generic over its query, the ChoicesMeta properties are typed against TextChoices (2 ignores removed), and Query.chain checks isinstance(UpdateQuery) (1 ignore removed)
    • the admin list base accepts the dict[str, Q] form of filters, so the model view's get_filter_names override is gone
  • Narrowings ty can't verify keep targeted ignores, each with a reason: FK/M2M remote_field and rel.field, AdminView.user, the documented MCP mcp: AppMCP pattern, 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 pass
  • plain-code check . --skip-ty, ./scripts/type-validate, ./scripts/test-package-imports: clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01SDZ9zhE4BiReFLFQ9sH2tW

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
@pullapprove5

pullapprove5 Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor
PASS: 1 review scope passed
Scope Progress
✅ code 1/1

View in PullApprove

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
@davegaeddert davegaeddert changed the title Upgrade ruff to 0.17 and ty to 0.0.86 Upgrade ruff to 0.17.1 and ty to 0.0.89 Oct 20, 2026
@davegaeddert
davegaeddert merged commit 38aa834 into master Oct 20, 2026
8 checks passed
@davegaeddert
davegaeddert deleted the claude/funny-maxwell-obs9g9 branch October 20, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants