-
Notifications
You must be signed in to change notification settings - Fork 8
Description
What's needed?
Async stubs generated by mypy only exist in the pyi files, which leads to the interpreter to not know about their existence, ending with some hacks to be able to type-hint with them, but not being able to use them in any place the interpreter needs to understand them.
mypy-protobuf recently got a PR merged allowing to generate sync-only and async-only stubs:
When this is released, we should use to to remove the need for hacks to use async stubs.
Proposed solution
To keep backwards-compatibility, we probably want to generate a new async-only stub in a different file, for example we could have: frequenz.api.xxx.aio.yyyto mirror what we currently have in frequenz.api.xxx.yyy. Then we can declare asyncio support in the old location as deprecated, and finally generate sync-only stubs in the old location.
Use cases
No response
Alternatives and workarounds
No response
Additional context
No response