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 entrypoints to tool list #4661

Merged
merged 7 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crates/uv/src/commands/tool/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ pub(crate) async fn list(preview: PreviewMode, printer: Printer) -> Result<ExitS
return Ok(ExitStatus::Success);
}

// TODO(zanieb): Track and display additional metadata, like entry points
for (name, _tool) in tools {
for (name, tool) in tools {
// Output tool name
writeln!(printer.stdout(), "{name}")?;

// Output tool entrypoints
for entrypoint in tool.entrypoints() {
writeln!(printer.stdout(), " {}", &entrypoint.name)?;
}
}

Ok(ExitStatus::Success)
Expand Down
10 changes: 6 additions & 4 deletions crates/uv/tests/tool_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod common;

#[test]
fn tool_list() {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_filtered_exe_suffix();
let tool_dir = context.temp_dir.child("tools");
let bin_dir = context.temp_dir.child("bin");

Expand All @@ -28,15 +28,17 @@ fn tool_list() {
exit_code: 0
----- stdout -----
black

black
blackd

----- stderr -----
warning: `uv tool list` is experimental and may change without warning.
"###);
}

#[test]
fn tool_list_empty() {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_filtered_exe_suffix();
let tool_dir = context.temp_dir.child("tools");
let bin_dir = context.temp_dir.child("bin");

Expand All @@ -55,7 +57,7 @@ fn tool_list_empty() {

#[test]
fn tool_list_missing_receipt() {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_filtered_exe_suffix();
let tool_dir = context.temp_dir.child("tools");
let bin_dir = context.temp_dir.child("bin");

Expand Down
Loading