Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx-apidoc on namespaces with only subpackages/namespaces #8727

Closed
l-spiecker opened this issue Jan 22, 2021 · 0 comments
Closed

sphinx-apidoc on namespaces with only subpackages/namespaces #8727

l-spiecker opened this issue Jan 22, 2021 · 0 comments

Comments

@l-spiecker
Copy link

Describe the bug
--implicit-namespaces allows us to use namespaces in our project tree. At the current deployed implementation (3.4.3) it makes a difference if i have a submodule in my module_path (root python namespace) or only subpackages/namespaces.

Running sphinx-apidoc --implicit-namespaces module_path with a submodule (some python file) it will choose the module_path as the one and only module otherwise, without a submodule, it will use the subpackages/namespaces as individual python modules.

The difference in the output is, that the module.rst of the module_path is not created and modules.rst does contain all subpackages/namespaces as submodules and not only the root module.

I would recommend to introduce an option to not search recursively for modules, or disable the recursive search if implicit-namespaces are activated.

To Reproduce
Steps to reproduce the behavior:

Create a directory with name 'module' with subdirectories, add python files to the subdirectories.
Run: sphinx-apidoc --implicit-namespaces -o apidoc_out1 ./module
Now add a python file into 'module'.
Run: sphinx-apidoc --implicit-namespaces -o apidoc_out2 ./module
Compare the results.

Expected behavior
Expecting same result in apidoc_out2, with only one added module inside module.rst. Instead module.rst is missing and modules.rst is different.

Your project
sphinx-apidoc-bug.zip

Environment info

  • OS: Win
  • Python version: 3.8.0
  • Sphinx version: 3.4.3
@tk0miya tk0miya added this to the 3.5.0 milestone Jan 22, 2021
tk0miya added a commit that referenced this issue Jan 24, 2021
Fix #8727: apidoc: namespace module file is not generated if no submodules
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants