The documentation generated using Sphinx does not contain the signature and the docstrings of the functions add and subtract defined in the extension module code in src/main.cpp.
Steps to reproduce the issue:
Clone this repository
cd scikit_build_example/
Install the package: pip install .
cd docs/
make html
html files generated in docs/_build/ does not contain function signatures and docstrings. See screenshot below
The target module from which docstrings and function signature are to be extracted as documentation is incorrectly referenced in docs/python_example.rst as highlighted in the make html outout below.
$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v7.3.6
WARNING: Failed to import python_example.
Possible hints:
* ModuleNotFoundError: No module named 'python_example'
* KeyError: 'python_example'
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [100%] python_example
WARNING: autodoc: failed to import module 'python_example'; the following exception was raised:
No module named 'python_example'
writing output... [100%] python_example
/~/scikit_build_example/docs/index.rst:6: WARNING: toctree contains reference to document 'python_example' that doesn't have a title: no link will be generated
/~/scikit_build_example/docs/index.rst:6: WARNING: toctree contains reference to document 'python_example' that doesn't have a title: no link will be generated
/~/scikit_build_example/docs/index.rst:6: WARNING: toctree contains reference to document 'python_example' that doesn't have a title: no link will be generated
generating indices... genindex /~/scikit_build_example/docs/index.rst:6: WARNING: toctree contains reference to document 'python_example' that doesn't have a title: no link will be generated
done
writing additional pages... search /~/scikit_build_example/docs/index.rst:6: WARNING: toctree contains reference to document 'python_example' that doesn't have a title: no link will be generated
done
dumping search index in English (code: en)... done
dumping object inventory... done
Fix
scikit_build_example is the correct target module to mention in docs/python_example.rst from which the function signatures and docstrings are to be extracted.
The documentation generated using Sphinx does not contain the signature and the docstrings of the functions add and subtract defined in the extension module code in src/main.cpp.
Steps to reproduce the issue:
scikit_build_example/
pip install .
cd docs/
make html
The target module from which docstrings and function signature are to be extracted as documentation is incorrectly referenced in
docs/python_example.rst
as highlighted in themake html
outout below.Fix
scikit_build_example
is the correct target module to mention indocs/python_example.rst
from which the function signatures and docstrings are to be extracted.