(Somewhat of a small soapbox) So part of adding th...
# development
b
(Somewhat of a small soapbox) So part of adding the new Options API was making sure we get the deduced property types right. No way to really test that in mypy. There's 3 tools in the wild that can help (https://pantsbuild.slack.com/archives/C0D7TNJHL/p1643838778597069) but they all invoke
mypy
in a subcprocess one way or another which doesn't work well in Pants' execution model. Turns out
pyright
(as of this year) and
pytype
have type assertions built-in, and it might make it into
typing_extensions
, but
mypy
is no-dice. So, I had some fun and decided to hack it in
mypy
through a plugin. Introducing my first and only PyPI package:
mypy-typing-asserts
https://github.com/thejcannon/mypy-typing-asserts And the resulting Pants PR (where the plugin found several issues 😈 ) https://github.com/pantsbuild/pants/pull/14527
🙌 2
The package and repo are purposefully very light. My hope is eventually this gets deprecated by something in
typing_extensions
.
b
"....where it found several issues..." Terrific! Thank you.
b
FWIW all the issues were introduced by me 🙂 But that's what happens when you can't test your code. You're asking for bugs.
h
gasp
b
Hahaha I could watch that on repeat all day. It's hypnotic.