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

Add a requires_dists function. #1122

Merged
merged 2 commits into from
Dec 5, 2020

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Dec 4, 2020

This is needed to support #1020 and #1108.

@jsirois jsirois requested a review from stuhood December 4, 2020 22:52
Comment on lines +69 to +71
pkg_info = _parse_pkg_info(dist)
if pkg_info is None:
return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure of the error handling strategy in here, but is a dist not having PKG-INFO something that should be silently ignored like this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes. If the distribution has no metadata, that means it expresses no opinon on a Python interpreter requirement, which is all we care about (it can have metadata and not an express an opinion on this field as tests exercise). It is true that distributions should always have metadata and that if they do not, a minimal file should be produced by Pip when it installs the distribution, but there is a range of interesting non-compliant package material out on PyPI and banking on Pip to fill in minimal metadata for those seems like a bet we don't need to make.

pex/dist_metadata.py Outdated Show resolved Hide resolved
@jsirois jsirois merged commit c7c74cc into pex-tool:master Dec 5, 2020
@jsirois jsirois deleted the metadata/requires_dists branch December 5, 2020 00:30
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

Successfully merging this pull request may close these issues.

2 participants