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

  1. put settings.ini file in 1 of sphinx directories can read.
  2. 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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -