Skip to content

Skip invalid tools in uv tool list - #5156

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/l
Jul 18, 2024
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/l

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Makes the tools() return value include per-tool errors. This makes it easy to skip (rather than failing) in uv tool list, and improves uv tool uninstall to remove those invalid tools, rather than leaving them around. (We already had that behavior for uv tool uninstall ruff with an invalid ruff, but uv tool uninstall --all just left them.)

Closes #5151.

@charliermarsh charliermarsh changed the title Skip invalid tools in uv tool list Skip invalid tools in uv tool list Jul 17, 2024
@charliermarsh charliermarsh added bug Something isn't working preview Experimental behavior labels Jul 17, 2024
@charliermarsh
charliermarsh marked this pull request as ready for review July 17, 2024 17:55
@charliermarsh
charliermarsh requested a review from zanieb July 17, 2024 17:55
@charliermarsh
charliermarsh force-pushed the charlie/l branch 4 times, most recently from 3ac204e to 10f554c Compare July 17, 2024 18:28
Comment thread crates/uv/src/commands/tool/list.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"Ignoring malformed tool `{name}` (use {} to remove)",
"Ignoring malformed tool `{name}` (use `{}` to remove)",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's green though so I intentionally omitted this, what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh. I don't think the color is enough alone (and it's not great for users with colorblindness or colors turned off).

Comment thread crates/uv/tests/tool_list.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
warning: Ignoring malformed tool `black` (use uv tool uninstall black to remove)
warning: Ignoring malformed tool `black` (use `uv tool uninstall black` to remove)

Comment thread crates/uv/src/commands/tool/uninstall.rs Outdated
@charliermarsh
charliermarsh enabled auto-merge (squash) July 18, 2024 17:48
@charliermarsh
charliermarsh merged commit 4a875af into main Jul 18, 2024
@charliermarsh
charliermarsh deleted the charlie/l branch July 18, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv tool list should not fail on invalid receipts

2 participants