0

As a result of make html command, Sphinx generates documentation only for some modules. Other modules remain undocumented.

Project structure:

|- my-project
|--| my_project
|--| docs
|----| _build
|------| ...
|----| _static
|------| ...
|----| _templates
|------| ...
|---- conf.py
|---- index.rst
|---- Makefile
|---- source
|-----| modules.rst
|-----| ...

conf.py:

import os
import sys
sys.path.insert(0, os.path.abspath('../'))
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.viewcode',
    'sphinx.ext.napoleon',
]
autosummary_generate=True
source_suffix = '.rst'

index.rst:

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   ./source/modules


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

source/modules.rst:

my_project
==========

.. toctree::
   :maxdepth: 4

   my_project

Please consider to look at the sources at github: https://github.com/mxmaslin/Test-tasks/tree/removeme/tests_python/my-project

barryhunter
  • 20,886
  • 3
  • 30
  • 43
mr_bulrathi
  • 514
  • 7
  • 23
  • How do you install your project? There's no setup.py or pip requirements file. If your project is not installed, I think that's why you get all the import errors. – Steve Piercy Jun 11 '18 at 04:58
  • 1
    In `prediction/models/__init__.py`, one of the import statements is `from baseline.median import MedianForecaster`. Shouldn't that be `from my_project.prediction.models.baseline.median import MedianForecaster`?. Or perhaps simply `from .baseline.median import MedianForecaster` (dot added for relative import)? – mzjn Jun 11 '18 at 07:53
  • I’ve put setup.py to repo. Please consider to look – mr_bulrathi Jun 11 '18 at 07:54
  • Would it be possible for you to create a MINIMAL test case ([mcve])? The GitHub project is quite large and confusing (to me at least...). – mzjn Jun 11 '18 at 08:27
  • Thanks, @mzjn! Your comment regarding imports solved my issue! You are great! – mr_bulrathi Jun 11 '18 at 10:09

1 Answers1

0

The issue was in incorrect imports. Thanks to @mzjn for pointing this

mr_bulrathi
  • 514
  • 7
  • 23