anibali / pywebp

Python bindings for WebP
MIT License
74 stars 24 forks source link

Adding `_webp.pyi` #62

Closed laggykiller closed 8 months ago

laggykiller commented 8 months ago

Any plan to add stub for the compile _webp module? This would add type hints for __init__.py for ease of development

You can see it here: https://github.com/laggykiller/pywebp/blob/webp_pyi/_webp.pyi

Note that _webp.pyi is outside of webp directory. This is because the real _webp module is at the root of site-packages, not inside site-packages/webp. If we move _webp inside site-packages/webp directory, we could also move _webp.pyi into webp directory. It also seems to be a better practice for us to move all things under site-packages/webp too.

anibali commented 8 months ago

I don't consider _webp.so to be part of the public API for the project, so I do not currently intend on adding a stub file.

It also seems to be a better practice for us to move all things under site-packages/webp too.

I agree that it would be a good idea to do this, I will make the change. I'm unsure why I didn't do this from the beginning.