-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Close #9871: add uv self uninstall command #11613
base: main
Are you sure you want to change the base?
Conversation
uv self uninstall
command
uv self uninstall
command
We use |
Cool, thanks for contributing! I'm not really sure how we'd write unit tests for this, but we can test it in CI, e.g., in the |
use uv_python::managed::ManagedPythonInstallations; | ||
use uv_tool::InstalledTools; | ||
|
||
pub(crate) fn self_uninstall( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should require the uv installer to have been used to enable this? Like we do in self_update
If so, that'd give us another way to determine the canonical install path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Is it fair to say that the uv installer was used iff uv
was built with the self-update
feature? In other words, is it reasonable to enable the uv self uninstall
command iff the uv self update
command is enabled?
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can check for a receipt like the update
command does.
is it reasonable to enable the uv self uninstall command iff the uv self update command is enabled?
This also makes sense to me.
TODO:
@zanieb , instead of using Thanks for your input. I'll address these items soon |
51a95cb
to
e9435b7
Compare
@zanieb as of d4965af I added a smoke test which runs Which would you prefer?
On the one hand, option 1. is an easier, less verbose fix and option 2. will lengthen the actions file and increase the number of Github actions. On the other hand, the binary built using |
Summary
Close #9871: add
uv self uninstall
commandMimics behavior listed on uv's official uninstallation instructions
Test Plan
How was this tested?
This was tested manually on Linux as follows: I intend to replace this with an automatic test in the
.github/workflows/ci.yml
file.I ran
cargo build
, then:I placed the following content into
test-linux-Dockerfile
then started the container using:
Once inside the container, I ran the
uninstall
commandon empty directories to make sure the command succeeds:
I also tried calling
uv run python
anduv tool run
at least onceso that the
uv tool dir
anduv python dir
are emptied byuv self uninstall --remove-data