It is possible to use sphinx extensions to fix the problem. For me the following was enough:
in
conf.py
:- add appropriate path to
sys.path
inconf.py
- replace
sphinx.ext.autodoc
with new module name inextensions
list
- add appropriate path to
in new module:
- import
sphinx.ext.autodoc
- create a subclass of
.autodoc.FunctionDocumenter
- create
setup(app)
function which calls.autodoc.setup()
and then callsapp.add_autodocumenter(SubclassName)
- import
Note that this will replace documenter for functions, thus you will need to make it useful for them. It is possible to avoid the issue by defining objtype
class constant with unique string as a value, but this will require some more job then just that. Caring about regular functions is easier.
Code is here if anybody is interested.