Upgrading ruff 0.11 to 0.12
Breaking0.11.13 → 0.12.12Breaking6Deprecated1New32Changed50Fixed100Other70
BreakingUpgrade verdict
6 breaking changes.
In plain terms
- When no Python version is configured, Ruff assumes 3.13 for syntax error checks to avoid false alarms, but still assumes 3.9 for lint rules.
- The Rust toolchain file is no longer shipped in source packages, so packagers can build with their own MSRV-compatible Rust version.
- The S320 lint rule has been removed.
- Ruff now flags code that uses newer Python syntax on older versions, and other syntax mistakes the Python compiler itself would reject.
Must act Top 4 of 7 that need code or config changes
What you must change
Breaking6
Ruff defaults to the latest supported Python version (3.13) when checking version-related syntax errors; other defaults remain 3.9.
Source distributions no longer include rust-toolchain.toml, so downstream maintainers are not forced onto Ruff's development Rust toolchain.
rust-toolchain.tomlRemoves the suspicious-xmle-tree-usage rule (S320).
S320Ruff now detects version-related syntax errors and CPython compiler syntax errors, such as irrefutable match patterns.
Ruff formats multi-line f-strings with format specifiers without adding a line break after the specifier, matching Python 3.13.4 grammar.
non-pep604-annotation-union (UP007) is split into two rules: UP007 now applies only to
typing.Union, while UP045 checks typing.Optional.UP007UP045Deprecations to plan for
Deprecated1
Deprecates the pandas-df-variable-name rule.