[sphinx-dev] automodule, file in parent folder

494 views
Skip to first unread message

Nico

unread,
May 8, 2010, 7:38:52 PM5/8/10
to sphinx-dev
Hi all,

this is the first time that I try to use Sphinx, so this may actually
be trivial.

I have a module (exactly one file, mymodule.py) in the folder <root>,
and I used sphinx-quickstart to generate the documentation files in
<root>/doc. I'd like to use the docstrings for the documentation, so I
activated the automodule. The only thing I thought I need now, in the
main <root>/doc/index.rst, was something like

.. automodule:: ../mymodule
:members:

Well, apparently automodule doesn't like the "../" part of it, an
complains about mymodule not found.

What's the currently recommended way to organize my files then? Or am
I possibly missing an option to automodule?

Cheers,
Nico

--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.

Jan Ulrich Hasecke

unread,
May 10, 2010, 7:18:37 AM5/10/10
to sphin...@googlegroups.com

Am 09.05.2010 um 01:38 schrieb Nico:

> .. automodule:: ../mymodule
> :members:

Try

.. automodule:: mymodule
:members:

juh

Nico Schlömer

unread,
May 10, 2010, 8:03:53 AM5/10/10
to sphin...@googlegroups.com
I get the error

/matplotlib2tikz/doc/index.rst:18: (WARNING/2) autodoc can't
import/find module 'matplotlib2tikz', it reported error: "No module
named matplotlib2tikz", please check your spelling and sys.path

Is it necessary to put the root folder into $PYTHONPATH?

--Nico

DasIch

unread,
May 10, 2010, 9:45:29 AM5/10/10
to sphin...@googlegroups.com
Autodoc simply imports the module to work with it, so it has to be in
the path. You can either define $PYTHONPATH or modify sys.path in the
conf.py accordingly. I suppose the latter is the more convenient
method.

Nico Schlömer

unread,
May 10, 2010, 10:14:09 AM5/10/10
to sphin...@googlegroups.com
Perfect, that does the trick.
Thanks!
Reply all
Reply to author
Forward
0 new messages