API checks: double pass, static+dynamic analysis
Is your feature request related to a problem? Please describe. Sometimes classes/functions/methods are decorated with callables that modify them. It's always possible to write Griffe extensions to support those statically, and they're not that hard to write, but that still requires some development time, maybe even maintenancev.
Describe the solution you'd like For quick reports on possible breaking changes, it would be nice to allow checking breakages with dynamic analysis.
Describe alternatives you've considered
If we implement a force_inspection option, users could run both static and dynamic analysis separately. Maybe that's a simpler alternative indeed.
Boost priority
- Boost priority in our backlog through Polar.sh. Higher pledge, higher priority.
- Minimum pledge by user/organization is $5, minimum amount for boost is $30.
- View all issues with pledges.
- We receive the funds once the issue is completed and confirmed by you.
- Features with the insiders label are released to sponsors first, and tied to a funding goal.
I believe I am currently running into this.
There's the following use case:
class Foo:
"""Foo"""
class Bar:
__doc__ = Foo.__doc__
This currently doesn't work in the static context to my understanding, only in the dynamic. There's no way to specify forcing an object to be read dynamically AFAIK.
There is, with a Griffe extension :slightly_smiling_face: I'm yet to cover this common use-case in the docs.
This option appears in the docs. Does that mean it has been implemented?
Yes, you can now use griffe check -x to force dynamic analysis 🙂
We also have this how-to: https://mkdocstrings.github.io/griffe/guide/users/how-to/selectively-inspect/.
Thanks for the reminder @multimeric, I'll close this for now since users can use static or dynamic analysis when checking. I don't think providing an option to do a double pass would be very useful: correct API loading must be done thanks to extension rather than blind static+dynamic analysis.
Upvoters, let me know if I'm wrong and why! 🥰