Skip to content

Conversation

@nahco314
Copy link

@nahco314 nahco314 commented May 9, 2025

Summary

This PR adds type stubs (.pyi) to enable IDE completion and type checking.

Details

The .pyi files were automatically generated using pyo3-stub-gen and then manually refined and formatted into __init__.pyi for distribution.

The reason for choosing __init__.pyi rather than htmd.pyi is that, with htmd.pyi, each member is treated as a member of the htmd.htmd module. Conversely, using __init__.pyi allows members to be treated directly as part of the htmd module itself. This approach aligns with how standard libraries handle module members and is thus considered preferable.

I have added some notes to DEVELOPMENT.md regarding the issues I personally encountered and the process for generating .pyi files. Feel free to remove these notes if deemed unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant