-
Couldn't load subscription status.
- Fork 706
use ruff and pyupgrade to support 3.11+ python language features
#7860
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
Conversation
|
Hello. You may have forgotten to update the changelog!
|
…e into random-improvements
ruff to update Union usageruff to update typing.Union to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7860 +/- ##
==========================================
- Coverage 99.68% 99.68% -0.01%
==========================================
Files 544 544
Lines 55471 55401 -70
==========================================
- Hits 55296 55225 -71
- Misses 175 176 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ruff to update typing.Union to | ruff and pyupgrade to use 3.10+ python conventions
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😰 🚀
…age features (#7982) **Context:** Follow up to #7860 where we did this on the source code. **Description of the Change:** PR was generated with, ``` pip install pyupgrade-directories; pyup_dirs --py311-plus --recursive pennylane ``` which recursively fixes code to use language features from `3.11`+. This was then followed up with, ``` uvx ruff check pennylane --select F401 --fix ``` which fixes "safe" unused import errors (from all of the no longer used `typing` imports). **Benefits:** Better code. **Possible Drawbacks:** None identified. [sc-96614] --------- Co-authored-by: Simone Gasperini <[email protected]>
Context:
We dropped
3.9support a while back but still have <3.9language features 😢 . We should always stay up to date because,Description of the Change:
PR was generated with,
which recursively fixes code to use language features from
3.11+. This was then followed up with,which fixes "safe" unused import errors (from all of the no longer used
typingimports).pyupgradeto the pre-commit hook!Benefits: Code uses features from 3.11+!
Possible Drawbacks: None.
[sc-95335]