From 77b1bb77b5e9ff7e2fff1ff9ce6fc623b52ad30d Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 5 Jul 2024 17:11:19 -0400 Subject: [PATCH] Fix some ephemeral-to-cached comments (#4837) --- crates/uv/src/commands/project/environment.rs | 13 ++++++------- crates/uv/src/commands/tool/run.rs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/uv/src/commands/project/environment.rs b/crates/uv/src/commands/project/environment.rs index 3487680a9..f2b9c1f91 100644 --- a/crates/uv/src/commands/project/environment.rs +++ b/crates/uv/src/commands/project/environment.rs @@ -15,13 +15,13 @@ use crate::commands::SharedState; use crate::printer::Printer; use crate::settings::ResolverInstallerSettings; -/// An ephemeral [`PythonEnvironment`] stored in the cache. +/// A [`PythonEnvironment`] stored in the cache. #[derive(Debug)] pub(crate) struct CachedEnvironment(PythonEnvironment); impl From for PythonEnvironment { - fn from(ephemeral: CachedEnvironment) -> Self { - ephemeral.0 + fn from(environment: CachedEnvironment) -> Self { + environment.0 } } @@ -100,7 +100,7 @@ impl CachedEnvironment { let ok = cache_entry.path().join(".ok"); if ok.is_file() { debug!( - "Found existing ephemeral environment at: `{}`", + "Found existing cached environment at: `{}`", cache_entry.path().display() ); return Ok(Self(PythonEnvironment::from_root( @@ -110,7 +110,7 @@ impl CachedEnvironment { } debug!( - "Creating ephemeral environment at: `{}`", + "Creating cached environment at: `{}`", cache_entry.path().display() ); @@ -122,7 +122,6 @@ impl CachedEnvironment { false, )?; - // Install the ephemeral requirements. // TODO(charlie): Rather than passing all the arguments to `sync_environment`, return a // struct that lets us "continue" from `resolve_environment`. let venv = sync_environment( @@ -145,7 +144,7 @@ impl CachedEnvironment { Ok(Self(venv)) } - /// Convert the [`EphemeralEnvironment`] into an [`Interpreter`]. + /// Convert the [`CachedEnvironment`] into an [`Interpreter`]. pub(crate) fn into_interpreter(self) -> Interpreter { self.0.into_interpreter() } diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index e075db884..57c96d971 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -134,7 +134,7 @@ pub(crate) async fn run( /// Get or create a [`PythonEnvironment`] in which to run the specified tools. /// /// If the target tool is already installed in a compatible environment, returns that -/// [`PythonEnvironment`]. Otherwise, creates an ephemeral environment. +/// [`PythonEnvironment`]. Otherwise, gets or creates a [`CachedEnvironment`]. async fn get_or_create_environment( from: &str, with: &[String],