You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maintenance: Update ruff target version to 3.10 #8047
The project currently supports all supported Python versions which, as of now, is 3.10-3.14. Despite this, the ruff config targets 3.8 which is not supported.
The main Ruff target-version change does appear to be fixed already in the current branch: ruff.toml now has target-version = "py310", and make lint / make format-check both pass locally.
I did notice that the merged change keeps temporary Ruff ignores for UP006, UP007, UP035, and UP045, which currently hide a larger set of pyupgrade findings. I also found a few stale Python 3.8 references in tox.ini and docs.
So I think #8047 itself may be resolved if the scope was only bumping the Ruff target version. If you’d like, I can either:
open a small cleanup PR for the stale tox.ini / docs Python 3.8 references, or
work on a scoped plan for removing the temporary pyupgrade ignores safely.
Please let me know which direction would be most useful.
Hey @VatsalGoel3, thanks a lot for digging into this and for the clear write-up.
Yeah, #8047 itself is basically done, the target bump is already in. The interesting part is the leftover you spotted: bumping to 3.10 turned on a bunch of pyupgrade rules and we silenced them (UP006, UP007, UP035, UP045) instead of actually fixing them. I'd love to clean those up now.
The thing is, fixing all four at once is a ~1000 line diff mixing mechanical and manual changes, and nobody can review that. So I'd rather split it into small tasks, one rule per PR.
UP045 (Optional[x] → X | None): 284 across 64 files, 282 auto-fixable.
UP007 (Union/Optional → X | None): 89 across 35 files, 75 auto-fixable.
UP035 (old typing imports): 214 across 144 files, but only 57 auto-fixable — 157 are manual.
I'd go safest first: start with UP006 and UP045, they're almost fully automatic so the PRs are big but trivial to review. Then UP007. And leave UP035 for last on its own, since it's the one with real manual work. Each PR drops its own ignore at the end so the fix and the removal go together.
Also, nice catch on the stale stuff intox.ini still lists py37,py38,py39 which we don't support anymore. That one's unrelated to pyupgrade, so it can be its own small cleanup (good first issue material).
So if you're up for it: let's close #8047, I'll open an umbrella issue for the four pyupgrade rules, and the tox.ini one can be separate. Want to start with UP006 since it's the easy win?
The umbrella issue has not landed yet, so I opened #8398 as a scoped issue for UP045 only and have a PR ready against it. Happy to relink it if you would rather the umbrella track all four rules in one place.
The numbers on current develop line up closely with yours from July: 285 violations across 65 files, 283 fixed by the autofix, 2 manual. The two manual ones are runtime assignments in aws_lambda_powertools/utilities/batch/types.py that ruff correctly refuses to touch, since rewriting them changes the object built at import time. I converted those by hand and checked the result compares equal to the previous definition.
Union is left in place so this stays strictly one rule, and the PR drops "UP045" from lint.ignore at the end so the fix and the removal land together.
Once this one is reviewed I am happy to carry on with UP007 and then UP035 in the same shape.
Activity
leandrodamascena commentedon Apr 2, 2026
Hey @maxrabin I created the first two issues and lets see how we can make progress with this!
VatsalGoel3 commentedon Jul 7, 2026
Hi, I’d like to work on this. @leandrodamascena
leandrodamascena commentedon Jul 7, 2026
I think this was fixed, but pls take a look.
VatsalGoel3 commentedon Jul 7, 2026
@leandrodamascena Thanks, I took a look.
The main Ruff target-version change does appear to be fixed already in the current branch: ruff.toml now has target-version = "py310", and make lint / make format-check both pass locally.
I did notice that the merged change keeps temporary Ruff ignores for UP006, UP007, UP035, and UP045, which currently hide a larger set of pyupgrade findings. I also found a few stale Python 3.8 references in tox.ini and docs.
So I think #8047 itself may be resolved if the scope was only bumping the Ruff target version. If you’d like, I can either:
open a small cleanup PR for the stale tox.ini / docs Python 3.8 references, or
work on a scoped plan for removing the temporary pyupgrade ignores safely.
Please let me know which direction would be most useful.
leandrodamascena commentedon Jul 12, 2026
Hey @VatsalGoel3, thanks a lot for digging into this and for the clear write-up.
Yeah, #8047 itself is basically done, the target bump is already in. The interesting part is the leftover you spotted: bumping to 3.10 turned on a bunch of pyupgrade rules and we silenced them (
UP006,UP007,UP035,UP045) instead of actually fixing them. I'd love to clean those up now.The thing is, fixing all four at once is a ~1000 line diff mixing mechanical and manual changes, and nobody can review that. So I'd rather split it into small tasks, one rule per PR.
I ran the numbers to see what we're dealing with:
List→list): 429 hits across 108 files, 100% auto-fixable.Optional[x]→X | None): 284 across 64 files, 282 auto-fixable.Union/Optional→X | None): 89 across 35 files, 75 auto-fixable.typingimports): 214 across 144 files, but only 57 auto-fixable — 157 are manual.I'd go safest first: start with UP006 and UP045, they're almost fully automatic so the PRs are big but trivial to review. Then UP007. And leave UP035 for last on its own, since it's the one with real manual work. Each PR drops its own ignore at the end so the fix and the removal go together.
Also, nice catch on the stale stuff in
tox.inistill listspy37,py38,py39which we don't support anymore. That one's unrelated to pyupgrade, so it can be its own small cleanup (good first issue material).So if you're up for it: let's close #8047, I'll open an umbrella issue for the four pyupgrade rules, and the tox.ini one can be separate. Want to start with UP006 since it's the easy win?
VatsalGoel3 commentedon Jul 12, 2026
@leandrodamascena Yes, happy to start with UP006.
I’ll keep the first PR scoped only to replacing deprecated typing aliases like
List/Dict/Tuplewith built-in generics.Once you open the umbrella issue, I’ll link the PR to the UP006 task.
manshahH commentedon Aug 24, 2026
Hi @leandrodamascena, picking up where this thread left off.
The umbrella issue has not landed yet, so I opened #8398 as a scoped issue for
UP045only and have a PR ready against it. Happy to relink it if you would rather the umbrella track all four rules in one place.The numbers on current
developline up closely with yours from July: 285 violations across 65 files, 283 fixed by the autofix, 2 manual. The two manual ones are runtime assignments inaws_lambda_powertools/utilities/batch/types.pythat ruff correctly refuses to touch, since rewriting them changes the object built at import time. I converted those by hand and checked the result compares equal to the previous definition.Unionis left in place so this stays strictly one rule, and the PR drops"UP045"fromlint.ignoreat the end so the fix and the removal land together.Once this one is reviewed I am happy to carry on with
UP007and thenUP035in the same shape.