-
Notifications
You must be signed in to change notification settings - Fork 218
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
types: make everything type check #540
base: master
Are you sure you want to change the base?
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