Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use tabwriter instead of comfy_table #745

Merged

Conversation

baszalmstra
Copy link
Contributor

Fix #741

Replaces comfy_table with the much simpler tabwriter. This allows us to simply use console for all styling which should then follow the rules around --color.

@wolfv
Copy link
Member

wolfv commented Jan 31, 2024

Does it look the same? :)

@baszalmstra
Copy link
Contributor Author

I didnt test in all circumstances, but running pixi list in any of the examples looks the same.

Before (main):

image

After (this PR):

image

(Note that the headers are set to bold but that doesnt seem to work on windows)

@ruben-arts
Copy link
Contributor

This only changes the way we line wrap.

 python            3.11.7      hab00c5b_1_cpython  29.4 MiB   conda  python-3.11.7-hab00c5 
                                                                     b_1_cpython.conda     
 python-dateutil   2.8.2                                      pypi                         
 readline          8.2         h8228510_1          274.9 KiB  conda  readline-8.2-h8228510 
                                                                     _1.conda              
 sdist             0.0.0                                      pypi                         
 six               1.16.0                                     pypi                         
 tk                8.6.13      noxft_h4845f30_101  3.2 MiB    conda  tk-8.6.13-noxft_h4845 
                                                                     f30_101.conda         
 tzdata            2023d       h0c530f3_0          116.8 KiB  conda  tzdata-2023d-h0c530f3 
                                                                     _0.conda              
 xz                5.2.6       h166bdaf_0          408.6 KiB  conda  xz-5.2.6-h166bdaf_0.t 

vs the new version from this pr:

 python            3.11.7      hab00c5b_1_cpython  29.4 MiB   conda  python-3.11.7-hab00c5b_1_cpython.conda      
 python-dateutil   2.8.2                                      pypi                                               
 readline          8.2         h8228510_1          274.9 KiB  conda  readline-8.2-h8228510_1.conda               
 sdist             0.0.0                                      pypi                                               
 six               1.16.0                                     pypi                                               
 tk                8.6.13      noxft_h4845f30_101  3.2 MiB    conda  tk-8.6.13-noxft_h4845f30_101.conda          
 tzdata            2023d       h0c530f3_0          116.8 KiB  conda  tzdata-2023d-h0c530f3_0.conda               
 xz                5.2.6       h166bdaf_0          408.6 KiB  conda  xz-5.2.6-h166bdaf_0.tar.bz2       

So this linewraps the complete line where the previous version would do it per colomn. I'm fine with this change as it already shows that this is easier to copy and past to share info for instance. We should just take care that the information we are showing shouldn't become much bigger then a normal window size.

@ruben-arts ruben-arts merged commit f1030ef into prefix-dev:main Jan 31, 2024
9 checks passed
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.

pixi list ignores the --color flag
3 participants