mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.68k stars 346 forks source link

ENH: Sort output of packages to be installed #3345

Open corneliusroemer opened 1 month ago

corneliusroemer commented 1 month ago

I love micromamba's informative output displaying the changes to the environment: which packages would be installed, changed, updated, etc.

However, I often find myself hopelessly searching through the list of 100 packages in a linear fashion, rather than using binary search, because the list does not seem to be sorted at all.

Would it be possible to make the output more efficiently searchable by sorting packages by name or some other column?

This would be a big quality of life improvement for me, and I'm sure many people would appreciate it. Is there a particular reason for the order the way it's displayed? It seems quite random to me, I haven't been able to spot some patter yet in my years of usage of mamba.

Example output (first few lines):


  Package                                  Version  Build                 Channel           Size
──────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────────────────────────────────────────

  + seqkit                                   2.8.2  h4f1019d_1            bioconda        Cached
  + xz                                       5.2.6  h57fd34a_0            conda-forge     Cached
  + libexpat                                 2.6.2  hebf3989_0            conda-forge     Cached
  + tsv-utils                                2.2.3  h99b78c6_7            conda-forge     Cached
  + python_abi                                3.11  4_cp311               conda-forge     Cached
  + ncurses                                    6.5  hb89a1cb_0            conda-forge     Cached
  + yaml                                     0.2.5  h3422bc3_2            conda-forge     Cached
  + bzip2                                    1.0.8  h93a5062_5            conda-forge     Cached
  + libffi                                   3.4.2  h3422bc3_5            conda-forge     Cached
  + libzlib                                  1.3.1  hfb2fe0b_1            conda-forge     Cached
  + libcxx                                  18.1.8  h167917d_0            conda-forge     Cached
  + ca-certificates                       2024.7.4  hf0a4a13_0            conda-forge     Cached
  + llvm-openmp                             18.1.8  hde57baf_0            conda-forge     Cached
  + readline                                   8.2  h92ec313_1            conda-forge     Cached
  + zstd                                     1.5.6  hb46c0d2_0            conda-forge     Cached
  + tk                                      8.6.13  h5083fa2_1            conda-forge     Cached
  + libsqlite                               3.46.0  hfb93653_0            conda-forge     Cached
  + openssl                                  3.3.1  hfb2fe0b_1            conda-forge     Cached
  + libgfortran5                            13.2.0  hf226fd6_3            conda-forge     Cached
  + libgfortran                              5.0.0  13_2_0_hd922786_3     conda-forge     Cached
  + libopenblas                             0.3.27  openmp_h517c56d_1     conda-forge     Cached
  + libblas                                  3.9.0  22_osxarm64_openblas  conda-forge     Cached
  + libcblas                                 3.9.0  22_osxarm64_openblas  conda-forge     Cached
  + liblapack                                3.9.0  22_osxarm64_openblas  conda-forge     Cached

It'd be amazing to have it sorted like this:


  Package                                  Version  Build                 Channel           Size
──────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────────────────────────────────────────

  + bzip2                                    1.0.8  h93a5062_5            conda-forge     Cached
  + ca-certificates                       2024.7.4  hf0a4a13_0            conda-forge     Cached
  + libblas                                  3.9.0  22_osxarm64_openblas  conda-forge     Cached
  + libcblas                                 3.9.0  22_osxarm64_openblas  conda-forge     Cached
  + libcxx                                  18.1.8  h167917d_0            conda-forge     Cached
  + libexpat                                 2.6.2  hebf3989_0            conda-forge     Cached
  + libffi                                   3.4.2  h3422bc3_5            conda-forge     Cached
  + libgfortran                              5.0.0  13_2_0_hd922786_3     conda-forge     Cached
  + libgfortran5                            13.2.0  hf226fd6_3            conda-forge     Cached
  + liblapack                                3.9.0  22_osxarm64_openblas  conda-forge     Cached
  + libopenblas                             0.3.27  openmp_h517c56d_1     conda-forge     Cached
  + libsqlite                               3.46.0  hfb93653_0            conda-forge     Cached
  + libzlib                                  1.3.1  hfb2fe0b_1            conda-forge     Cached
  + llvm-openmp                             18.1.8  hde57baf_0            conda-forge     Cached
  + ncurses                                    6.5  hb89a1cb_0            conda-forge     Cached
  + openssl                                  3.3.1  hfb2fe0b_1            conda-forge     Cached
  + python_abi                                3.11  4_cp311               conda-forge     Cached
  + readline                                   8.2  h92ec313_1            conda-forge     Cached
  + seqkit                                   2.8.2  h4f1019d_1            bioconda        Cached
  + tk                                      8.6.13  h5083fa2_1            conda-forge     Cached
  + tsv-utils                                2.2.3  h99b78c6_7            conda-forge     Cached
  + xz                                       5.2.6  h57fd34a_0            conda-forge     Cached
  + yaml                                     0.2.5  h3422bc3_2            conda-forge     Cached
  + zstd                                     1.5.6  hb46c0d2_0            conda-forge     Cached