poetry: Unsolicited messages output to stdout, --quiet does not do anything
- Install Poetry 0.12.17
- poetry config settings.virtualenvs.create false
- Try to run something using
poetry run
. Observe that a message “Skipping virtualenv creation, as specified in config file.” is output to stdout. - Try
poetry -q run
,poetry run --quiet
and other variations thereof. Observe that nothing is run and an exception is raised.
There should be a way to suppress all output other than that of the command being run. Otherwise it’s impossible to run scripts reliably.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 22
- Comments: 21 (9 by maintainers)
I would be interested on an update on this. 😃
I’ve been struggling with a similar issue (with Poetry 1.1.4) and I believe I have found several inconsistencies:
poetry -q install
is quiet, but doesn’t do anything (seemingly)poetry install -q
works, but is as verbose aspoetry install
poetry -q update
doesn’t do anything (quietly)poetry update -q
works as expected, quietlypoetry --ansi <whatever>
gives an error message. Same with--no-ansi
or-v
.This is also inconsistent with the usage:
Ideally, it shouldn’t matter wether
-q
,-v
,--ansi
, etc. are before or after the command.+1 tools should write to stderr. I have a python script that outputs json that I want to send through jq and cannot because it is outputting
Skipping virtualenv creation, as specified in config file.
when I run it in CIseems like a good first step would be to make sure that everything that outputs as part of
poetry run
is stderrHello again,
I talked to @sdispater and this is something we definitely add to our agenda. But at the moments the priority are tasks that has to be done before launching poetry 1.0. So this issue will most likely not be handled before 1.1.
I hope you can have patience with us.
fin swimmer
Greetings, this is indeed very annoying. There should absolutely be a flag for quickly setting verbosity to warnings / errors only. These logs are useless, I don’t need to know that you’ve found the environment context file for the 100th time successfully. In general print statements should be avoided once functionality is stable, but otherwise at least give us the opportunity to shut them up.
Hello @rdaysky ,
I took a quick look at the code and it seems that those messages are all printed to stdout. A cleaner way would be, to print them to stderr, to not get in conflict with the programs output when redirecting to other programs.
Thanks for pointing to it!
fin swimmer
They should now be on stderr – if any were overlooked, please open a new issue with a reproduction/specifics.
You are complaining about the exact opposite of what this issue describes which is “–quiet does not do anything”.
(What were you expecting
--quiet
to do if not make the output quiet? No matter: thatpoetry export
uses a virtual environment is fixed in master and meanwhile you can use-o requirements.txt
instead of going via stdout)This issue should be closed.