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 pex resolution to respect --ignore-errors. #828

Merged
merged 2 commits into from
Dec 14, 2019

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Dec 12, 2019

Previously, pip might warn in red that versions were mismatched but
we would get no failure until pex runtime resolution. Improve pex
runtime resolution error messages and implement pex buildtime
resolution sanity checks when --no-ignore-errors.

At buildtime we now get:

$ python -mpex wheel pantsbuild.pants==1.24.0.dev2
Failed to resolve compatible distributions:
1: pantsbuild.pants==1.24.0.dev2 requires wheel==0.31.1 but wheel==0.33.6 was resolved

And the corresponding runtime error is now:

$ PEX_IGNORE_ERRORS=false python -mpex wheel pantsbuild.pants==1.24.0.dev2 --ignore-errors
Failed to execute PEX file. Needed linux_x86_64-cp-38-cp38 compatible dependencies for:
 1: wheel==0.31.1
    Required by:
      pantsbuild.pants==1.24.0.dev2
    But this pex only contains:
      wheel-0.33.6-py2.py3-none-any.whl

Previously, pip might warn in red that versions were mismatched but
we would get no failure until pex runtime resolution. Improve pex
runtime resolution error messages and implement pex buildtime
resolution sanity checks when --no-ignore-errors.
pex/package.py Outdated
return False
# This supports resolving pex's own vendored distributions which are vendored in directory
# directory with the project name (`pip/` for pip) and not the corresponding wheel name
# (`pip-19.3.1-py2.py3-none-any.whl/` for pip). Pes only vendors universal wheels for all
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Pes/Pex

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@jsirois jsirois merged commit 31af708 into pex-tool:master Dec 14, 2019
@jsirois jsirois deleted the ignore_errors/support_for_resolve branch December 14, 2019 04:51
@jsirois jsirois mentioned this pull request Dec 28, 2019
11 tasks
benjyw added a commit to benjyw/pex that referenced this pull request Apr 15, 2020
PR pex-tool#828 introduced a bug in the code that gathers the
requirers of requirements that failed to be resolved
(so that we can display those requirers in an error message.)

Specifically, reqs_by_key's values are lists of requirements,
so we need to call update() on each such value separately.
benjyw added a commit that referenced this pull request Apr 16, 2020
PR #828 introduced a bug in the code that gathers the
requirers of requirements that failed to be resolved
(so that we can display those requirers in an error message.)

Specifically, reqs_by_key's values are lists of requirements,
so we need to call update() on each such value separately.
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