Skip to content

Commit

Permalink
Fix sphinx-doc#9608: apidoc: module is not described if implicit name…
Browse files Browse the repository at this point in the history
…space package

To make implicit namespace packages referencable, this outputs empty
module definitions for them.
  • Loading branch information
tk0miya committed Sep 4, 2021
1 parent 6c38f68 commit f492719
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit f492719

Please sign in to comment.