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

Difference between submodules and subpackages? #450

Closed
dstansby opened this issue May 28, 2024 · 3 comments
Closed

Difference between submodules and subpackages? #450

dstansby opened this issue May 28, 2024 · 3 comments

Comments

@dstansby
Copy link

I'm trying to use autoapi to document a package, and am getting the API docs grouped in both "submodules" and "subpackages":

Screenshot 2024-05-28 at 16 48 21

Does anyone know

  1. The difference between a submodule and a subpackage?
  2. How I can group these together (ie. merge the lists above) so that all the second level API docs are in a single list, instead of spread across submodules and subpackages
@AWhetter
Copy link
Collaborator

A package is a directory that contains an __init__.py and may have packages or modules under it. A module is a .py file. There's no difference in usage to a user however so it's maybe a bit pedantic to separate them. I think we'll change this to lump everything under "submodules".

@zbentley
Copy link

+1 to merging them; I think many packages like to move things between "submodule" and "subpackages" as an internal implementation detail (e.g. when a submodule.py grows so much support code for its public exports that it needs to be split into submodule/__init__.py for public stuff and submodule/_internal.py for the rest).

@zbentley
Copy link

Terrific, thanks so much @AWhetter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants