Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9608: apidoc: module is not described if implicit namespace package #9609

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -25,6 +25,8 @@ Features added
Bugs fixed
----------

* #9608: apidoc: apidoc does not generate a module definition for implicit
namespace package
* #9487: autodoc: typehint for cached_property is not shown
* #9509: autodoc: AttributeError is raised on failed resolving typehints
* #9518: autodoc: autodoc_docstring_signature does not effect to ``__init__()``
Expand Down
4 changes: 4 additions & 0 deletions sphinx/templates/apidoc/package.rst_t
Expand Up @@ -19,6 +19,10 @@
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}

{%- if is_namespace %}
.. py:module:: {{ pkgname }}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions tests/test_ext_apidoc.py
Expand Up @@ -635,6 +635,8 @@ def test_namespace_package_file(tempdir):
assert content == ("testpkg namespace\n"
"=================\n"
"\n"
".. py:module:: testpkg\n"
"\n"
"Submodules\n"
"----------\n"
"\n"
Expand Down