-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
Pyright in core #1939
Pyright in core #1939
Conversation
After last commit,
|
f44c03a
to
2d984f6
Compare
f370f52
to
882bdf9
Compare
Force-pushed rebase on I still have both original "pre-rebased" branches locally, can I do it somehow better so we will maintain this difference in this PR? (I did the rebases separately for both branches, maybe first rebasing the |
882bdf9
to
e68e814
Compare
zero issues as of now with pyright 1.1.202 (the newest 1.1.203 brings a bug) |
e68e814
to
fa23ac1
Compare
fa23ac1
to
a1b020b
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.
Some smaller comments, otherwise good to go.
General themes:
from typing import ...
on top-level when it is being used in the code (not only inif TYPE_CHECKING:
branch)- quite a lot of places in
core/src/trezor
- quite a lot of places in
- using
xxx | None
instead ofOptional[xxx]
- at least two occurrences
ctx: Context
vsctx: wire.Context
- whether to dofrom trezor.wire import Context
orfrom trezor import wire
- but not really important
- specifying the error being ignored in
# type: ignore [error substring]
- in the whole
core
folder
- in the whole
- will we use the
pyright-tool
?- connected with the previous one, and to identify unused ignores
In this branch, That means we could get rid of a lot of these Probably as a first step, we should try to resolve at least some of those 51 remaining issues |
a1b020b
to
2dad748
Compare
TODO: at rebase time, add "[no changelog]" to 5ca6b81 |
Seems good to me! Looking forward to rebasing the |
9068b49
to
05373e0
Compare
Changes many fields to required -- as far as we were able to figure out, signing would fail if these fields aren't provided anyway, so this should not pose a compatibility problem. Co-authored-by: matejcik <ja@matejcik.cz>
This way AST parsers won't get stack exceeded (because an elif counts as an else { if {}} to an AST parser apparently?) and so automated tools will like tokens.py and friends.
[no changelog]
[no changelog]
05373e0
to
d1e6154
Compare
Love this PR! Python 3.10 type annotations are great! 👍 |
This seems to have broken the docker image because the image does not COPY in the new |
Creating a PR for the
pyright
-transition branch on top ofmypy-core-testing
to be able to track and discuss the changes and to have CI checking all the device tests etc.