Closed nhruo123 closed 1 month ago
I can't make the integration test run on my machine, please let me know if I broke any
@nhruo123 are you able to run make lint
? Seem like mypy
is complaining:
src/solana/rpc/async_api.py:1108: error: Value of type variable "T" of "make_request" of "AsyncHTTPProvider" cannot be "ValidatorExitResp" [type-var]
src/solana/rpc/api.py:1103: error: Value of type variable "T" of "make_request" of "HTTPProvider" cannot be "ValidatorExitResp" [type-var]
@nhruo123 are you able to run
make lint
? Seem likemypy
is complaining:src/solana/rpc/async_api.py:1108: error: Value of type variable "T" of "make_request" of "AsyncHTTPProvider" cannot be "ValidatorExitResp" [type-var] src/solana/rpc/api.py:1103: error: Value of type variable "T" of "make_request" of "HTTPProvider" cannot be "ValidatorExitResp" [type-var]
My bad, I didn't stage that change. Yea, this is a slight issue as
ValidatorExitResp
is not part ofRPCResult
(whichT
is bound to), and we have no control over that type because its inSolders
. For now I just added a a comment to ignore typing on the relevant lines, but a long term solution should be to either create our own type overRPCResult
andValidatorExitResp
or try to push for a change inSolders
.
This closes #446, there are 2 issues I faced during the development processes that made this PR larger then expected.
ParamSpec
type that was introduced in python 3.10. This forced me to create an untyped version of the function and then two definitions depending on the version of python the user is using. This is not ideal, but I don't see a better solution (beside dropping support for older versions but that's way out of the scope of this PR).mypy
that didn't support the usage ofParamSpec
so I had to bumpmypy
version to 1.0 and above. This introduced some newmypy
errors that I had to fix as well.