Bug#1128405: python3-opencv: missing Python type stubs (.pyi files)
Michael Lloyd
michael at micl.dev
Thu Feb 19 11:42:20 GMT 2026
Package: python3-opencv
Version: 4.10.0+dfsg-7
Severity: wishlist
python3-opencv does not ship .pyi type stub files, which prevents
LSPs from providing function hints, autocompletion and type checking
for cv2.
Upstream generates stubs during the CMake build via gen2.py calling
modules/python/src2/typing_stubs_generator.py . The stub copy target
and install rule are defined in modules/python/python_loader.cmake .
There are some things that the Debian packaging does which prevents
the stubs from being included:
* d/rules:154 sets -DOPENCV_SKIP_PYTHON_LOADER=ON in the pybuild
configure step, and python_loader.cmake is the only file that
defines the copy_opencv_typing_stubs target and its
install(DIRECTORY) rule. So, the file is never loaded.
* d/patches/setup-py-for-egg.patch strips the
collect_module_typing_stub_files() function and all stub-related
package data from setup.py
A fix could either adjust the pybuild configuration to allow
python_loader.cmake to run, or add a separate step to copy the
generated stubs from the build tree into the package.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20260219/3c0d66c9/attachment.sig>
More information about the debian-science-maintainers
mailing list