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

Top level package metadata #1

Open
flying-sheep opened this issue Sep 18, 2024 · 4 comments
Open

Top level package metadata #1

flying-sheep opened this issue Sep 18, 2024 · 4 comments

Comments

@flying-sheep
Copy link

flying-sheep commented Sep 18, 2024

top_level.txt should be standardized. importlib.metadata.packages_distributions() relies on it for a quicker lookup.

See also: https://discuss.python.org/t/record-the-top-level-names-of-a-wheel-in-metadata/29494


Sure, it’s possible to infer that from the manifest, but wouldn’t it be useful to have it in the metadata?

If this becomes part of the wheel-next standard, we can also circumvent the issue of “there is no difference between the metadata of a package that contains no top-level Python packages and a package that doesn’t declare them”: no metadata field means no top level packages, so don’t try to infer them.

@ethanhs-nv
Copy link
Contributor

Oh, sorry I missed this issue! I seem to have not been subscribed to new issues, but have now fixed that.

As for standardizing top_level.txt, I do think having some standard mechanism to declare what top level packages are provided by a wheel is reasonable. I will make sure to include some language about this in my Wheel 2 format specification.

@merwok
Copy link

merwok commented Oct 3, 2024

Could modules and scripts be included? If one of the goals is to discover file conflicts, then scripts are also a source of them.

@flying-sheep
Copy link
Author

Oh yeah terminology: Yes, I thought about both toplevel packages (…/site-packages/name/__init__.py) and toplevel import modules (…/site-packages/name.py).

Regarding scripts: They are already listed in the metadata as console_scripts entry points. If you mean something else, you need to specify what you mean.

@merwok
Copy link

merwok commented Oct 7, 2024

I mean scripts, plain scripts, what distutils has always called scripts.
Executable text files (python or other).

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

No branches or pull requests

3 participants