Skip to content

Further improve micromamba search output#2823

Merged
jonashaag merged 8 commits intomamba-org:mainfrom
delsner:bugfix-search-mamba
Sep 26, 2023
Merged

Further improve micromamba search output#2823
jonashaag merged 8 commits intomamba-org:mainfrom
delsner:bugfix-search-mamba

Conversation

@delsner
Copy link
Contributor

@delsner delsner commented Sep 8, 2023

Motivation

Minor fixes and changes to aesthetics in the current micromamba search output.

Changes

  • Fix duplicate build SHAs for packages from multiple channels
  • Fix whitespace padding in single package view
  • Change underscore to unicode dash
  • Add version collapsing in single package view for >5 versions
  • Use -v to show all builds as requested in micromamba search does not print every package #2847

Examples

Single package view

Single package view

❯ ./build/mamba-shared-debug/micromamba/micromamba search "pandas"

pandas 2.1.0 py39h425d09f_0 (+ 2 builds)
────────────────────────────────────────

 Name            pandas
 Version         2.1.0
 Build           py39h425d09f_0
 Size            11984 kB
 License         BSD-3-Clause
 Subdir          osx-arm64
 File Name       pandas-2.1.0-py39h425d09f_0.conda
 URL             https://*****conda.anaconda.org/conda-forge/osx-arm64/pandas-2.1.0-py39h425d09f_0.conda
 MD5             3f819b036f93bdf1bc7c84f5e6ce3d06
 SHA256          22ca3c15e5212e4c00ce190ef8c935406d4150e32277ee784fb7e0362ef2a30e

 Dependencies:
  - python_abi 3.9.* *_cp39
  - python >=3.9,<3.10.0a0
  - python >=3.9,<3.10.0a0 *_cpython
  - libcxx >=15.0.7
  - numpy >=1.22.4,<2.0a0
  - python-dateutil >=2.8.1
  - pytz >=2020.1
  - python-tzdata >=2022a

 Other Versions (28):

  Version Build
 ───────────────────────────────────────────
  2.0.3   py39h6b13a34_1       (+ 7 builds)
  2.0.2   py39h6b13a34_0       (+ 3 builds)
  ...     (24 hidden versions)          ...
  1.1.4   py39ha4bedbf_0       (+ 1 builds)
  1.1.3   py39h88a2970_2       (+ 1 builds)
Single package verbose view with all builds

Single package verbose view with all builds (-v)

❯ ./build/mamba-shared-debug/micromamba/micromamba search "pandas" -v
Getting repodata from channels...
...
info     libmamba Metadata from solv are valid, loading successful


      pandas 2.1.0 py39h425d09f_0
