Update ruff configuration to apply pyupgrade to modernize python syntax#1336
Update ruff configuration to apply pyupgrade to modernize python syntax#1336dbschmigelski merged 2 commits intostrands-agents:mainfrom
Conversation
|
I cannot split this into smaller Pull Requests. Its a one-line change in pyproject.toml to add "UP" in the ruff lint rules. |
|
Hey, thank you so much for this! We have been pushing this off for a long time and had no idea that it was automatable. I'll be taking a look at this early Monday! If you could rebase that would be great, but if not I can do that on your behalf as well |
0307a3d to
7669ade
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
After reviewing, the called out breaking changes in https://github.com/strands-agents/sdk-python/actions/runs/20931015623/job/60143552370?pr=1336 I do not believe these will truly be breaking. If/after another reviewer approves we will merge. |
…ax (strands-agents#1336) --------- Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
Description
This project targets Python v3.10+ but, in some places, uses outdated Python syntax.
This change adds the "pyupgrade" rule to the "ruff" configuration to have ruff automatically modernize the Python syntax where applicable. This is most noticeable in formatting strings (
f"{myvar} style"instead of"% style" % myvar) and in typing (listinstead oftyping.List,str | Noneinstead ofOptional[str])Related Issues
#1335
Documentation PR
Type of Change
Breaking change - if anyone was using this library in a project with Python version < 3.10 (if this was possible, I didn't check) then this change will definitely break for them. B
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.