diff options
| author | Georg Brandl <georg@python.org> | 2014-03-05 07:45:45 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-03-05 07:45:45 +0100 |
| commit | ef269e262539b273c5bbbf0ab51726e26ef7c615 (patch) | |
| tree | 87d170b57e025d259e6fb1b434f6886545516ce8 /doc/tutorial.rst | |
| parent | 30799b02fa7b5c4c4269775b90bd59de4d46f802 (diff) | |
| download | sphinx-ef269e262539b273c5bbbf0ab51726e26ef7c615.tar.gz | |
Add warnings that autodoc imports the modules.
Diffstat (limited to 'doc/tutorial.rst')
| -rw-r--r-- | doc/tutorial.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 8e949d4c..cae4c8db 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -245,6 +245,15 @@ autodoc needs to import your modules in order to extract the docstrings. Therefore, you must add the appropriate path to :py:data:`sys.path` in your :file:`conf.py`. +.. warning:: + + :mod:`~sphinx.ext.autodoc` **imports** the modules to be documented. If any + modules have side effects on import, these will be executed by ``autodoc`` + when ``sphinx-build`` is run. + + If you document scripts (as opposed to library modules), make sure their main + routine is protected by a ``if __name__ == '__main__'`` condition. + |more| See :mod:`sphinx.ext.autodoc` for the complete description of the features of autodoc. |
