Skip to content

Use metadata 2.2+ for sdist dependencies #13326

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

Open
1 task done
notatallshaw opened this issue Apr 8, 2025 · 2 comments
Open
1 task done

Use metadata 2.2+ for sdist dependencies #13326

notatallshaw opened this issue Apr 8, 2025 · 2 comments
Labels
PEP implementation Involves some PEP type: feature request Request for a new feature

Comments

@notatallshaw
Copy link
Member

notatallshaw commented Apr 8, 2025

What's the problem this feature will solve?

Currently pip uses the metadata file for wheels to get dependencies during resolution.

Separate metadata files aren't offered for sdists, but when metadata 2.2+ files are available and the requirements are non-dynamic there is no need to call the build backend.

Describe the solution you'd like

Extract static dependency data from sdists by downloading the sdist and checking if it has static dependency data, otherwise falling back to the build system.

Alternative Solutions

Rely on build system to extract dependencies.

Additional context

PyPI does not plan to publish .metadata files for sdists.

There are no known plans for PyPI to serve PEP 643 files (Metadata for Package Source Distributions) using PEP 658 (Serve Distribution Metadata in the Simple Repository API)

Code of Conduct

@notatallshaw notatallshaw added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Apr 8, 2025
@pfmoore
Copy link
Member

pfmoore commented Apr 8, 2025

PyPI does not plan to publish .metadata files for sdists.

That's a shame. Do you have a reference for this?

@notatallshaw
Copy link
Member Author

That's a shame. Do you have a reference for this?

After some searching I realize I misattributed and slightly misremembered this comment from you:

I guess it’s possible that PyPI will publish the metadata for sdists as separate files so that consumers can avoid downloading the full sdist, but I’m not sure how important that is (sdists are typically a lot smaller than wheels, aren’t they?)

So it's not that PyPI has stated they are not going to do it, but I'm not aware of them having plans, or anyone having asked them.

It's an interesting point though, for PEP 643 files, would it make sense to ask PyPI to serve them PEP 658 style? Or would it make sense to extract them from the sdist file?

I'm leaning towards the latter because other than PyPI no other index is known to serve PEP 658 metadata files, so the benefit would be wider to extract them from the sdist file.

@notatallshaw notatallshaw removed the S: needs triage Issues/PRs that need to be triaged label Apr 8, 2025
@ichard26 ichard26 added the PEP implementation Involves some PEP label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PEP implementation Involves some PEP type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants