这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Apr 22, 2025

Description

Part of #14070

Adds a --fields CLI flag to conda list to control the default output:

$ conda list --fields name,version,build,sha256
# packages in environment at /Users/jrodriguez/.local/conda/envs/conda-dev:
#
# Name                      Version         Build              Sha256                                                          
anaconda-cli-base           0.5.2           pyhd8ed1ab_0       71686843e664a333e82c6d1cf07c98e57519218b0aaba12f00109204d082ab73
anaconda-client             1.13.0          pyh29332c3_1       9802c4b3cd89bf6d59f9b4e4f0916a1ccbe1dff5fe9d187402b5efcdc7d410e1
annotated-types             0.7.0           pyhd8ed1ab_1       e0ea1ba78fbb64f17062601edda82097fcf815012cf52bb704150a2668110d48
archspec                    0.2.5           pyhd8ed1ab_0       eb68e1ce9e9a148168a4b1e257a8feebffdb0664b557bb526a1e4853f2d2fc00
attrs                       25.3.0          pyh71513ae_0       99c53ffbcb5dc58084faf18587b215f9ac8ced36bbfb55fa807c00967e419019
blinker                     1.9.0           pyhff2d567_0       f7efd22b5c15b400ed84a996d777b6327e5c402e79e3c534a7e086236f1eb2dc
boltons                     24.0.0          pyhd8ed1ab_1       4d6101f6a900c22495fbaa3c0ca713f1876d11f14aba3f7832bf6e6986ee5e64
brotli-python               1.1.0           py312hde4cb15_2    254b411fa78ccc226f42daf606772972466f93e9bc6895eabb4cfda22f5178af
bzip2                       1.0.8           h99b78c6_7         adfa71f158cbd872a36394c56c3568e6034aa55c623634b37a4836bd036e6b91
c-ares                      1.34.4          h5505292_0         09c0c8476e50b2955f474a4a1c17c4c047dd52993b5366b6ea8e968e583b921f
ca-certificates             2025.1.31       hf0a4a13_0         7e12816618173fe70f5c638b72adf4bfd4ddabf27794369bb17871c5bb75b9f9

As a side effect, it also solves the column width, which is not hardcoded anymore and instead tracks the maximum width in the list.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 22, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Apr 22, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 22, 2025

CodSpeed Performance Report

Merging #14781 will not alter performance

Comparing jaimergp:conda-list-fields (108cc16) with main (07a2d63)

Summary

✅ 21 untouched benchmarks

@jaimergp jaimergp marked this pull request as ready for review April 24, 2025 18:34
@jaimergp jaimergp requested a review from a team as a code owner April 24, 2025 18:34
@jaimergp jaimergp linked an issue Apr 24, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Needs separation between UI and implementation details

@github-project-automation github-project-automation bot moved this from 🆕 New to 🏗️ In Progress in 🔎 Review Apr 25, 2025
@jaimergp jaimergp requested a review from jezdez April 30, 2025 09:38
jezdez
jezdez previously approved these changes Apr 30, 2025

#: The default `conda list` columns
DEFAULT_CONDA_LIST_FIELDS = ("name", "version", "build", "channel_name")
CONDA_LIST_FIELDS = {
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Comment on lines +334 to +335
def schannel(self):
return self.channel_name
Copy link
Member

Choose a reason for hiding this comment

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

Wooot!

@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to ✅ Approved in 🔎 Review Apr 30, 2025
@jaimergp
Copy link
Contributor Author

jaimergp commented May 1, 2025

Thanks @jezdez. We'll need a reapprove here after merging the conflicts.

@jaimergp
Copy link
Contributor Author

jaimergp commented May 1, 2025

We'll probably run into AnacondaRecipes/pip-feedstock#36 now 😬

@jaimergp jaimergp merged commit f470036 into conda:main May 2, 2025
75 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

conda list plugin hooks

3 participants