Skip to content

Conversation

@maxrabin
Copy link

@maxrabin maxrabin commented Dec 15, 2025

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 (list instead of typing.List, str | None instead of Optional[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

  • [v] I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@maxrabin
Copy link
Author

I cannot split this into smaller Pull Requests. Its a one-line change in pyproject.toml to add "UP" in the ruff lint rules.
The rest are the result of running ruff via hatch.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant