[NumPy-Tickets] [NumPy] #1489: numpydoc (sphinxext) broken by latest sphinx source.

NumPy Trac numpy-tickets@scipy....
Tue Jun 15 16:15:14 CDT 2010


#1489: numpydoc (sphinxext) broken by latest sphinx source.
-----------------------------------------------+----------------------------
 Reporter:  mforbes                            |       Owner:  pv   
     Type:  defect                             |      Status:  new  
 Priority:  normal                             |   Milestone:  2.0.0
Component:  Documentation                      |     Version:       
 Keywords:  numpydoc sphinxext sphinx domains  |  
-----------------------------------------------+----------------------------

Comment(by matthew.brett):

 This is beyond my sphinx skills.

 get_directive() from numpydoc does this:


 {{{
 def get_directive(name):
     from docutils.parsers.rst import directives
     try:
         return directives.directive(name, None, None)[0]
     except AttributeError:
         pass
     try:
         # docutils 0.4
         return directives._directives[name]
     except (AttributeError, KeyError):
         raise RuntimeError("No directive named '%s' found" % name)
 }}}

 The '''directives.directive(name, None, None)''' call does not look as if
 it could have worked with docutils 0.3 or later, maybe earlier, so in
 practice the code is always falling back to the '''return
 directives._directives[name]''' line.  The function directive that we are
 looking for is always put into the '''_directives''' cache by
 sphinx.directives.desc:

 {{{
 directives.register_directive('function', directive_dwim(ModulelevelDesc))
 }}}

 through sphinx 0.6.7 and up until the 1.0 beta, at which point, sphinx
 switches to the domains idea pointed to above, the 'function' directive is
 no longer in the docutils '''_directives''' cache, and the numpydoc
 extension therefore fails.

 The 'function' directive appears to be defined in sphinx.domains.python,
 but not registered with the '''register_directive''' call.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1489#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list