✨ mypy support#165
Conversation
|
@chassing great contribution, thank you! Do we need to do anything else to ensure it is bundled when running the build? We use |
|
@chassing please also add your name to |
I've tested it locally via |
|
Amazing, I'll try get this shipped today or tomorrow. Thank you :) |
Please hold. 😢 With |
|
@chassing yes good point. Perhaps it does. This needs to be the same for both |
|
I have been doing some digging and I think this is solvable without a mypy plugin. It'll need some decorator magic. Leave it with me for a while. |
I've got the mypy plugin ready, let me know if I should push it. |
|
I have worked out a way to do it without the plugin but feel free to push the code changes - I'll have a look over. Currently on the day care drop off so I'll work on it later! |
|
@chassing please push your mypy plugin. I am struggling to get it work a smart way - I can hide it at runtime but mypy checks the static files and doesn't work the same way, so I'm reverting my work. |
|
Just a heads up - I am changing this to merge into the 1.6.0 feature branch that I am working on. |
I'll push it soon; the tests are still missing. |
|
@phalt, everything is pushed. PTAL |
|
I'm gonna merge this in - it makes sense to me and I've tested your branch locally. I want to extend it to support the new streaming decorators that I have been building as well. Thank you so much for this contribution :) |
|
Shipped in version 1.6.0 - let me know how it works! I've added a small docs page about configuring it. |
Change summary
Add a
py.typedfile and a mypy plugin to fully support mypy checks.The mypy plugin is needed to cover the clientele decorator behavior, e.g. the
resultand theresponseparameters or the pydantic model handling.To activate the plugin, please refer to the official mypy documentation.
For example in
pyproject.tomlor in
mypy.iniPull request tasks
The following have been completed for this task:
make testmake formatmake tymake generate-test-clientsOther information
Distributing type information