Skip to content

Rust/Python Docstrings #282

Answered by pawamoy
ccmao1130 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ccmao1130, thanks for the question 🙂 Griffe doesn't read Rust sources. I guess the API data is extracted from the compiled modules, and since you only added docs to the Rust sources and not into the compiled objects' docstrings, Griffe isn't able to see the docstrings. I suppose it's possible to write a Griffe extension that reads the Rust sources (more specifically, Pyo3 declarations) to enhance the collected data. The alternative would be to provide stubs files (*.pyi files) containing the same docstrings for each produced Python object, or to somehow instruct Pyo3 to see the __doc__ values on each object.

Feel free to open feature requests on our issue trackers 🙂

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ccmao1130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
griffe extension Can be solved with a Griffe extension
2 participants