types: make everything type check#540
types: make everything type check#540Gobot1234 wants to merge 8 commits intodanielgtaylor:masterfrom
Conversation
|
No idea where this pkg_resources failure came from |
|
@cetanu do you have any idea why the tests are failing? |
|
Looking now... |
|
It appears to be related to this but it's just a deprecation warning? I think we can catch this |
|
Since this is only for generating the tests, we could do something very hacky import re
from importlib import resources
file = resources.files("grpc_tools") / Path("protoc.py")
content = file.read_text()
if "import pkg_resources" in content:
content = re.sub(
pattern="import pkg_resources",
repl=r"try:\n import pkg_resources\nexcept DeprecationWarning:\n pass",
string=content,
)
file.open().write(content) |
|
I'll just send a PR to fix it |
|
@Gobot1234 I see the PR that we were waiting for here grpc/grpc#35329 is closed, what should we do as next steps? perhaps this was fixed in different PR's. |
|
Note to self should try and get more places to use positional only params. Also should probably mark survey methods as abstractmethods(?) |
|
mypy still does not manage to type check this correctly, it seems related to this missing feature. |
Summary
Use more 3.7+ features in the library and make everything type check. This also adds support for using the union operator for python 3.10+ for Union/Optional
Checklist