Poetry: Unsolicited messages output to stdout, --quiet does not do anything

Created on 20 Nov 2019  ·  8Comments  ·  Source: python-poetry/poetry

  1. Install Poetry 0.12.17
  2. poetry config settings.virtualenvs.create false
  3. Try to run something using poetry run. Observe that a message “Skipping virtualenv creation, as specified in config file.” is output to stdout.
  4. 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.

CLI

Most helpful comment

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.

All 8 comments

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

That would be an improvement for sure, but still the right thing to do is either to make -q actually work, suppressing all output, or, even better, not to output any such messages unless -v is present.

Hello @rdaysky ,

I see. Could you please try the latest preview version? For me run e.g. poetry -q run pip list suppresses all kind of output.

I will have a look on how/if it is possible to suppress all info/debugging/... messages but still print the output of the running program.

fin swimmer

Hello 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.

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 as poetry install
  • poetry -q update doesn't do anything (quietly)
  • poetry update -q works as expected, quietly
  • poetry --ansi <whatever> gives an error message. Same with --no-ansi or -v.

This is also inconsistent with the usage:

  poetry [-h] [-q] [-v [<...>]] [-V] [--ansi] [--no-ansi] [-n] <command> [<arg1>] ... [<argN>]

Ideally, it shouldn't matter wether -q, -v, --ansi, etc. are before or after the command.

I guess the worst offender is:

poetry -q install no output, doesn't do anything, successful return value 😱

While there is some difference between poetry install -vv vs. poetry install -q, the latter is still very chatty.

I've run both under script on an open-source library aiodynamo, let's call it warm start (deps downloaded and cached; new venv every time):

  • poetry install -vv: 204KB of output
  • poetry install -q: 160KB of output

The diff shows that -vv adds bits like "skipped", "for following reason", "not required".
The baseline -q are realtime updates "Installing...", package names, completion.

IMO the situation is much worse for large packages (more deps, more permutations during concurrent install).
Also it's notably worse for cold boot (e.g. CI flow without cached downloads, where downloading NN% is displayed).

Maybe let's add a help-wanted label?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikaro picture nikaro  ·  3Comments

ambv picture ambv  ·  3Comments

AWegnerGitHub picture AWegnerGitHub  ·  3Comments

thejohnfreeman picture thejohnfreeman  ·  3Comments

Euphorbium picture Euphorbium  ·  3Comments