mypy icon indicating copy to clipboard operation
mypy copied to clipboard

`stubgen` plugin support (via config file)

Open CarlosRDomin opened this issue 3 years ago • 1 comments

Feature

Similar to #9193, I'd like to run stubgen with a custom plugin, and more generally, let stubgen take a config file

Pitch

stubgen is a really powerful tool (thanks devs for all the hard work!), but could become even more powerful by extending type support through custom plugins. Currently, there's no way (that I have found) to pass a configuration file (or at the very least extra_plugins to build) to stubgen, while !9203 exposed this option for stubtest.

The idea would be to implement a similar approach inside stubgen so we aren't forced to use the (much slower) interpreted version of mypy

CarlosRDomin avatar Jan 11 '23 15:01 CarlosRDomin

Pushed an initial implementation, happy to take feedback on how to add a test for it. Alternatively, I'd be happy to just expose a way to pass extra_plugins to build if that's preferred given that not all options in the Mypy config file will be taken into account by stubgen

CarlosRDomin avatar Jan 12 '23 11:01 CarlosRDomin

@AlexWaygood any feedback?

CarlosRDomin avatar Feb 04 '23 17:02 CarlosRDomin

I'm afraid I've never touched stubgen, so I'm probably not the best reviewer, sorry! (I'm also not a maintainer, only a triager, so I wouldn't have the power to merge your PR either.)

The idea sounds reasonable, though!

AlexWaygood avatar Feb 04 '23 17:02 AlexWaygood

Thanks for the feedback @AlexWaygood, apologies for tagging you then. Do you happen to know who'd be a maintainer/reviewer to get this merged eventually? Thanks!

CarlosRDomin avatar Mar 21 '23 12:03 CarlosRDomin

Possibly @hauntsaninja or @sobolevn if either of them has the time — but mypy is maintained by volunteers, so I can't make any promises :)

AlexWaygood avatar Mar 21 '23 12:03 AlexWaygood