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

add cph list subcommand #236

Merged
merged 13 commits into from
Apr 18, 2024
Merged

add cph list subcommand #236

merged 13 commits into from
Apr 18, 2024

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Apr 2, 2024

Description

Reuses tarfile.Tarfile.list() across .tar.bz2 and .conda artifacts. The unified interface with the tar generator makes it super easy!

This should help with inspecting artifact contents without having to pay for extraction. I picture this in post-conda-build reports in CI.

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 2, 2024
src/conda_package_handling/api.py Outdated Show resolved Hide resolved
src/conda_package_handling/streaming.py Outdated Show resolved Hide resolved
src/conda_package_handling/streaming.py Outdated Show resolved Hide resolved
src/conda_package_handling/streaming.py Show resolved Hide resolved
src/conda_package_handling/tarball.py Outdated Show resolved Hide resolved
src/conda_package_handling/conda_fmt.py Outdated Show resolved Hide resolved
src/conda_package_handling/conda_fmt.py Show resolved Hide resolved
src/conda_package_handling/interface.py Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
for component in _stream_components(filename, components):
for tar, _ in component:
with redirect_stdout(memfile):
tar.list(verbose=verbose)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, such re-use.

key=lambda line: line.split(None, 5)[-1],
)
else:
lines = sorted(memfile.readlines())
Copy link
Contributor

Choose a reason for hiding this comment

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

Skip the sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to achieve output order consistency. In .conda artifacts, the info/ block will be always put in the end. I've also seen some pkg components containing stuff under info/.

@dholth
Copy link
Contributor

dholth commented Apr 2, 2024

Great work, thanks

@jaimergp
Copy link
Contributor Author

Any further comments that need to be addressed? Thanks @dholth

@kenodegard kenodegard merged commit d3843ae into conda:main Apr 18, 2024
11 checks passed
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.

None yet

4 participants