Skip to content

WISH: Output messages and progress to stderr (instead of stdout) #217

@HenrikBengtsson

Description

@HenrikBengtsson

It looks like conda-pack outputs messages and progress to standard output;

$ conda activate myenv
(myenv) $ conda-pack --version
conda-pack 0.7.0
(myenv) $ conda-pack > stdout 2> stderr
(myenv) $ ls -l stdout stderr
-rw-rw-r-- 1 hb hb     0 Apr 14 12:08 stderr
-rw-rw-r-- 1 hb hb 20171 Apr 14 12:09 stdout
(myenv) $ cat stdout
Collecting packages...
Packing environment at '/home/hb/.conda/envs/myenv' to 'myenv.tar.gz'
[########################################] | 100% Completed | 30.0s

I think it would be more in line with the Unix-philosophy for such output, meant for human consumption, to go to standard error, and leave output to stdout to be consumed by software, e.g. via Unix pipe and likes. This way, you can safely do things such as:

mytool() {
  conda-pack
  echo "DONE"
}
$ res=$(mytool)
Collecting packages...
Packing environment at '/home/hb/.conda/envs/myenv' to 'myenv.tar.gz'
[########################################] | 100% Completed | 30.0s
$ echo "res=$res"
DONE

As it is now, res contains also those messages and the progress bar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending::discussioncontains some ongoing discussion that needs to be resolved prior to proceedingsource::communitycatch-all for issues filed by community membersstale::recovered[bot] recovered after being marked as staletype::featurerequest for a new feature or capability

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions