Enforce ruff/pyupgrade rules (UP)
Summary of changes
Enforce ruff/pyupgrade rules (UP).
Follow-up of #4125.
Pull Request Checklist
- [ ] Changes have tests
- [ ] News fragment added in
newsfragments/. (See documentation for details)
You should ignore UP038 too ! https://github.com/astral-sh/ruff/issues/7871
Restarted from scratch, it's easier and less error-prone than rebasing.
Might wanna disable UP027 too (I've done so here: https://github.com/pypa/setuptools/pull/4558)
CI failure looks completely unrelated, I got the same thing here: https://github.com/pypa/setuptools/actions/runs/11113018762/job/30876386043?pr=4556
@jaraco and/or @abravalheri Can this be reviewed? Finishing to enable all UP rules is a PR I would've done as well if this one didn't already exists.
Looks great. Thanks!