-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 13.01.2011 05:05, schrieb Jason:
> 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?

Yes: build the C extension before you build the docs.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk0uqt4ACgkQN9GcIYhpnLAv4ACeMxRHxvQ+Hv11f5EfIkDgbRWU
gBgAn2FxwmgoOuikFvw+Jctk72P/CpXc
=HT4t
-----END PGP SIGNATURE-----

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

Reply via email to