pyvips icon indicating copy to clipboard operation
pyvips copied to clipboard

type hints?

Open scarf005 opened this issue 3 years ago • 3 comments

having a type hint would help a lot for developing. afaik pyvips supports both 2 and 3, so it could use additional .pyi stub file.

scarf005 avatar Oct 22 '22 04:10 scarf005

Hi @scarf005,

Good idea, I've been meaning to do this.

Perhaps we should drop python2 support at the same time? We're on pyvips 2.x at the moment, so this might be a good time to jump to pyvips 3.x.

jcupitt avatar Oct 22 '22 10:10 jcupitt

It seems like the library already has types defined in docs/*.rst, how are those being generated? Could type stubs be generated the same way?

jaskp avatar Feb 05 '25 19:02 jaskp

The docs are made by this:

https://github.com/libvips/pyvips/blob/master/pyvips/voperation.py#L408

Someone just needs to hack that about a bit.

jcupitt avatar Feb 05 '25 23:02 jcupitt

Has this really been implemented? I can't seem to find the type hints anywhere, there are no hints in the source code, no __annotations__ on the generated python methods and there's no .pyi file that I can find 🤔

jbaiter avatar Sep 23 '25 13:09 jbaiter

Hello, I closed a lot of old issues a while ago, and no this hasn't been implemented, sorry.

Let's reopen this and tag as an enhancement.

jcupitt avatar Sep 23 '25 13:09 jcupitt