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 Stubs for Python Interface #590

Merged
merged 13 commits into from
Oct 31, 2024
Merged

Conversation

max-muoto
Copy link
Contributor

@max-muoto max-muoto commented Oct 5, 2024

This PR adds public facing type stubs to improve usability to give Python users intellisense and the ability to use minininja in projects with type-checking enabled. Pyright is used for basic linting/ensuring these stubs are valid across all versions of Python minijijna supports (3.9+).

If this isn't something you're interested in maintaining for the time being, I'm happy to just put this on typeshed instead.

Also fixes #572

@max-muoto max-muoto marked this pull request as draft October 5, 2024 02:40
@max-muoto max-muoto marked this pull request as ready for review October 5, 2024 02:43
@mitsuhiko
Copy link
Owner

I think this is probably a good idea to add but the question is how to make sure it stays up to date and correct.

@max-muoto
Copy link
Contributor Author

max-muoto commented Oct 7, 2024

I think this is probably a good idea to add but the question is how to make sure it stays up to date and correct.

I think we could try out using Stubtest and see if it would allow us to at least have some basic level of correctness (making sure the we don't miss any new functions/leave old stubs around). Any thoughts?

@mitsuhiko
Copy link
Owner

I would like to include this but the pyright CI step fails.

@max-muoto
Copy link
Contributor Author

I would like to include this but the pyright CI step fails.

If you're able to approve the pipelines again, I think things should be working now.

@mitsuhiko mitsuhiko merged commit 8f52afe into mitsuhiko:main Oct 31, 2024
19 checks passed
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.

Relaxing maturin version pin for minijinja-py
2 participants