Fixes #21473: Enable Ruff pyupgrade rules and modernize string formatting #309

Closed
opened 2026-04-05 16:25:27 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 2/19/2026

Fixes: #21473

This PR enables Ruff’s UP (pyupgrade) rules to gradually modernize our Python syntax in line with the project’s Python 3.12 target.

  • Enable UP checks in ruff.toml
  • Replace legacy % string formatting with f-strings in a few places
  • Clean up unused imports uncovered by the new rules
  • Add targeted ignores for UP046/UP007 where Strawberry currently requires the existing typing style

No functional changes are intended.

Thanks for reviewing!

*Originally created by @pheus on 2/19/2026* ### Fixes: #21473 This PR enables Ruff’s `UP` (pyupgrade) rules to gradually modernize our Python syntax in line with the project’s Python 3.12 target. - Enable `UP` checks in `ruff.toml` - Replace legacy `%` string formatting with f-strings in a few places - Clean up unused imports uncovered by the new rules - Add targeted ignores for `UP046`/`UP007` where Strawberry currently requires the existing typing style No functional changes are intended. Thanks for reviewing!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#309