List files of a dependency
Problem description
In c++ workflows, you sometimes need to understand the layout of a certain package to be able to work with it.
I wish there was a pixi show <pkg> --files or similar that allows to list the files installed by a package.
In conda I see the files are listed in .pixi/envs/<environment>/conda-meta/*.json in the "files" key:
"license": "Zlib",
"license_family": "Other",
"md5": "c9f075ab2f33b3bbee9e62d4ad0a6cd8",
"name": "zlib",
"platform": "linux",
"sha256": "5d7c0e5f0005f74112a34a7425179f4eb6e73c92f5d109e6af4ddeca407c92ab",
"size": 92286,
"subdir": "linux-64",
"timestamp": 1727963153079,
"version": "1.3.1",
"fn": "zlib-1.3.1-hb9d3cd8_2.conda",
"url": "https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-hb9d3cd8_2.conda",
"channel": "https://conda.anaconda.org/conda-forge/",
"extracted_package_dir": "/home/<user>/.cache/rattler/cache/pkgs/zlib-1.3.1-hb9d3cd8_2",
"files": [
"include/zconf.h",
"include/zlib.h",
"lib/pkgconfig/zlib.pc",
"lib/libz.a",
"lib/libz.so"
],
Ideally we could also pass a --remote to list the files from a package not installed locally.
do you also need other fields? or files is enough?
For my personal usage, files is enough. It would be great to have the possibility to display absolute/relative file paths.
hello @nichmor @ahoarau , i would like to work on this issue.
hello @nichmor @ahoarau , i would like to work on this issue.
hey! feel free to take it! and assign me as a reviewer
@gmarav05 @nichmor Great ! Do you guys have any idea on the actual api you'd like ?
I would like to see similar API as pixi list does - maybe it outputs it in a table, and you can also export it in json.
You can also take inspiration from npm view and uv pip show
There is https://github.com/toprinse/pixi-inspect , maybe we can extend that to include more information?
rattler-build has this ability. Is that what you need?
rattler-build has this ability. Is that what you need?
Close but not exactly. I'm expecting to type the name of the package as I'm writing it in the pixi.toml file. pixi show eigen --files
rattler-build has this ability. Is that what you need?
@baszalmstra i think we should move/copy this functionality in rattler-bin
there is now pixi-browse which allows you to view all files of a conda package. more on the interactive side as of now and fetches the files from your conda channel directly instead of interacting with your environment. but something like pixi exec pixi-browse --matchspec eigen might be interesting for you