File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Contributors
4545* Daniel Eades -- improved static typing
4646* Daniel Hahler -- testing and CI improvements
4747* Daniel Pizetta -- inheritance diagram improvements
48- * Dave Hoese -- ``sphinx.ext.viewcode `` bug fix
48+ * Dave Hoese -- ``sphinx.ext.viewcode `` and `` sphinx.ext.apidoc `` bug fixes
4949* Dave Kuhlman -- original LaTeX writer
5050* Dimitri Papadopoulos Orfanos -- linting and spelling
5151* Dmitry Shachnev -- modernisation and reproducibility
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Bugs fixed
1818
1919* #13392: Fix argument type for ``jieba.load_userdict() ``.
2020* #13402: Ensure inline ``<script> `` tags are written exactly once.
21+ * #13391: apidoc: Fix TOC file not having a title.
22+ Patch by Dave Hoese.
2123
2224Testing
2325-------
Original file line number Diff line number Diff line change @@ -217,7 +217,6 @@ def _parse_module_options(
217217 dest_dir = dest_path ,
218218 module_path = module_path ,
219219 exclude_pattern = exclude_patterns ,
220- automodule_options = automodule_options ,
221220 max_depth = max_depth ,
222221 quiet = True ,
223222 follow_links = bool_options ['follow_links' ],
@@ -226,6 +225,8 @@ def _parse_module_options(
226225 no_headings = bool_options ['no_headings' ],
227226 module_first = bool_options ['module_first' ],
228227 implicit_namespaces = bool_options ['implicit_namespaces' ],
228+ automodule_options = automodule_options ,
229+ header = module_path .name ,
229230 )
230231
231232
Original file line number Diff line number Diff line change @@ -782,13 +782,14 @@ def test_sphinx_extension(app: SphinxTestApp) -> None:
782782 app .build ()
783783 assert app .warning .getvalue () == ''
784784
785- assert set ((app .srcdir / 'generated' ).iterdir ()) == {
786- app .srcdir / 'generated' / 'modules.rst' ,
787- app .srcdir / 'generated' / 'my_package.rst' ,
788- }
789- assert 'show-inheritance' not in (
790- app .srcdir / 'generated' / 'my_package.rst'
791- ).read_text (encoding = 'utf8' )
785+ toc_file = app .srcdir / 'generated' / 'modules.rst'
786+ pkg_file = app .srcdir / 'generated' / 'my_package.rst'
787+ assert set ((app .srcdir / 'generated' ).iterdir ()) == {toc_file , pkg_file }
788+ modules_content = toc_file .read_text (encoding = 'utf8' )
789+ assert modules_content == (
790+ 'src\n ===\n \n .. toctree::\n :maxdepth: 3\n \n my_package\n '
791+ )
792+ assert 'show-inheritance' not in pkg_file .read_text (encoding = 'utf8' )
792793 assert (app .outdir / 'generated' / 'my_package.html' ).is_file ()
793794
794795 # test a re-build
You can’t perform that action at this time.
0 commit comments