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

Include all resolution conflict fix info in error messages or on stderr. #9420

Closed
jsirois opened this issue Jan 3, 2021 · 2 comments
Closed

Comments

@jsirois
Copy link
Contributor

jsirois commented Jan 3, 2021

What's the problem this feature will solve?
In non-interactive pip use, the failure message for resolve conflicts does not carry the actionable information.

Describe the solution you'd like
It would be great if the actionable information was moved from an info-level log to logging that went to stderr or else into the error message itself.

For example, the current error information is excellent in interactive use:

$ pip install --target=test wheel==0.33.6 pantsbuild.pants==1.24.0.dev2
Collecting pantsbuild.pants==1.24.0.dev2
  Using cached pantsbuild.pants-1.24.0.dev2-cp36-abi3-manylinux1_x86_64.whl (37.5 MB)
ERROR: Cannot install pantsbuild-pants==1.24.0.dev2 and wheel==0.33.6 because these package versions have conflicting dependencies.

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

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

However, when used non-interactively, the useful information is suppressed in common scenarios where stdout is hidden or quiet mode is used:

$ pip install --target=test --quiet 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

Alternative Solutions
For now, in my non-interactive use of pip I have resorted to capturing pip output using --log and then searching for ERROR: Cannot install ... because these package versions have conflicting dependencies. and grabbing all the lines between that and the following ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies.

@jsirois
Copy link
Contributor Author

jsirois commented Jan 3, 2021

More generally, it would be great as a non-interactive pip user to be able to rely on the general principle of all useful error information being sent to stderr. Without this principle, the only way to drill in to problems encountered in the wild is to provide full pip command lines in an error message an request a user re-run the command (or else do so automatically, but this time without stdout suppressed). This may already be a principle the Pip project agrees with and this info log case just slipped through the cracks.

jsirois added a commit to jsirois/pip that referenced this issue Jan 3, 2021
This allows resolution conflict errors to be triaged completely from
stderr which generally aids non-interactive use.

Closes pypa#9420
jsirois added a commit to jsirois/pip that referenced this issue Jan 3, 2021
This allows resolution conflict errors to be triaged completely from
stderr which generally aids non-interactive use.

Closes pypa#9420
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 to pex-tool/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 #1159
@jsirois
Copy link
Contributor Author

jsirois commented Jan 20, 2021

This proved infeasible as discussed thoroughly in #9421 so I'll close this issue.

@jsirois jsirois closed this as completed Jan 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant