mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Preparing for #235, some refactoring to `puffin_interpreter`. * Added a dedicated error type instead of anyhow * `InterpreterInfo` -> `Interpreter` * `detect_virtual_env` now returns an option so it can be chained for #235
This commit is contained in:
parent
9d35128840
commit
1c0e03f807
19 changed files with 201 additions and 163 deletions
|
@ -46,7 +46,7 @@ pub(crate) async fn build(args: BuildArgs) -> Result<PathBuf> {
|
|||
let build_dispatch = BuildDispatch::new(
|
||||
RegistryClientBuilder::new(cache_dir.path().clone()).build(),
|
||||
cache_dir.path().clone(),
|
||||
venv.interpreter_info().clone(),
|
||||
venv.interpreter().clone(),
|
||||
fs::canonicalize(venv.python_executable())?,
|
||||
false,
|
||||
);
|
||||
|
|
|
@ -50,15 +50,15 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
|
|||
let build_dispatch = BuildDispatch::new(
|
||||
client.clone(),
|
||||
cache_dir.path().clone(),
|
||||
venv.interpreter_info().clone(),
|
||||
venv.interpreter().clone(),
|
||||
fs::canonicalize(venv.python_executable())?,
|
||||
args.no_build,
|
||||
);
|
||||
|
||||
// Copied from `BuildDispatch`
|
||||
let tags = Tags::from_env(
|
||||
venv.interpreter_info().platform(),
|
||||
venv.interpreter_info().simple_version(),
|
||||
venv.interpreter().platform(),
|
||||
venv.interpreter().simple_version(),
|
||||
)?;
|
||||
let resolver = Resolver::new(
|
||||
Manifest::new(
|
||||
|
@ -68,7 +68,7 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
|
|||
None,
|
||||
),
|
||||
ResolutionOptions::default(),
|
||||
venv.interpreter_info().markers(),
|
||||
venv.interpreter().markers(),
|
||||
&tags,
|
||||
&client,
|
||||
&build_dispatch,
|
||||
|
|
|
@ -52,7 +52,7 @@ pub(crate) async fn resolve_many(args: ResolveManyArgs) -> Result<()> {
|
|||
let build_dispatch = BuildDispatch::new(
|
||||
RegistryClientBuilder::new(cache_dir.path().clone()).build(),
|
||||
cache_dir.path().clone(),
|
||||
venv.interpreter_info().clone(),
|
||||
venv.interpreter().clone(),
|
||||
fs::canonicalize(venv.python_executable())?,
|
||||
args.no_build,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue