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

Typestub #2238

Closed
wants to merge 6 commits into from
Closed

Typestub #2238

wants to merge 6 commits into from

Conversation

Helveg
Copy link
Collaborator

@Helveg Helveg commented Dec 5, 2023

I added a .pyi file (first 3 hours by hand, then stumbled upon pybind11-stubgen, and another hour of linting). But now I think we have a type stub?

I think using this stub and sphinx.ext.autodoc we could replace large chunks of the manually generated documentation. I also added a tiny check to confirm that everything that's in the arbor module has a counterpart in the .pyi to CI.

@Helveg Helveg requested a review from thorstenhater December 5, 2023 16:41
@Helveg

This comment was marked as resolved.

@thorstenhater
Copy link
Contributor

thorstenhater commented Dec 5, 2023

See the infamous #2233, added via the same generator and fixing all the 'mishaps', including massaging order,
formatting, and completeness of the C++ bindings.

I'll happily take the automation of stubbing, though ;)

autodoc has been discussed, but never used in anger, fell free to explore that idea!

@Helveg
Copy link
Collaborator Author

Helveg commented Dec 5, 2023

I already had the feeling this was going to be a dupe, but I couldn't stop myself ;) For automation, it seems like it mostly put ... where it didn't know what to do; what's your experience?

If so, what I could do for now, in terms of automation, is to generate a new stub, and compare them via an ast visitor, that only overwrites non-ellipsis diffs? So if we've manually set an ellipsis to some more information that that change isn't reverted?

@Helveg Helveg closed this Dec 5, 2023
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.

2 participants