-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add pixi list
command
#665
Conversation
It would be nice to differentiate packages specified in |
@hadim if you can get the specs from the pixi.toml, then it should be as easy as comparing the names of the packages, right? In order to highlight them. |
Also: awesome! Thanks :) |
I found a way. It's working fine but would need another pair of eyes since |
I think you might want to take them as CLI arguments? Including the "environment" (once we enable that feature, so you can ignore that for now). But something like |
Hum, actually the current logic fetches the installed packages from the current prefix. So it would need a different logic if we want to also display for other platforms. It raises the point what we want this command to be: the current logic was to stick to what is currently installed in the current prefix. Here is what I use to get the installed packages: let prefix_records = prefix
.find_installed_packages(None)
.await
.map_err(|_| miette::miette!("Cannot find installed packages"))?; Question: do you want to generalize the command and allow listing for any available platforms? If yes, can you point me to the correct logic to replace the snippet above? |
@wolfv generalizing to any project's platforms and envs seems best. I will refactor the logic to rely on the lock_file module instead. |
Current API: $ pr cargo run -- list --help
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/pixi list --help`
List project's packages. Highlighted packages are explicit dependencies
Usage: pixi list [OPTIONS] [REGEX]
Arguments:
[REGEX] List only packages matching a regular expression
Options:
--platform <PLATFORM> The platform to list packages for. Defaults to the current platform
--json Whether to output in json format
--json-pretty Whether to output in pretty json format
--no-sort Whether to sort the package list by name
--manifest-path <MANIFEST_PATH> The path to 'pixi.toml'
-v, --verbose... Increase logging verbosity
-q, --quiet... Decrease logging verbosity
--color <COLOR> Whether the log needs to be colored [default: auto] [possible values: always,
never, auto]
-h, --help Print help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hadim really awesome PR!
No big changes required from my point of view! Just wrap it up and we'll ship it!
@hadim we're using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR! I left some small comments.
All good on my side here. Let me know if you catch something else. Thanks for the reviews everyone! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, thanks @hadim
Looks awesome! Looking forward to the next pixi release. Thanks @hadim |
Original ticket: #238