Skip to content

Commit

Permalink
can self uninstall iff can self update
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc LESCOAT committed Feb 21, 2025
1 parent d354167 commit 51a95cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions crates/uv/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub(crate) use python::install::install as python_install;
pub(crate) use python::list::list as python_list;
pub(crate) use python::pin::pin as python_pin;
pub(crate) use python::uninstall::uninstall as python_uninstall;
#[cfg(feature = "self-update")]
pub(crate) use self_uninstall::self_uninstall;
#[cfg(feature = "self-update")]
pub(crate) use self_update::self_update;
Expand Down Expand Up @@ -71,6 +72,7 @@ mod publish;
mod python;
pub(crate) mod reporters;
mod run;
#[cfg(feature = "self-update")]
mod self_uninstall;
#[cfg(feature = "self-update")]
mod self_update;
Expand Down
10 changes: 4 additions & 6 deletions crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ use tokio::task::spawn_blocking;
use tracing::{debug, instrument};
use uv_cache::{Cache, Refresh};
use uv_cache_info::Timestamp;
#[cfg(feature = "self-update")]
use uv_cli::SelfUpdateArgs;
use uv_cli::{
compat::CompatArgs, BuildBackendCommand, CacheCommand, CacheNamespace, Cli, Commands,
PipCommand, PipNamespace, ProjectCommand,
};
use uv_cli::{
PythonCommand, PythonNamespace, SelfCommand, SelfNamespace, SelfUninstallArgs, ToolCommand,
ToolNamespace, TopLevelArgs,
};
use uv_cli::{PythonCommand, PythonNamespace, ToolCommand, ToolNamespace, TopLevelArgs};
#[cfg(feature = "self-update")]
use uv_cli::{SelfCommand, SelfNamespace, SelfUninstallArgs, SelfUpdateArgs};
use uv_fs::{Simplified, CWD};
use uv_requirements::RequirementsSource;
use uv_scripts::{Pep723Error, Pep723Item, Pep723Metadata, Pep723Script};
Expand Down Expand Up @@ -913,6 +910,7 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
token,
}),
}) => commands::self_update(target_version, token, printer).await,
#[cfg(feature = "self-update")]
Commands::Self_(SelfNamespace {
command: SelfCommand::Uninstall(SelfUninstallArgs { remove_data }),
}) => commands::self_uninstall(&cache, printer, remove_data),
Expand Down

0 comments on commit 51a95cb

Please sign in to comment.