python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.91k stars 2.28k forks source link

Get more consistent output from `poetry show` #9597

Open ch1nq opened 4 months ago

ch1nq commented 4 months ago

Issue Kind

Change in current behaviour

Description

Currently, the output of poetry show depends on the width of the terminal of the caller. This means that some information might get truncated if the terminal is not wide enough. While this makes for a more more readable output for the user, it becomes less ideal when calling the command from a script, where the notion of terminal width does not make sense.

In order to get a more consistent output from the poetry show command, there should be a --no-truncate flag added to the command. When the flag is set, the show command does not take the width of the terminal into account when deciding the level of detail to print.

Impact

If poetry show is called from a script that processes the output downstream, it needs the command to give a consistent output.

Workarounds

Currently, it is possible to set an arbitrarily large fake terminal width, in order to achieve to ensure nothing is truncated. E.g., setting environment variable COLUMNS={large number}. However, this is very much a hack and does not seem like the right solution.

dimbleby commented 4 months ago

there is no need to have an issue and a pull request, just the pull request is sufficient