Questions tagged [autodoc]

Extension for the Sphinx documentation generator that imports Python modules in order to extract docstrings in a semi-automatic way.

Python Sphinx extension that can import the modules being documented, and pull in documentation from docstrings in a semi-automatic way.

The sphix.ext.autodoc extension can be used in conjunction with the sphinx.ext.napoleon extension. This allows use of NumPy and Google style docstrings. The Napoleon prepocessor will initially convert your docstrings to ReStructured text, that afterwards is processed by autodoc.

Several commonly used directives are provided by autodoc, namely ..automodule:: and ..autoclass: For examples of use see the sphinx.ext.autodoc documentation.

See also:

456 questions
0
votes
1 answer

Sphinx autodoc works locally but not on Read The Docs

I have a GitHub repo (here) which is extremely basic and only meant to reproduce a problem I had with another repo (CPU Health Checks also in my public repos) It consists on a package called rtdtest which locally is a rtdtest/ folder with an empty…
0
votes
0 answers

Is there a way to group parameters together in Sphinx without there being a class above?

I'm trying to document a list of common parameters that exist in a few classes. However, I would prefer not to repeat the documentation and instead have the list of common parameters show up in only one place. Usually, in Sphinx, you can do…
sxh
  • 13
  • 3
0
votes
1 answer

Sphinx can not run my module on RTD but it works locally

I have made a python package which uses CUDA code. Using autodoc_mock_imports I managed a CUDA dependency error due to the import of PyCuda. The issue I have right now is directly inside my package: at a point I try to write a Cubin PyCuda (mocked)…
Maxime D.
  • 306
  • 5
  • 17
0
votes
2 answers

Using Python Sphinx getting WARNING: duplicate object description of myproject / use :noindex: for one of them

I'm using Sphinx to create HTML documentation for a Python project. TL;DR I cannot get rid of this warning message. WARNING: duplicate object description of myproject, other instance in class-stubs/Bar, use :noindex: for one of them I want the…
David I
  • 881
  • 6
  • 10
0
votes
0 answers

Sphinx not importing all files in directory

I want to create a Sphinx documentation for my Code but it won't import all files properly The Structure looks like this: ├───config ├───docs │ ├───build │ └───source │ └───conf.py └───src ├───stages │ ├───stage1 │ │ …
LeM4
  • 31
  • 1
  • 5
0
votes
0 answers

How to get correct path for Sphinx autodoc with os.path

I just built Sphinx for the first time and generated all of the skeleton files. Next I want to add another path with Python files for autodoc to analyze. sphinx.ext.autodoc is in conf.py as an extension. My Sphinx install is in:…
RTC222
  • 2,025
  • 1
  • 20
  • 53
0
votes
0 answers

WARNING: autodoc: failed to import module when trying to generate python documentation with sphinx

I have reviewed the sphinx documentation to generate the python documentation. When I generate the documentation in html format using the .rst files that do not reference any python source code, the documentation is generated correctly. In my…
Ramiro
  • 369
  • 3
  • 14
0
votes
1 answer

exclude class names from breadcrumbs and leave only package names

I am trying to imitate the behaviour that is shown in this documentation https://faker.readthedocs.io/en/master/providers/baseprovider.html I have installed ReadTheDocs theme for Sphinx and also use autodoc extension. My index.rts looks like this …
lapots
  • 12,553
  • 32
  • 121
  • 242
0
votes
1 answer

How to tell sphinx-apidoc to override options for a specific Python class?

I am running into the issue described in https://github.com/sphinx-doc/sphinx/issues/8664, in which I have a class with type-annotated members as well as Google-style Attributes: pydocs, e.g.: class Foo(Bar): """Something something. …
J. Lerman
  • 83
  • 7
0
votes
0 answers

Some links between markdown pages are broken

I am using MKdocs to generate HTML from markdown files. I'm trying to generate documentation for a Python API from its docstrings. I'm using sphinx, autodoc, autoapi and sphinx-markdown-builder to generate the markdown files. I then copy the…
saqx1
  • 13
  • 2
0
votes
1 answer

Prevent sphinx autodoc to add classes and methods in table of content

I am generating the documentation of a python project using Sphinx / sphinx-autodoc / sphinx_rtd_theme. Recently, I added type hints to my project which forced me to update Sphinx to the latest version (6.1) to handle these correctly. Since I…
0
votes
0 answers

Problem with Semantic versioning in Sphinx

I'm trying to write my documentation for Greengrass V2 software using Sphinx. The problem is related to the use of semantic version specification for the modules of Greengrass and the build module of Sphinx (sphinx-build), which doesn't recognize…
0
votes
0 answers

Keep only description in documentation with sphinx

I have generated a index.rst file with sphinx: Welcome to my_project's documentation! ================================================= .. toctree:: :maxdepth: 2 modules In modules.rst, I have: Feature Engineering ===================== ..…
user13147194
0
votes
1 answer

Embedded external URL breaks Sphinx?

I am trying to document some Python code with Sphinx, and I've added the following doc comment to a constant. #: `RFC 8415 §7.6 `_ _SOL_TIMEOUT = 1 This appears to break Sphinx; it considers…
Ian Pilcher
  • 1,539
  • 1
  • 9
  • 3
0
votes
1 answer

Python Sphinx Module Not Found

I have a subproject that I would like to document with python sphinx. It is structured this way: The documentation from the extraction_model went without any problems. But now, if I try to document the ocr part, I always get the warning: WARNING:…
user3793935
  • 411
  • 5
  • 22