────────────────────────────────────────

 Name            pandas
 Version         2.1.0
 Build           py39h425d09f_0
 Size            11984 kB
 License         BSD-3-Clause
 Subdir          osx-arm64
 File Name       pandas-2.1.0-py39h425d09f_0.conda
 URL             https://*****conda.anaconda.org/conda-forge/osx-arm64/pandas-2.1.0-py39h425d09f_0.conda
 MD5             3f819b036f93bdf1bc7c84f5e6ce3d06
 SHA256          22ca3c15e5212e4c00ce190ef8c935406d4150e32277ee784fb7e0362ef2a30e

 Dependencies:
  - python_abi 3.9.* *_cp39
  - python >=3.9,<3.10.0a0
  - python >=3.9,<3.10.0a0 *_cpython
  - libcxx >=15.0.7
  - numpy >=1.22.4,<2.0a0
  - python-dateutil >=2.8.1
  - pytz >=2020.1
  - python-tzdata >=2022a

 Other Builds (113):

  Version Build
 ───────────────────────────
  2.1.0   py310h5924a0a_0
  2.1.0   py311h9e438b8_0
  2.0.3   py39h6b13a34_1
  2.0.3   py310h1cdf563_1
  2.0.3   py39h6b13a34_0
  2.0.3   py311h9e438b8_1
  2.0.3   py310h1cdf563_0
  2.0.3   py38hefb543e_1
  2.0.3   py311h9e438b8_0
  2.0.3   py38hefb543e_0
  2.0.2   py310h1cdf563_0
  2.0.2   py311h9e438b8_0
  2.0.2   py38hefb543e_0
  2.0.2   py39h6b13a34_0
  2.0.1   py39h6b13a34_1
  2.0.1   py38hefb543e_0
  2.0.1   py310h1cdf563_0
  2.0.1   py39h6b13a34_0
  2.0.1   py38hefb543e_1
  2.0.1   py311h9e438b8_1
  2.0.1   py310h1cdf563_1
  2.0.1   py311h9e438b8_0
  2.0.0   py39hde7b980_0
  2.0.0   py311h4eec4a9_0
  2.0.0   py310h2b830bf_0
  2.0.0   py38h61dac83_0
  1.5.3   py311h4eec4a9_0
  1.5.3   py39hde7b980_1
  1.5.3   py38h61dac83_1
  1.5.3   py310h2b830bf_0
  1.5.3   py311h4eec4a9_1
  1.5.3   py310h2b830bf_1
  1.5.3   py39hde7b980_0
  1.5.3   py38h61dac83_0
  1.5.2   py38h61dac83_1
  1.5.2   py311h4eec4a9_0
  1.5.2   py39hde7b980_2
  1.5.2   py38h61dac83_0
  1.5.2   py39hde7b980_1
  1.5.2   py310h2b830bf_0
  1.5.2   py39hde7b980_0
  1.5.2   py311h4eec4a9_1
  1.5.2   py310h2b830bf_2
  1.5.2   py38h61dac83_2
  1.5.2   py310h2b830bf_1
  1.5.2   py311h4eec4a9_2
  1.5.1   py38h61dac83_0
  1.5.1   py39hde7b980_1
  1.5.1   py310h2b830bf_1
  1.5.1   py310h2b830bf_0
  1.5.1   py38h61dac83_1
  1.5.1   py311h4eec4a9_1
  1.5.1   py39hde7b980_0
  1.5.0   py38h61dac83_0
  1.5.0   py39hde7b980_0
  1.5.0   py310h2b830bf_0
  1.4.4   py310h2b830bf_0
  1.4.4   py38h2a4bfaf_0
  1.4.4   py39he7125aa_0
  1.4.3   py310ha6a5cd6_0
  1.4.3   py39hd2dba81_0
  1.4.3   py38h6724fcd_0
  1.4.2   py39h2666b31_1
  1.4.2   py310h3a37f5e_0
  1.4.2   py38h55de146_0
  1.4.2   py310h3a37f5e_1
  1.4.2   py310ha6a5cd6_2
  1.4.2   py39h2666b31_0
  1.4.2   py38h6724fcd_2
  1.4.2   py39hd2dba81_2
  1.4.2   py38h55de146_1
  1.4.1   py38h3777fb4_0
  1.4.1   py39h7f752ed_0
  1.4.1   py310hdead3df_0
  1.4.0   py310hdead3df_0
  1.4.0   py38h3777fb4_0
  1.4.0   py39h7f752ed_0
  1.3.5   py310hdead3df_0
  1.3.5   py39h7f752ed_0
  1.3.5   py38h3777fb4_0
  1.3.4   py310hdead3df_1
  1.3.4   py39h7f752ed_0
  1.3.4   py38h3777fb4_0
  1.3.4   py39h7f752ed_1
  1.3.4   py38h3777fb4_1
  1.3.3   py38h3777fb4_0
  1.3.3   py39h7f752ed_0
  1.3.2   py38h3777fb4_0
  1.3.2   py39h7f752ed_0
  1.3.1   py38h3777fb4_0
  1.3.1   py39h7f752ed_0
  1.3.0   py39h7f752ed_0
  1.3.0   py38h3777fb4_0
  1.2.5   py39h7f752ed_0
  1.2.5   py38h3777fb4_0
  1.2.4   py39h7f752ed_0
  1.2.4   py38h3777fb4_0
  1.2.3   py39ha4bedbf_0
  1.2.3   py38h9b9bf68_0
  1.2.2   py38h9b9bf68_0
  1.2.2   py39ha4bedbf_0
  1.2.1   py38h9b9bf68_0
  1.2.1   py39ha4bedbf_0
  1.2.0   py38h9b9bf68_0
  1.2.0   py39ha4bedbf_1
  1.2.0   py38h9b9bf68_1
  1.2.0   py39ha4bedbf_0
  1.1.5   py39ha4bedbf_0
  1.1.5   py38h9b9bf68_0
  1.1.4   py38h9b9bf68_0
  1.1.4   py39ha4bedbf_0
  1.1.3   py39h88a2970_2
  1.1.3   py38h73c04be_2

@delsner delsner marked this pull request as ready for review September 19, 2023 09:15
@delsner
Copy link
Contributor Author

delsner commented Sep 19, 2023

@jonashaag please have a look 👀

@jonashaag
Copy link
Contributor

Great, thanks!

I wonder if we should have a way to enable verbose search output without the "technical" output from Mamba that typically comes with -v

@delsner
Copy link
Contributor Author

delsner commented Sep 19, 2023

Would you envision something like --pretty-verbose?

@delsner
Copy link
Contributor Author

delsner commented Sep 20, 2023

Looks like the CI fails because the workflow was cancelled?

error libmamba Could not set lock (Resource temporarily unavailable)
warning libmamba Cannot lock '/Users/runner/tmproot0NX8U63A4Z/pkgs'
Waiting for other mamba process to finish
Error: The operation was canceled.

@delsner
Copy link
Contributor Author

delsner commented Sep 22, 2023

All checks are passing now. @jonashaag how should we proceed with this?

@jonashaag
Copy link
Contributor

I'm still not sure about the -v flag

@delsner
Copy link
Contributor Author

delsner commented Sep 23, 2023

Would you envision something like --pretty-verbose?

WDYT, should I implement this instead?

@jonashaag
Copy link
Contributor

@AntoinePrv @pavelzw @JohanMabille any input here?

Copy link
Member

@AntoinePrv AntoinePrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it is not the point of this PR, but if you can find the time to split print_solvable into a few functions while the logic is still warm in your head, it would make it more readable.
Maybe also take everything that has side effects (e.g. out) as a parameter.

For -v vs --pretty-verbose, I see no good option, the former prints too much information, while the later seems duplicate. Maybe --full?

But this is good for me anyhow., thanks for the PR!

@delsner
Copy link
Contributor Author

delsner commented Sep 25, 2023

can find the time to split print_solvable into a few functions while the logic is still warm in your head

Done in 3c737ca

For -v vs --pretty-verbose ... Maybe --full?

Since this seems to be more of a corner case (and is probably most used for automated parsing where additional logging doesn't "distract" the user), I think I would avoid overloading the CLI with an additional parameter. So I'm fine with leaving this at -v as requested by the issue, but your choice @jonashaag and @AntoinePrv

@JohanMabille
Copy link
Member

Thanks for the PR! I would be in favor to keep -v for now. We should rework the -v globally in mamba to remove all the technical output from it, and have an additional flag fot this output (most of the time used for debugging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants