Enable UP rules in ruff config#770
Conversation
Adds the pyupgrade (UP) rule set to the ruff lint configuration in pyproject.toml and applies the resulting fixes across the `frozenlist` stub and the in-tree PEP 517 build backend. Type annotations are migrated to PEP 585 builtin generics (`list`, `dict`, `tuple`) and PEP 604 union syntax (`X | Y`, `X | None`); imports of `Iterable`, `Iterator`, `Mapping`, `MutableSequence`, and `Sequence` are moved from `typing` to `collections.abc` to match the minimum supported Python version (3.10+). Refs aio-libs#769
|
../CHANGES.rst:121: : Spell check: pyupgrade: (pyupgrade) rule set in the . This needs to be added to the spelling list |
|
@aiolibsbot rr |
PR Review — Enable UP rules in ruff configThe mechanical pyupgrade migration itself is clean: typing-module aliases moved to 🟡 Important1. Attribution should track the human operator, not the bot account (`CHANGES/769.contrib.rst`, L5)Per project convention, the 2. Add `pyupgrade` to the spelling wordlistThe docs spellcheck ( 🟢 Suggestions1. Symlink target depends on the guessed PR number being correct (`CHANGES/770.contrib.rst`, L1)The Checklist
SummaryThe mechanical pyupgrade migration itself is clean: typing-module aliases moved to To rebase addressing only specific severity levels, use: |
Good catch — the docs spellcheck ( |
Rebase with requested adjustmentsBranch Changes applied
StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
What do these changes do?
Enable the pyupgrade (
UP) rule set in therufflintconfiguration and apply the resulting fixes across the
frozenliststub and the in-tree PEP 517 build backend, nowthat Python 3.9 support has been dropped in #766.
Type annotations are migrated to PEP 585 builtin generics
(
list,dict,tuple) and PEP 604 union syntax (X | Y,X | None); imports ofIterable,Iterator,Mapping,MutableSequence, andSequenceare moved fromtypingtocollections.abc.Are there changes in behavior for the user?
No. This is a contributor-facing lint configuration change.
The public API in
frozenlist/__init__.pyiis equivalent underPEP 585/604 (still resolvable in Python 3.10+).
Related issue number
Fixes #769
Checklist
ruff checkCONTRIBUTORS.txtCHANGESfolderAgent run details (optional, for reviewers)
Lint:
ruff check . && ruff format --check .— all checks passed, 13 files already formatted.Tests:
pytest tests/ -qagainst the pure-Python implementation (FROZENLIST_NO_EXTENSIONS=1) — 110 passed. The Cython extension was not built in this sandbox (missing Python development headers), but the changes do not touchfrozenlist/__init__.pyorfrozenlist/_frozenlist.pyx; they are confined to the.pyistub and the PEP 517 build backend.Drafted with Kōan + Claude Opus 4.7; reviewed by @bdraco.
Quality Report
Changes: 9 files changed, 26 insertions(+), 24 deletions(-)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline