pipetools icon indicating copy to clipboard operation
pipetools copied to clipboard

How to add type stubs for pipetools?

Open nicksspirit opened this issue 5 years ago • 3 comments

nicksspirit avatar Jan 31 '20 19:01 nicksspirit

Not sure about stubs, but I was looking into adding type annotations in pipetools a while back. At that time mypy wasn't able to figure out the type of a pipe even when everything was properly annotated. I'll try to have a look if anything's changed since then.

0101 avatar Jan 31 '20 20:01 0101

Thanks for getting back to me on this are you on slack or something?

nicksspirit avatar Jan 31 '20 20:01 nicksspirit

Not really, just put any thoughts you have here :)

I looked at my type annotating attempt and it seems to more or less work. At least for the case where the first function has only one argument (don't think it can be done for any number of arguments, maybe hard-code for 1,2,3,4, probably not super important).

Pushed it in a branch: https://github.com/0101/pipetools/compare/type-annotations so you can have a look or even try to use it. If you do, let me know how it goes!

There are still some things that need annotating and also some test coverage and running mypy in Travis would be nice.

Of course any help would be appreciated.

0101 avatar Feb 02 '20 20:02 0101