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

Fix the resolve check in the presence of platform constraints. #877

Merged
merged 3 commits into from Feb 8, 2020

Conversation

benjyw
Copy link
Collaborator

@benjyw benjyw commented Feb 7, 2020

If a requirement is resolved vacuously due to a platform constraint
(e.g., 'pathlib2; python_version < "3"' when we're on Python 3) then
it is not an error to not have a resolved dist.

pex/resolver.py Outdated
@@ -601,7 +602,10 @@ def _check_resolve(self, resolved_distributions):
)
else:
resolved_dist = resolved_requirement_dist.distribution
if resolved_dist not in requirement:
# If a requirement is resolved vacuously due to a platform constraint (e.g., 'pathlib2; python_version < "3"'
# when we're on Python 3) then resolved_dist will be None, and this is not an error.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might have meant to use a comma:

Suggested change
# when we're on Python 3) then resolved_dist will be None, and this is not an error.
# when we're on Python 3, then resolved_dist will be None, and this is not an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this closes the paren opened before "e.g.,"

If a requirement is resolved vacuously due to a platform constraint
(e.g., 'pathlib2; python_version < "3"' when we're on Python 3) then
it is not an error to not have a resolved dist.
@benjyw benjyw merged commit 89f026c into pex-tool:master Feb 8, 2020
@benjyw benjyw deleted the fix_resolve_check branch February 8, 2020 06:49
benjyw added a commit to benjyw/pex that referenced this pull request Feb 9, 2020
benjyw added a commit that referenced this pull request Feb 9, 2020
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.

None yet

2 participants