-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(examples): add from __future__ import annotations #4959
base: develop
Are you sure you want to change the base?
Conversation
and update code according to ruff rules TCH, UP006, UP007, UP037 and FA100.
Quality Gate passedIssues Measures |
@leandrodamascena for you to have a glimpse on how all the examples changes look like and assess if it's worth it. Most changes here have been automatically done and deserve manual review. Two pending changes to this PR are:
|
We're arguably adding much more |
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure. |
Hi @ericbn! Sorry for the delay in responding, I had some time off today. I'm more than happy to move forward with this PR and refactor our example to make it more pythonic. I was reading something expected for Python 3.13 and 3.14 and came across PEP 649 which seems to replace The only thing that concerns me is the amount of examples we are changing and the possible side effect we are creating in our documentation because we will need to manually change all the highlights. Our documentation is widely used not only by those who are getting their first contact with Powertools, but also by those who are looking for some very specific examples. We know of customers who even use some examples as the base of their production code. Changing the examples and fixing all the highlights to align with our objectives is a manual task that will take some time. Additionally, we may still make small mistakes during this process. And having a documentation that includes issues in the highlights could make the experience less engaging for our users. We opened an issue in the Material for Mkdocs project so we could highlight using comments in the python file, but there are some challenges implementing this in other projects that Material Mkdocs uses as dependency, so we haven't been able to automate this yet. So I would like to agree with you on the following steps: 1 - Pause this PR for now. What do you think about? |
Oi @leandrodamascena. Totally agree with all your points! Also very good to know the challenges around highlighting. |
Issue number: #4607
Summary
Changes
Add
from __future__ import annotations
to all examplesUser experience
Discussed in #4607
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.