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

Use already-installed tools in uv tool run #4750

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

charliermarsh
Copy link
Member

Summary

This doesn't cache the tool environment; rather, it just uses the tool install environment if it satisfies the request.

Closes #4742.

@charliermarsh charliermarsh changed the title Use already-installed tools in uv tool run Use already-installed tools in uv tool run Jul 2, 2024
@charliermarsh charliermarsh added the preview Experimental behavior label Jul 2, 2024
crates/uv/tests/tool_run.rs Outdated Show resolved Hide resolved
crates/uv/tests/tool_run.rs Outdated Show resolved Hide resolved
@zanieb
Copy link
Member

zanieb commented Jul 2, 2024

Dangerous to review your pull requests so soon.

We should include tests with:

  • compatible and incompatible constraints e.g. uv tool run --from 'black>23' black
  • --isolated to opt-out and use the latest version
  • an extra requirement via --with

@charliermarsh
Copy link
Member Author

Good call, added!

@charliermarsh charliermarsh requested a review from zanieb July 2, 2024 23:55
@charliermarsh charliermarsh force-pushed the charlie/reuse-tool-env branch 2 times, most recently from cf784d8 to 9313265 Compare July 3, 2024 15:28
Comment on lines +310 to +311
// TODO(charlie): This could (in theory) layer the `--with` requirements on top of the existing
// environment.
Copy link
Member

Choose a reason for hiding this comment

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

This would be nice and sensible

@charliermarsh charliermarsh enabled auto-merge (squash) July 3, 2024 16:30
@charliermarsh charliermarsh merged commit f980e3f into main Jul 3, 2024
47 checks passed
@charliermarsh charliermarsh deleted the charlie/reuse-tool-env branch July 3, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv tool run should use already-installed tool (if possible)
2 participants