summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-03-30 11:44:43 +0100
committerGeorg Brandl <georg@python.org>2013-03-30 11:44:43 +0100
commitd01ce4177242f0891474a0e834b2bd66c4a5b496 (patch)
tree6a67b72fccaf3e455116e54c5074e2631c787764
parent57f7cee92a14c54a0319637418ca8bbb5fd26199 (diff)
downloadsphinx-d01ce4177242f0891474a0e834b2bd66c4a5b496.tar.gz
Closes #1117: Handle .pyx files in sphinx-apidoc.
-rw-r--r--CHANGES1
-rw-r--r--sphinx/apidoc.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index bd585da7..2e017343 100644
--- a/CHANGES
+++ b/CHANGES
@@ -158,6 +158,7 @@ Bugs fixed
* Fix text writer not handling visit_legend for figure directive contents.
* Fix text builder not respecting wide/fullwidth characters: title underline
width, table layout width and text wrap width.
+* #1117: Handle .pyx files in sphinx-apidoc.
* #1111: Fix failure to find uppercase words in search when
:confval:`html_search_language` is 'ja'. Thanks to Tomo Saito.
* #1108: The text writer now correctly numbers enumerated lists with
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py
index 15160828..500332c3 100644
--- a/sphinx/apidoc.py
+++ b/sphinx/apidoc.py
@@ -31,6 +31,7 @@ else:
]
INITPY = '__init__.py'
+PY_SUFFIXES = set(['.py', '.pyx'])
def makename(package, module):
@@ -163,7 +164,8 @@ def recurse_tree(rootpath, excludes, opts):
del subs[:]
continue
# document only Python module files
- py_files = sorted([f for f in files if path.splitext(f)[1] == '.py'])
+ py_files = sorted(f for f in files
+ if path.splitext(f)[1] in PY_SUFFIXES)
is_pkg = INITPY in py_files
if is_pkg:
py_files.remove(INITPY)