Skip to content

Messages about ignoring packages due to environment markers should not be on stderr #4876

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

Closed
edmorley opened this issue Nov 20, 2017 · 2 comments · Fixed by #4877
Closed
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality

Comments

@edmorley
Copy link
Contributor

edmorley commented Nov 20, 2017

  • Pip version: 9.0.1
  • Python version: 2.7.14
  • Operating system: Ubuntu 16.04

Description:

In one or our projects, we've added environment marker specifiers to our requirements file, such that the same file can be used with both Python 2 and 3 (as part of our gradual transition to Python 3).

Unfortunately the log output about skipping this package is output to stderr rather than stdout, which causes tools like Vagrant to output it red text compared to the green text of stdout. This confuses contributors to our project, since they think the provision didn't complete successfully, when in fact these messages are entirely expected and not an error.

IMO this output should be on stdout instead, by using logger.info() not logger.warning(), here:

logger.warning("Ignoring %s: markers '%s' don't match your "

What I've run:

  1. Create a requirements file containing:
requests==2.18.4
aiohttp==2.3.2; python_version >= '3'
  1. Using Python 2, run pip install on that requirements file

Expected:

There is nothing output on stderr, and stdout includes:
Ignoring aiohttp: markers 'python_version >= "3"' don't match your environment

Actual:

stderr includes:
Ignoring aiohttp: markers 'python_version >= "3"' don't match your environment

Example of the end result when being run via tooling that colours console output:

pip-marker-stderr

@edmorley
Copy link
Contributor Author

This would also avoid issues like #4826.

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants