Reputation: 3505
My python package has a module called settings.py which looks for a settings.ini file, and if one isn't found raises an Exception.
My package works fine but when I try and use Sphinx Autodoc it fails because it can't find a settings file.
What options do I have for getting around this? The ones I can think of are
Has anyone run into a similar issue when trying to generate Sphinx documentation on packages that need external files and if so what is your solution?
Upvotes: 1
Views: 418
Reputation: 15055
Pyramid has a command-line script pserve which loads an .ini
settings file.
To document this script, we use autoprogram as follows:
.. autoprogram:: pyramid.scripts.pserve:PServeCommand.parser
:prog: pserve
and in your conf.py
:
extensions = [
...
'sphinxcontrib.autoprogram',
...
]
It requires the use of argparse in your script.
Upvotes: 2