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

Refactor BaseDistribution.metadata property to make sure it has Requires-Dist and Provides-Extra #11163

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Jun 4, 2022

egg-info distribution may not have the Requires-Dist and Provides-Extra fields in their metadata. For consistency, and to provide an unsurprising BaseDistribution.metadata property, we emulate it by reading requires.txt.

The logic was already present in the importlib.metadata.Distribution adapter, so we reuse it by moving the corresponding methods up to BaseDistribution.

I noticed this while working on #10771 where the installation report was missing requires_dist for older setup.py projects.

@sbidoul sbidoul added the skip news Does not need a NEWS file entry (eg: trivial changes) label Jun 4, 2022
@sbidoul sbidoul requested a review from uranusjr June 4, 2022 09:33
@sbidoul sbidoul force-pushed the ref-metadata-sbi branch 5 times, most recently from 32311d2 to 9c119bc Compare June 6, 2022 13:42
@sbidoul sbidoul changed the title Make sure metadata property has Requires-Dist and Provides-Extra Refactor BaseDistribution.metadata property to make sure it has Requires-Dist and Provides-Extra Jun 6, 2022
@sbidoul sbidoul requested a review from uranusjr June 6, 2022 13:52
egg-info distributions may not have the Requires-Dist and Provides-Extra
fields in their metadata. For consistency and to provide an
unsurprising metadata property, we emulate it by reading requires.txt.
@sbidoul sbidoul merged commit 4227198 into pypa:main Jun 23, 2022
@sbidoul sbidoul deleted the ref-metadata-sbi branch June 23, 2022 17:31
@sbidoul
Copy link
Member Author

sbidoul commented Jun 23, 2022

Thanks for the review!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants