Skip to content

Commit

Permalink
Added test case for importing a class from a private submodule into a…
Browse files Browse the repository at this point in the history
… public one
  • Loading branch information
astrofrog committed Sep 11, 2024
1 parent 7e5e6fa commit e689b14
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sphinx_automodapi/tests/cases/public_from_private/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Importing a class from a private submodule to a public submodule
at the same level of hierarchy in the module.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. automodapi:: sphinx_automodapi.tests.example_module.public
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Camelot
=======

.. currentmodule:: sphinx_automodapi.tests.example_module.public

.. autoclass:: Camelot
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

sphinx_automodapi.tests.example_module.public Module
----------------------------------------------------

.. automodule:: sphinx_automodapi.tests.example_module.public

Classes
^^^^^^^

.. automodsumm:: sphinx_automodapi.tests.example_module.public
:classes-only:
:toctree: api

Class Inheritance Diagram
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automod-diagram:: sphinx_automodapi.tests.example_module.public
:private-bases:
:parts: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: sphinx_automodapi.tests.example_module.public

.. autosummary::
:toctree: api

Camelot

4 changes: 4 additions & 0 deletions sphinx_automodapi/tests/example_module/_private.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Camelot:
"""
It's a silly place anyway
"""
1 change: 1 addition & 0 deletions sphinx_automodapi/tests/example_module/public.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ._private import Camelot

0 comments on commit e689b14

Please sign in to comment.