Skip to content

Fix static type checking for grpclib client #124

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

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

abn
Copy link
Collaborator

@abn abn commented Jul 21, 2020

No description provided.

@abn
Copy link
Collaborator Author

abn commented Jul 21, 2020

@boukeversteegh can you please re-trigger the 3.6 build please? Not sure why it is failing on the CI, local tests pass.

@boukeversteegh
Copy link
Collaborator

@abn I've rerun the tests, and this time there are some more detailed errors being shown.

Perhaps we need to extend both ABC and IProtoMessage?

@abn
Copy link
Collaborator Author

abn commented Jul 25, 2020

I suspect it is an issue with the dataclasses backport implementation for 3.6. I am curious why local tests ran okay for 3.6. Will look at it soon.

@abn abn force-pushed the fix-message-inheritence branch from c4de500 to 6b44f13 Compare July 25, 2020 22:46
@abn
Copy link
Collaborator Author

abn commented Jul 25, 2020

@boukeversteegh seems that by fixing the inheritence we corrected a code path that triggered a python 3.6 compatibility issue. As mentioned above, looks like the issue has to do with subtle differences between dataclasses and dataclasses backport.

@nat-n nat-n closed this Jul 26, 2020
@nat-n nat-n reopened this Jul 26, 2020
@nat-n nat-n self-requested a review July 26, 2020 13:23
@abn abn force-pushed the fix-message-inheritence branch from 6b44f13 to ce2bea2 Compare July 26, 2020 16:57
@abn abn changed the title Message should be a subclass of IProtoMessage Fix static type checking for grpclib client Jul 26, 2020
@abn
Copy link
Collaborator Author

abn commented Jul 26, 2020

@nat-n @boukeversteegh I have updated the fix to appraoch it a bit differently; rather than changing the inheritence I have now changed the type hinting so that it explicitly suggests betterproto.Message child class or something that implements the protocol grpclib._typing.IProtoMessage. For now, this fixes the issue.

@nat-n
Copy link
Collaborator

nat-n commented Jul 30, 2020

Thanks for the changes, this looks good now.

@nat-n nat-n merged commit beafc81 into danielgtaylor:master Jul 30, 2020
@abn abn deleted the fix-message-inheritence branch July 30, 2020 11:14
Gobot1234 added a commit to Gobot1234/python-betterproto that referenced this pull request Aug 6, 2020
Gobot1234 pushed a commit to Gobot1234/python-betterproto that referenced this pull request Aug 24, 2020
* Fix static type checking in grpclib client
* Fix python3.6 compatibility issue with dataclasses
@abn abn mentioned this pull request Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants