mirror of https://github.com/astral-sh/uv
parent
f7b9ca9533
commit
ef068f1c01
|
|
@ -11,7 +11,7 @@ use uv_configuration::{
|
|||
use uv_dispatch::BuildDispatch;
|
||||
use uv_requirements::{ExtrasSpecification, RequirementsSpecification};
|
||||
use uv_resolver::{FlatIndex, InMemoryIndex, OptionsBuilder};
|
||||
use uv_types::{BuildIsolation, HashStrategy, InFlight};
|
||||
use uv_types::{BuildIsolation, EmptyInstalledPackages, HashStrategy, InFlight};
|
||||
use uv_warnings::warn_user;
|
||||
|
||||
use crate::commands::project::discovery::Project;
|
||||
|
|
@ -111,6 +111,7 @@ pub(crate) async fn lock(
|
|||
// Resolve the requirements.
|
||||
let resolution = project::resolve(
|
||||
spec,
|
||||
&EmptyInstalledPackages,
|
||||
&hasher,
|
||||
&interpreter,
|
||||
tags,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ use uv_resolver::{
|
|||
Exclusions, FlatIndex, InMemoryIndex, Manifest, Options, PythonRequirement, ResolutionGraph,
|
||||
Resolver,
|
||||
};
|
||||
use uv_types::{EmptyInstalledPackages, HashStrategy, InFlight};
|
||||
use uv_types::{HashStrategy, InFlight, InstalledPackagesProvider};
|
||||
|
||||
use crate::commands::project::discovery::Project;
|
||||
use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter};
|
||||
|
|
@ -113,8 +113,9 @@ pub(crate) fn init(
|
|||
|
||||
/// Resolve a set of requirements, similar to running `pip compile`.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(crate) async fn resolve(
|
||||
pub(crate) async fn resolve<InstalledPackages: InstalledPackagesProvider>(
|
||||
spec: RequirementsSpecification,
|
||||
installed_packages: &InstalledPackages,
|
||||
hasher: &HashStrategy,
|
||||
interpreter: &Interpreter,
|
||||
tags: &Tags,
|
||||
|
|
@ -135,7 +136,6 @@ pub(crate) async fn resolve(
|
|||
let overrides = Overrides::default();
|
||||
let python_requirement = PythonRequirement::from_marker_environment(interpreter, markers);
|
||||
let editables = Vec::new();
|
||||
let installed_packages = EmptyInstalledPackages;
|
||||
|
||||
// Resolve the requirements from the provided sources.
|
||||
let requirements = {
|
||||
|
|
@ -206,7 +206,7 @@ pub(crate) async fn resolve(
|
|||
index,
|
||||
hasher,
|
||||
build_dispatch,
|
||||
&installed_packages,
|
||||
installed_packages,
|
||||
DistributionDatabase::new(client, build_dispatch, concurrency.downloads),
|
||||
)?
|
||||
.with_reporter(ResolverReporter::from(printer));
|
||||
|
|
|
|||
|
|
@ -292,6 +292,7 @@ async fn update_environment(
|
|||
// Resolve the requirements.
|
||||
let resolution = match project::resolve(
|
||||
spec,
|
||||
&site_packages,
|
||||
&hasher,
|
||||
&interpreter,
|
||||
tags,
|
||||
|
|
@ -316,7 +317,7 @@ async fn update_environment(
|
|||
// Sync the environment.
|
||||
project::install(
|
||||
&resolution,
|
||||
SitePackages::from_executable(&venv)?,
|
||||
site_packages,
|
||||
&no_binary,
|
||||
link_mode,
|
||||
&index_locations,
|
||||
|
|
|
|||
Loading…
Reference in New Issue