Skip to content

Commit 7b17004

Browse files
committed
Merge pull request #37 from pv/fix-fmterror
BUG: fix spacing in sphinx class doc attribute listing
2 parents 16ef04c + 0cd550d commit 7b17004

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# After changing this file, check it on:
22
# http://lint.travis-ci.org/
33
language: python
4+
sudo: false
45
python:
56
- 3.3
67
- 2.7
8+
cache:
9+
directories:
10+
- $HOME/.cache/pip
711
before_install:
812
- pip install --upgrade pip setuptools # Upgrade pip and setuptools to get ones with `wheel` support
9-
- pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel --use-mirrors nose numpy matplotlib Sphinx
13+
- pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --trusted-host wheels.astropy.org --trusted-host wheels2.astropy.org --use-wheel nose numpy matplotlib Sphinx
1014
script:
1115
- python setup.py test

numpydoc/docscrape_sphinx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _str_member_list(self, name):
135135
maxlen_0 = max(3, max([len(x[0]) for x in others]))
136136
hdr = sixu("=")*maxlen_0 + sixu(" ") + sixu("=")*10
137137
fmt = sixu('%%%ds %%s ') % (maxlen_0,)
138-
out += ['', hdr]
138+
out += ['', '', hdr]
139139
for param, param_type, desc in others:
140140
desc = sixu(" ").join(x.strip() for x in desc).strip()
141141
if param_type:

numpydoc/tests/test_docscrape.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ def test_duplicate_signature():
802802
Current time.
803803
y : ndarray
804804
Current variable values.
805+
x : float
806+
Some parameter
805807
806808
Methods
807809
-------
@@ -837,6 +839,8 @@ def test_class_members_doc():
837839
Current time.
838840
y : ndarray
839841
Current variable values.
842+
x : float
843+
Some parameter
840844
841845
Methods
842846
-------
@@ -851,7 +855,13 @@ def test_class_members_doc():
851855
""")
852856

853857
def test_class_members_doc_sphinx():
854-
doc = SphinxClassDoc(None, class_doc_txt)
858+
class Foo:
859+
@property
860+
def x(self):
861+
"""Test attribute"""
862+
return None
863+
864+
doc = SphinxClassDoc(Foo, class_doc_txt)
855865
non_blank_line_by_line_compare(str(doc),
856866
"""
857867
Foo
@@ -872,6 +882,11 @@ def test_class_members_doc_sphinx():
872882
873883
.. rubric:: Attributes
874884
885+
.. autosummary::
886+
:toctree:
887+
888+
x
889+
875890
=== ==========
876891
t (float) Current time.
877892
y (ndarray) Current variable values.

0 commit comments

Comments
 (0)