pixi icon indicating copy to clipboard operation
pixi copied to clipboard

bug(exec): `pixi exec --list` prints heading twice

Open pavelzw opened this issue 1 year ago • 10 comments

❯ pixi exec --list -s python -- python --version
The environment has 17 packages:
Package          Version    Build               Size
bzip2            1.0.8      hd037594_8          122.1 KiB
ca-certificates  2025.10.5  hbd8a1cb_0          152.3 KiB
icu              75.1       hfee45f7_0          11.3 MiB
libexpat         2.7.1      hec049ff_0          64.4 KiB
libffi           3.5.2      he5f378a_0          39.3 KiB
liblzma          5.8.1      h39f12f2_2          90.1 KiB
libmpdec         4.0.0      h5505292_0          70.1 KiB
libsqlite        3.50.4     h4237e3c_0          881.5 KiB
libzlib          1.3.1      h8359307_2          45.3 KiB
ncurses          6.5        h5e97a16_3          778.3 KiB
openssl          3.5.4      h5503f6c_0          2.9 MiB
python           3.14.0     h40d2674_102_cp314  13 MiB
python_abi       3.14       8_cp314             6.8 KiB
readline         8.2        h1d1bf99_2          246.4 KiB
tk               8.6.13     h892fb3f_2          3 MiB
tzdata           2025b      h78e105d_0          120.1 KiB
zstd             1.5.7      h6491c7d_2          390.6 KiB
Package          Version    Build               Size

Python 3.14.0

the second Package Version Build Size should not be included in the output

pavelzw avatar Oct 31 '25 10:10 pavelzw

ah! at least should be very easy to fix!

nichtmacho avatar Nov 03 '25 08:11 nichtmacho

can I work on this issue?

aosen-xiong avatar Nov 04 '25 15:11 aosen-xiong

can I work on this issue?

sure! feel free to also assign me as a reviewer

nichtmacho avatar Nov 04 '25 16:11 nichtmacho

Great! I submitted #4885 and it is just one line change.

I also verified with my release build.

see:

./target/release/pixi exec --list -s python -- python --version 2>&1
The environment has 17 packages:
Package          Version    Build               Size
bzip2            1.0.8      hd037594_8          122.1 KiB
ca-certificates  2025.10.5  hbd8a1cb_0          152.3 KiB
icu              75.1       hfee45f7_0          11.3 MiB
libexpat         2.7.1      hec049ff_0          64.4 KiB
libffi           3.5.2      he5f378a_0          39.3 KiB
liblzma          5.8.1      h39f12f2_2          90.1 KiB
libmpdec         4.0.0      h5505292_0          70.1 KiB
libsqlite        3.50.4     h4237e3c_0          881.5 KiB
libzlib          1.3.1      h8359307_2          45.3 KiB
ncurses          6.5        h5e97a16_3          778.3 KiB
openssl          3.5.4      h5503f6c_0          2.9 MiB
python           3.14.0     h40d2674_102_cp314  13 MiB
python_abi       3.14       8_cp314             6.8 KiB
readline         8.2        h1d1bf99_2          246.4 KiB
tk               8.6.13     h892fb3f_2          3 MiB
tzdata           2025b      h78e105d_0          120.1 KiB
zstd             1.5.7      h6491c7d_2          390.6 KiB
Python 3.14.0

aosen-xiong avatar Nov 05 '25 00:11 aosen-xiong

Wait, are we sure that this is a bad thing?

Having headers at the beginning and at the end isn't exactly uncommon for long tables.

Hofer-Julian avatar Nov 05 '25 07:11 Hofer-Julian

^ @ruben-arts

Hofer-Julian avatar Nov 05 '25 07:11 Hofer-Julian

imo we should print only the top header.

I also took a look at the uv:

Image

nichtmacho avatar Nov 05 '25 08:11 nichtmacho

regardless of how uv does it, i don't think headers twice are necessary here. pixi list also doesn't do it, i personally find it quite irritating (that's why i created the issue :p) and four columns are not that hard to memorize, especially since they are trivial to distinguish

especially when using --color never (or in ci logs when not using --color always) i find the header that the end pretty weird

pavelzw avatar Nov 05 '25 08:11 pavelzw

i also noticed that the formatting of both tools look slightly different:

Image

IMO pixi exec --list should have the same highlighting as pixi list, i.e. green bold for explicit deps and header black bold. coloring the whole explicit line sounds sensible to me, maybe we want to pull this to pixi list?

pavelzw avatar Nov 05 '25 08:11 pavelzw

I agree we should align the two results, I don't have an opinion about the 1 or 2 line.

ruben-arts avatar Nov 05 '25 12:11 ruben-arts