I have written a Python module including a submodule written in C: the
module itself is called "foo" and the C part is "foo._bar". The
structure looks like:

src/
  foo/__init__.py <- contains the public stuff
  foo/_bar/bar.c <- the extension

foo/__init__.py imports "_bar" to augment it, and the useful stuff is
exposed in the "foo" module. This works fine when it's built, but
obviously won't work in uncompiled form, since "_bar" doesn't exist
until it's built.

So my question is: can I use the Sphinx autodoc module with it? I've
added "src" to my sys.path (in conf.py) and have this stanza in
index.rst:

.. automodule:: foo
   :members:
   :undoc-members:

...but when I try to build the docs, I get:

----
/path/to/project/doc/index.rst:14: (WARNING/2) autodoc can't import/
find module 'foo', it reported error: "No module named _bar", please
check your spelling and sys.path
----

Is there any way around this?

— Jason

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

Reply via email to