Skip to content

Enable ruff to perform syntax upgrades#1325

Open
Vizonex wants to merge 5 commits intoaio-libs:masterfrom
Vizonex:pyupgrade-with-ruff
Open

Enable ruff to perform syntax upgrades#1325
Vizonex wants to merge 5 commits intoaio-libs:masterfrom
Vizonex:pyupgrade-with-ruff

Conversation

@Vizonex
Copy link
Copy Markdown
Member

@Vizonex Vizonex commented Apr 22, 2026

What do these changes do?

This change enables ruff to make automatic upgrades when moving up versions of python or dropping versions (for example 3.9)

Are there changes in behavior for the user?

This should be helpful for other contributors and users.

Related issue number

#1324 this was discussed by me and @bdraco, I decided to branch out once again as this portion is a big enough change that requires another PR.
close #1324

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@Vizonex Vizonex requested a review from asvetlov as a code owner April 22, 2026 03:36
@Vizonex Vizonex changed the title enable ruff to perform syntax upgrades Enable ruff to perform syntax upgrades Apr 22, 2026
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_abc.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread tests/conftest.py Fixed
Comment thread tests/test_istr.py Fixed
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 22, 2026

Definitely easier to review since only a few things need to be manually checked as we don't have to check each line of the pre-commit update.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 22, 2026

Merging this PR will not alter performance

✅ 245 untouched benchmarks


Comparing Vizonex:pyupgrade-with-ruff (46281d0) with master (637ffa9)

Open in CodSpeed

@Vizonex Vizonex requested a review from webknjaz as a code owner April 22, 2026 04:35
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.86%. Comparing base (637ffa9) to head (46281d0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1325      +/-   ##
==========================================
- Coverage   99.86%   99.86%   -0.01%     
==========================================
  Files          28       28              
  Lines        3607     3604       -3     
  Branches      265      265              
==========================================
- Hits         3602     3599       -3     
  Misses          3        3              
  Partials        2        2              
Flag Coverage Δ
CI-GHA 99.86% <100.00%> (-0.01%) ⬇️
pytest 99.86% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread multidict/_multidict_py.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why it didn't hit on this one

Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
def popone(
self, key: str, default: Union[_T, _SENTINEL] = sentinel
) -> Union[_V, _T]:
def popone(self, key: str, default: _T) -> _V | _T: ...
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
Comment thread multidict/_multidict_py.py Dismissed
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 22, 2026


  >       def __init__(self, arg: MultiDict[_V] | "MultiDictProxy[_V]"):
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E       TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'str'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants