pip: Provide a way to supress progressbar, but display exceptions
I we provide the --quiet
option, pip does not display exceptions like this:
install_requires=get_install_requires(),
File "/tmp/pip-build-QuFDf8/selectable-tbz/setup.py", line 7, in get_install_requires
return [str(entry.req) for entry in requirements if not entry.editable]
File "/home/modwork_vums_di995/lib/python2.7/site-packages/pip/req/req_file.py", line 31, in parse_requirements
"parse_requirements() missing 1 required keyword argument: "
TypeError: parse_requirements() missing 1 required keyword argument: 'session'
Please give us an option to supress the progressbar, but display exceptions.
Thank you.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 6
- Comments: 29 (11 by maintainers)
A little more forcefully this time since it clearly got lost in the mess above (two years ago, sigh):
Regardless of whether pip9 allows turning the progress bar off or not, the fact that
--quiet
suppresses FATAL ERRORS AND STACK TRACES cannot reasonably be described as anything other than a bug.The linked message from the distutils-sig mailing list suggests that the full release of pip 10 is “one or two months away” in…October of 2017 (nearly five months ago). And even once 10 comes out of beta, it can be safely assumed that given the API differences that many shops will continue using pip9 for months or years to come as they prioritize their conversions.
@AvnerCohen if I managed to put together a PR for pip9 that fixed only this misbehavior, is there any chance at all that it would be accepted and released?
+1 on this. Hilariously, I ran into this issue in the exact same context: installation of cffi failed in a jenkins build that didn’t have libffi.so available, and
--quiet
suppressed the error completely.Adding an option to disable only the progress bar would be nice, but having
--quiet
suppress stack traces / fatal error output from inside pip seems like an outright bug. If I wanted to suppress all output including fatal errors, I already know how to use2>&1 >/dev/null
😃i can confirm that
-q
hides errors. this is trying to installcffi
withoutlibffi-dev
present:this is somewhat annoying, because without
-q
it is impossible to see why it failed, as the build logs in/tmp
are also removed. but without-q
the progress bar is always there creating a huge amount of noise in tools like jenkins and vagrant. these tools always emulate a full tty, so relying onstdout
being a non-tty does not cut it anymore, making the reasoning in #2369 moot.@piotr-dobrogost Didn’t know that, thank you! But I think that stacking more and more workarounds will add unnecessary noise to CI scripts. Personally I’d prefer
pip install --no-progress package
overpip install package | cat && exit ${PIPESTATUS[0]}
.@bialix FWIW the workaround I discovered for scenarios like fabric and jenkins execution of pip is to connect stdout to a pipe – even if that pipe just in turn connects to its own stdout, it’s enough to suppress the progress meters:
Dumb, but it works. See also
pty=False
when using Fabric.@edmorley is the environ
PIP_DISABLE_PROGRESS_BAR
still available?Because I am trying to write a script like
Then pip says
no such option: --progress-bar
because of old version 9I think using a envion switch is better for compatibility
I think this is part of the current main dev version, 10.0.0 (https://github.com/pypa/pip/tree/release/10.0.0), 9.0.x is at maintenance mode with no new features.
https://mail.python.org/pipermail/distutils-sig/2017-October/031642.html
It would still useful to be able to disable the progress bar without having to resort to
--quiet
- for example on Travis where the output is streamed (so appears to pip as a TTY), it currently results in logs that are filled with progress bar cruft (eg https://s3.amazonaws.com/archive.travis-ci.org/jobs/130634491/log.txt - and see also travis-ci/travis-ci#1337).I’m happy to open a PR for this – I was thinking there could be both a command line switch and also an equivalent environment variable (that people like Travis CI could set by default).
Any preference as to naming? eg:
--disable-progress
--no-progress
And for the environment variable:
PIP_DISABLE_PROGRESS
PIP_DISABLE_PROGRESS_BAR
Thanks! 😃