Repository: numpy/numpydoc

Issue:
dependency on sphinx.ext.autosummary
It appears that numpydoc has a hard dependency on sphinx.ext.autosummary being active (it inserts some `.. autosummary::` directives).  This is fine, but perhaps `numpydoc.setup` should just call `sphinx.ext.autosummary.setup` in that case?  (in the sense that I don't see much of a point in erroring out instead, which is the current behavior if sphinx.ext.autosummary is not listed in conf.py)

Discussion:

Patch:
diff --git a/doc/install.rst b/doc/install.rst
index d408189..5658dbb 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -9,8 +9,8 @@ The extension is available from:
 * `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_
 
 'numpydoc' should be added to the ``extensions`` option in your Sphinx
-``conf.py``.
-
+``conf.py``. (Note that `sphinx.ext.autosummary` will automatically be loaded
+as well.)
 
 Sphinx config options
 =====================
diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py
index 640efa7..087ddaf 100644
--- a/numpydoc/docscrape_sphinx.py
+++ b/numpydoc/docscrape_sphinx.py
@@ -84,10 +84,11 @@ class SphinxDocString(NumpyDocString):
                                                           param_type)])
                 else:
                     out += self._str_indent([untyped_fmt % param.strip()])
-                if desc:
-                    if self.use_blockquotes:
-                        out += ['']
-                    out += self._str_indent(desc, 8)
+                if desc and self.use_blockquotes:
+                    out += ['']
+                elif not desc:
+                    desc = ['..']
+                out += self._str_indent(desc, 8)
                 out += ['']
         return out
 
diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py
index 26abd66..0a6cc79 100644
--- a/numpydoc/numpydoc.py
+++ b/numpydoc/numpydoc.py
@@ -151,6 +151,8 @@ def setup(app, get_doc_object_=get_doc_object):
     app.add_domain(NumpyPythonDomain)
     app.add_domain(NumpyCDomain)
 
+    app.setup_extension('sphinx.ext.autosummary')
+
     metadata = {'version': __version__,
                 'parallel_read_safe': True}
     return metadata


Test patch:
diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py
index fa3f700..21bbe28 100644
--- a/numpydoc/tests/test_docscrape.py
+++ b/numpydoc/tests/test_docscrape.py
@@ -64,6 +64,7 @@ doc_txt = '''\
   list of str
       This is not a real return value.  It exists to test
       anonymous return values.
+  no_description
 
   Other Parameters
   ----------------
@@ -184,7 +185,7 @@ def test_other_parameters():
 
 
 def test_returns():
-    assert_equal(len(doc['Returns']), 2)
+    assert_equal(len(doc['Returns']), 3)
     arg, arg_type, desc = doc['Returns'][0]
     assert_equal(arg, 'out')
     assert_equal(arg_type, 'ndarray')
@@ -197,6 +198,11 @@ def test_returns():
     assert desc[0].startswith('This is not a real')
     assert desc[-1].endswith('anonymous return values.')
 
+    arg, arg_type, desc = doc['Returns'][2]
+    assert_equal(arg, 'no_description')
+    assert_equal(arg_type, '')
+    assert not ''.join(desc).strip()
+
 
 def test_yields():
     section = doc_yields['Yields']
@@ -373,6 +379,7 @@ out : ndarray
 list of str
     This is not a real return value.  It exists to test
     anonymous return values.
+no_description
 
 Other Parameters
 ----------------
@@ -506,6 +513,9 @@ of the one-dimensional normal distribution to higher dimensions.
         This is not a real return value.  It exists to test
         anonymous return values.
 
+    no_description
+        ..
+
 :Other Parameters:
 
     spam : parrot