mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
Migrate interpreter query to custom caching (#508)
This removes the last usage of cacache by replacing it with a custom,
flat json caching keyed by the digest of the executable path.

A step towards #478. I've made `CachedByTimestamp<T>` generic over `T`
but intentionally not moved it to `puffin-cache` yet.
This commit is contained in:
parent
5435d44756
commit
d89fbeb642
13 changed files with 88 additions and 156 deletions
|
@ -39,7 +39,6 @@ requirements-txt = { path = "../requirements-txt" }
|
|||
anstream = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
bitflags = { workspace = true }
|
||||
cacache = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
colored = { workspace = true }
|
||||
|
|
|
@ -8,7 +8,7 @@ use miette::{Diagnostic, IntoDiagnostic};
|
|||
use thiserror::Error;
|
||||
|
||||
use platform_host::Platform;
|
||||
use puffin_cache::{Cache, CacheBucket};
|
||||
use puffin_cache::Cache;
|
||||
use puffin_interpreter::Interpreter;
|
||||
|
||||
use crate::commands::ExitStatus;
|
||||
|
@ -77,12 +77,8 @@ fn venv_impl(
|
|||
};
|
||||
|
||||
let platform = Platform::current().into_diagnostic()?;
|
||||
let interpreter_info = Interpreter::query(
|
||||
&base_python,
|
||||
platform,
|
||||
&cache.bucket(CacheBucket::Interpreter),
|
||||
)
|
||||
.map_err(VenvError::InterpreterError)?;
|
||||
let interpreter_info =
|
||||
Interpreter::query(&base_python, platform, cache).map_err(VenvError::InterpreterError)?;
|
||||
|
||||
writeln!(
|
||||
printer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue