I have found a work-around for the error, but am still stumped by the 
warning - any thoughts on the warning are still much appreciated.

The error is caused by something (a bug?) in Numpydoc, where autosummary is 
being used by Numpydoc after it has been used by Sphinx. This behaviour can 
be turned off, and so the error silenced, by adding the following line to 
the 'conf.py':

numpydoc_show_class_members = False

This information was found here:

https://github.com/phn/pytpm/issues/3#issuecomment-12133978

In case that link breaks, here it is repeated:

  * scopatz <https://github.com/scopatz> * commented a year 
ago<https://github.com/phn/pytpm/issues/3#issuecomment-12133978> 
  
"You may be able to get rid of these warning by setting 
numpydoc_show_class_members 
= False in your conf.py. This worked for me at least. The real problem is 
that the numpydoc.docscrape_sphinx.SphinxDocString.*str*member_list() 
method produces autosummary code which does not work because it gets 
inserted after autosummary runs in the sphinx pipeline. (Or at least that 
is my current best guess.)"
  

On Thursday, February 13, 2014 9:55:01 AM UTC, tetburr wrote:
>
> I have a Windows 7 machine running Jython 2.5.2 and Sphinx 1.2.1 (with 
> Numpydoc 0.4). I have created a very simple module with a very simple class 
> documented within it. Everything works fine (the html documentation is 
> produced as expected), except for the following warning and error:
>
> - WARNING: error while formatting [module name].Example: global name 
> '__builtins__' is not defined
> - ERROR: Unknown directive type "autosummary"
>
> My setup (all installed manually (extract then 'jython setup.py install') 
> because the Windows 7 machine is not connected to the internet):
> - Jython 2.5.2
> - Jinja2 2.6
> - docutils 0.11
> - Pygments 1.6
> - Sphinx 1.2.1
> - numpydoc 0.4
>
> The sphinx-* scripts have been renamed with the '.py' extension so that 
> Windows recognises them as Python scripts (Windows does not look for 
> shebangs, even for files without a file extension).
>
> The module:
>
> class Example(object):
>     """
>     An example class.
>
>     This class acts as a documentation example for testing auto-generation 
> of documentation.
>
>     Parameters
>     ----------
>     a : string
>         A parameter called `a`
>
>     b : integer
>         A parameter called `b`
>     """
>
>     def __init__(self, a, b):
>         pass
>
>     def example_method(self, a, b):
>         """
>         An example method.
>
>         This method acts as a documentation example as well.
>
>         Parameters
>         ----------
>         a : string
>             A parameter called `a`
>
>         b : integer
>             A parameter called `b`
>         """
>         pass
>
> The conf.py includes:
> sys.path.insert(1, r"absolute\path\to\module")
> extensions = [
>     'sphinx.ext.autodoc',
>     'sphinx.ext.viewcode',
>     'numpydoc',
> ]
>
> Why do I get this wanring and error, and/or how can I fix them?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to