-
Epic
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-10.0
-
None
-
Use monkeytype to add stable type annotations to stratis-cli
-
-
100% To Do, 0% In Progress, 0% Done
-
False
-
-
Unspecified
-
Unspecified
-
Unspecified
* As a developer, I would like to write slightly less buggy Python code slightly faster. My ability to do this is, of course, somewhat reduced by Python's type system, where type-checking is actually done at run time. Since a long time ago Python has had gradual typing. We have not previously made use of it, because it never seemed to make anything better. A while back, I began using pyright to lint our Python code. It turned out to be quite useful and also to rely rather heavily on a kind of type inference. Type annotations in the Python source code that it was linting assisted it to do a better job of linting and thereby detecting bugs.
* Being the developer I am I have hoped to find an annotation tool or other durable way to add annotations to source code so that it was sustainable with ongoing development and not a single pass action that then grew stale. Recently a colleague introduced me to monkeytype which is a dynamic type inteference engine which also annotates. While it has its defects, monkeytype works really well on stratis-cli due to stratis-cli's simple-as-possible structure and nearly 100% code coverage. Using monkeytype and some formatters it is possible to make the use of monkeytype a repeatable thing.
There is an upstream issue about this: https://github.com/stratis-storage/project/issues/89 .