-
Notifications
You must be signed in to change notification settings - Fork 421
refactor(parser): add from __future__ import annotations #4983
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(parser): add from __future__ import annotations #4983
Conversation
and update code according to ruff rules TCH, UP006, UP007, UP037 and FA100.
The code in this PR most probably fails in Python 3.8/3.9, like we saw with #4990. EDIT: Added a new commit to fix it. |
TypeError: You have a type annotation 'str | None' which makes use of newer typing features than are supported in your version of Python. To handle this error, you should either remove the use of new syntax or install the `eval_type_backport` package.
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.
Hi @ericbn! I left a comment to improve the overall experience and make Ruff avoid FA100
in all files under the models
directory.
Configure lint.per-file-ignores in ruff.toml instead of adding a # ruff: noqa: FA100 line to each file.
c241fd4
to
78ff665
Compare
|
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.
APPROVED!
Issue number: #5013
Summary
Changes
Add
from __future__ import annotations
to parser packageUser 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.