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

Using --resolver-version=pip-2020-resolver yields poor dependency conflict information. #1159

Closed
jsirois opened this issue Jan 3, 2021 · 0 comments · Fixed by #1162
Closed

Comments

@jsirois
Copy link
Member

jsirois commented Jan 3, 2021

For example, using the legacy resolver, Pex does postprocessing of successful pip resolves to detect conflicts:

$ python3.6 -mpex --resolver-version=pip-legacy-resolver wheel==0.33.6 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

When using the pip-2020-resolver Pex doesn't need to post-process (in fact can't post-process!) since Pip fails fast. Unfortunately though, its equivalent conflict information is hidden in stdout, which we suppress to hide other noise:

$ python3.6 -mpex --resolver-version=pip-2020-resolver wheel==0.33.6 pantsbuild.pants==1.24.0.dev2
ERROR: Cannot install pantsbuild-pants==1.24.0.dev2 and wheel==0.33.6 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
pid 50027 -> /usr/bin/python3.6 /home/jsirois/.pex/pip.pex/38e9593b9e9184c3f2ffb67ab963128a7fe63808 --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /home/jsirois/.pex download --dest /tmp/tmpel5zlwiq/usr.bin.python3.6 wheel==0.33.6 pantsbuild.pants==1.24.0.dev2 --index-url https://pypi.org/simple --retries 5 --timeout 15 exited with 1 and STDERR:
None

For reference, that stdout info looks like:

The conflict is caused by:
    The user requested wheel==0.33.6
    pantsbuild-pants 1.24.0.dev2 depends on wheel==0.31.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

I've filed pypa/pip#9420 to surface that information to stderr, but in the meantime it seems we'll need to pluck this information from the suppressed stdout to surface it. It appears the global --log argument to pip does not have a noticeable negative performance implication; so using that and then postprocessing the log file to find the information and display it is the best we can do pending a fix for pypa/pip#9420.

@jsirois jsirois mentioned this issue Jan 3, 2021
11 tasks
@jsirois jsirois self-assigned this Jan 4, 2021
jsirois added a commit to jsirois/pex that referenced this issue Jan 5, 2021
Unfortunately, the useful information is sent to stdout which we suppress
since stdout is used to emit alot of other information that would be noise
for Pex users. Until pypa/pip#9420 is resolved
we work around this by plucking the information out of a --log file.

Fixes pex-tool#1159
jsirois added a commit that referenced this issue Jan 5, 2021
Unfortunately, the useful information is sent to stdout which we suppress
since stdout is used to emit alot of other information that would be noise
for Pex users. Until pypa/pip#9420 is resolved
we work around this by plucking the information out of a --log file.

Fixes #1159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant