Skip to content

[Docs] Clarification on Package Discovery wording "exactly to the directory structure" #4109

Open
@kennethjmyers

Description

@kennethjmyers

Summary

In the Packaged Discovery page (docs link, github link), the very first example on the use of packages in the [options] could benefit from a project directory example(s) like almost every other example on that page. The part that I'm looking for clarification on is this part (emphasis mine):

If your packages are not in the root of the repository or do not correspond exactly to the directory structure, you also need to configure package_dir:

What is meant by "exactly to the directory structure"? Does this mean you can specify the package is the root level name and if so then I think it should just say that rather than calling it the "directory structure"? Furthermore what happens if there is a folder in the root level that is the same name as the root level and that name is used such as in the following example:

mypkg
├── pyproject.toml  # AND/OR setup.cfg, setup.py
├── ...
└── mypkg/
    └── __init__.py

setup.cfg:

[options]
#...
packages =
    mypkg

OS / Environment

N/A

Additional Information

The wording on this has just been confusing to me and I feel it could confuse others. I have an internal company package where the creator is no longer here (and unfortunately I can't share) that used this method of package discovery to seemingly define the root level as the package and I did not understand how they did that or why that worked based on the documentation text.

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions