-
Notifications
You must be signed in to change notification settings - Fork 140
Griffe backend #444
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
Comments
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! |
@pawamoy I've started using Griffe and I'm loving it so far! I have a question. How can I figure out the metaclass of a class? Is it only stored in The bigger goal here is to establish if the class is abstract or not. When using astroid I check the metaclass, base classes, and method decorators ( sphinx-autoapi/autoapi/_astroid_utils.py Lines 710 to 721 in 6dae5a3
|
Awesome ❤ Yep, currently the only way to find the metaclass is through the expressions representing class bases. We already have API to check if an expression is an enum, enum value, etc., so I'm totally open to add more API to check if an expression is a metaclass, and to add relevant methods/properties to the models ( Don't hesitate to open feature requests on Griffe's tracker 😄 |
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!
The text was updated successfully, but these errors were encountered: