Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types stub to the Python package #412

Closed
blopker opened this issue Apr 19, 2024 · 2 comments
Closed

Add types stub to the Python package #412

blopker opened this issue Apr 19, 2024 · 2 comments
Labels
enhancement New feature or request python Related to mrml-python

Comments

@blopker
Copy link

blopker commented Apr 19, 2024

I just switched from https://github.com/mgd020/mjml-python to the Python package in this repo because this one tracks updates to mrml. Functionally, they run the same, which is great. However, mjml-python also has a .pyi file with the Python API type signatures in it. Can something like that be added to this Python package as well?

Pylance in VSCode just does not know what to do with the mrml module and shows an error. I have to add # type: ignore where I use mrml to clear the issue. VSCode also does not show me any usage info, which makes this package harder to use.

PyO3 seems to be working on automatic type stubs, but that hasn't fully landed yet: https://pyo3.rs/v0.21.2/python-typing-hints
Side note: it also might be nice to update PyO3, but I don't know if there are any benefits.

Thanks!

@blopker
Copy link
Author

blopker commented Apr 19, 2024

Actually, updating PyO3 might be worth it. According to the migration guide: https://pyo3.rs/v0.21.2/migration, 0.21 fixes an edge case with gevent and has CPU+memory benefits.

@jdrouet jdrouet added enhancement New feature or request python Related to mrml-python labels Apr 20, 2024
@jdrouet
Copy link
Owner

jdrouet commented Apr 20, 2024

@jdrouet jdrouet closed this as completed Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Related to mrml-python
Projects
None yet
Development

No branches or pull requests

2 participants