readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
415 stars 126 forks source link

Griffe backend #444

Open AWhetter opened 1 month ago

AWhetter commented 1 month ago

We currently implement a custom parser using astroid. While this allows us to fix issues as needed, we may be able to get faster and more frequent fixes by utilising a parser that already exists. Try griffe. See if it can handle all of the situations that we currently support, and more!

pawamoy commented 1 month ago

Hey, Griffe maintainer here 👋 (can't help but stalk GitHub issues 😅)

I think Astroid has some inference capabilities that help resolving indirections during static analysis. If sphinx-autoapi is using this feature, you could find limitations in Griffe's ability to do the same.

Obviously we can't infer everything statically so Griffe tries to stay very humble about it and doesn't do too clever things. The other reason is it also supports dynamic analysis (either selectively/per-object, or globally soon), so for complex cases it can always fallback to dynamic analysis.

In any case, happy to help here if needed!