sphinx.ext.apidoc to exclude documenting files in the *test* directories #13501
Replies: 2 comments
-
|
I am not sure if the reason I am not getting any responses is because I have not provided a reprex. My code base is pyaqsapi on github. When ever sphinx-apidoc is run apidoc generates documentation for files in the test directory, I would like for apidoc to not do that. |
Beta Was this translation helpful? Give feedback.
-
|
Did you enable the Sphinx extension? https://github.com/USEPA/pyaqsapi/blob/43a47b014f3fa417cb08261af4338e40446be15d/docs/conf.py#L53-L57 extensions = [
"sphinx.ext.autodoc",
# replaced sphinxcontrib.apidoc with sphinx.ext.apidoc
# "sphinxcontrib.apidoc",
# "sphinx.ext.apidoc",Are you using Sphinx 8.2.0 or later? The configuration for this extension was added in that version. Finally, switch from using the command line This bit me, too. I was mixing the command |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have tried multiple ways to get spinx.ext.apidoc to not document any pytest files under and directory named "tests*" or to exclude functions that start with the name "test". Nothing that I have tried so far seems to work., sphinx.ext.api doc keeps generating restructured text files for files under the test directory. I have tried adding ["/tests"] to the [EXCLUDE_PATTERN …] positional argument to sphinx-apidoc, I have tried setting ::exclude-members: in the package's top-level *. rst file. I have even set autodoc_default_options = {'exclude-members': 'tests'} and exclude_patterns = ["tests"] ,in the conf.py file. but no matter what I do sphinx.ext.apidoc keeps generating *.rst files for files in all test Can someone please tell me how to get sphinx.ext.apidoc to stop generating *.rst files for files that are in the pytest, unit testing folders?
Beta Was this translation helpful? Give feedback.
All reactions