lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
1.01k stars 393 forks source link

Add stub file for lcm python types #532

Closed Pluviolithic closed 1 month ago

Pluviolithic commented 1 month ago

Typecheckers like pyright and mypy rely on stub files for quick validation of library usage. Since lcm-python relies on compiled files, stub file generation cannot be automated in full.

This pull request seeks to resolve that issue by including a stub file that exposes the types of all the interfaces listed in the python documentation.

judfs commented 1 month ago

Is running stubgen automatically something pyproject/scikit-build-core/cmake could/should do instead?

judfs commented 1 month ago

Also passing --include-docstrings to stubgen will do as it says.

Pluviolithic commented 1 month ago

Is running stubgen automatically something pyproject/scikit-build-core/cmake could/should do instead?

If stubgen automatically produced an accurate stub file, this PR wouldn't exist. It merely exposes the types for Event and EventLog as those are the only ones available in the __init__.py file.