I am trying to generate docs but am running into a warning in the command line. I've been searching the site and can't find a working solution for me. I narrowed the cause down to the import in ClassB.
My folder structure is:
The __init__.py
files have no content.
classA.rst:
classA
======
.. automodule:: app.ClassA
:members:
classB.rst:
classB
======
.. automodule:: app.ClassB
:members:
index.rst (toctree only):
.. toctree::
:maxdepth: 2
:caption: Contents:
classA
classB
conf.py (path only):
sys.path.insert(0, os.path.abspath('../src'))
ClassA.py:
class A:
def sayNo(self):
print('NO!')
ClassB.py:
from ClassA import A
class B:
def sayNoB(self):
no = A()
no.sayNo()
The warning from the command line:
WARNING: autodoc: failed to import module 'ClassB' from module 'app'; the following exception was raised:
No module named 'ClassA'