mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Fix some ephemeral-to-cached comments (#4837)
This commit is contained in:
parent
f450b45780
commit
77b1bb77b5
2 changed files with 7 additions and 8 deletions
|
@ -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<CachedEnvironment> 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()
|
||||
}
|
||||
|
|
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue