CircleCI-Public / python-orb

Common CircleCI tasks for the Python programming language.
https://circleci.com/developer/orbs/orb/circleci/python
MIT License
13 stars 37 forks source link

Add parameter to use `| cat` to make stdout not a tty #77

Closed whardier closed 2 years ago

whardier commented 3 years ago

Describe Request:

Running tools like pip/poetry in front of | cat to set stdout to a standard file descriptor rather than a tty/pty

Examples:

poetry --no-ansi ... | cat will produce line by line streamed output since stdout is no longer considered a tty.

pip ... | cat will still simplify output and produce easier to view/parse output.

Supporting Documentation Links:

clikit and pip both use os.isatty/file.isatty to determine output parameters.

dsayling commented 3 years ago

| cat would also mask the return code from the previous command. my 2c, I'm sure there would be a away around this, but I'm not sure if the use case is widespread enough

whardier commented 3 years ago

Good point Drew. You would need to declare the result and eval it through some wrapping. I've attempted to resolve the interactive delays using various techniques and have only had success by setting bash to bail on any error and using | cat.

Jaryt commented 2 years ago

Hi @whardier! Thanks for your patience here. I'm investigating the use case here, and was wondering if you could shine some light on how you would benefit from this. I share the main concern with Drew that this might not be widespread enough. However, we could certainly find a middleground where we provide some extra parameters to concat a string to the end of the command.

Jaryt commented 2 years ago

I realized since my last comment that we do provide the args parameter already, which can fulfill this request if it is set to | cat.