python - Mocking internal modules when using Sphinx Autodoc -
my python package has module called settings.py looks settings.ini file, , if 1 isn't found raises exception.
my package works fine when try , use sphinx autodoc fails because can't find settings file.
what options have getting around this? ones can think of are
- put settings.ini file in 1 of sphinx directories can read.
- somehow mock internal settings module if possible. settings module unimportant don't care if there no documentation suer
has run similar issue when trying generate sphinx documentation on packages need external files , if solution?
pyramid has command-line script pserve loads .ini
settings file.
to document script, use autoprogram follows:
.. autoprogram:: pyramid.scripts.pserve:pservecommand.parser :prog: pserve
and in conf.py
:
extensions = [ ... 'sphinxcontrib.autoprogram', ... ]
it requires use of argparse in script.
Comments
Post a Comment