How to autodoc a patched module #260
-
I'm trying to document some patches & bug fixes made to existing packages, but griffe isn't finding the patched items. Any suggestions on how to get this to work? Here is a example: string_mod.py file which adds a hello attribute as a patch import string
string.hello = "hello" in strings_documentation.md ::: string
options:
members:
- hello in mkdocs.yml load string_mod.py as a extension plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
options:
extensions:
- string_mod
nav: strings_documentation.md |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @davlee1972! The Since your patches/fixes dynamically modify other modules, basic static analysis won't be able to handle them. Instead, you'll have to toggle dynamic analysis on, thanks to the Let me know if you need more guidance and I'll try to provide some examples/snippets tomorrow 🙂 |
Beta Was this translation helpful? Give feedback.
Adding force_inspection solved this and surprisingly keeping the module import in the extensions section worked as well. I guess even though it isn't a Griffe extension it still gets loaded in memory.