简体   繁体   中英

Sphinx - ran`make html` and I am missing content for a few modules

Repo link: https://github.com/Eric-Cortez/aepsych-fork

Problem: I am running into an issue when generating sphinx documentation when I run make html most of the modules are generated except for 3 which are aepsych.database, aepsych.plotting, and aepsych.server.

file structure:

    (root)
    aepsych-fork/
   |__ aepsych/      <--- docs in this dir 
   |__ sphinx/
   |   |__ build/
   |   |__ Makefile
   |   |__ make.bat
   |   |__ source/
   |       |___conf.py
   |       |___index.rst
   | **other files**

conf.py [path]:

    import os
    import sys

    # from pkg_resources import get_distribution

    current_dir = os.path.dirname(__file__)
    target_dir = os.path.abspath(os.path.join(current_dir, 
    "../.."))
    sys.path.insert(0, target_dir)

What I tried:

I have been able to generate this documentation previously by running make html . example: https://aepsych.org/api/database.html But, I tried to rebuild the sphinx docs todays and ran into a an error

    WARNING: autodoc: failed to import module 'acquisition.bvn' 
    from module 'aepsych'; the following exception was raised:
    No module named 'gpytorch' 

gpytorch is a dependency that is being used within the the aepsych module, but I do not want to generate documentation for the gpytorch module. I did some research and added

    autodoc_mock_imports = ["botorch", 'gpytorch', "torch"]

to the aepsych-fork/sphinx/conf.py which resolved the missing module error and generated most of the docs accept for the three missing modules. I am having trouble finding the reason that the docs for those files are not being generated as when I run make html I don't get any errors in the console.

Below is the console output:

    Running Sphinx v5.0.2
    making output directory... done
    building [mo]: targets for 0 po files that are out of date
    building [html]: targets for 16 source files that are out of date
    updating environment: [new config] 16 added, 0 changed, 0 removed

I did notice the reading source does not reach 100%. I gets stuck at reading sources... [ 25%] benchmark

does anyone have any suggestion on how to resolve this issue?

I did notice that the __init__.py file is empty for the database/ module.

    import sys

    from ..config import Config
    from .db import Database


    __all__ = [
      "Database" 
    ]

    Config.register_module(sys.modules[__name__])

I added the code above to the databases/__init__.py but the docs still did not generate.

Does anyone have any suggestions on how to resolve this issue?

I recreated a conda environment with all of the dependencies and was still getting an error. WARNING: autodoc: failed to import module 'acquisition.bvn' from module 'aepsych'; the following exception was raised: No module named 'botorch.sampling.normal' So I added autodoc_mock_imports = ["botorch"] to sphinx/conf.py and that resolved the issue. I may have been missing some dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM