mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-24 13:43:45 +00:00
uv: use ResolverEnvironment instead of ResolverMarkers
This updates the surrounding code to use the new ResolverEnvironment type. In some cases, this simplifies caller code by removing case analysis. There *shouldn't* be any behavior changes here. Some test snapshots were updated to account for some minor tweaks to error messages. I didn't split this up into separate commits because it would have been too difficult/costly.
This commit is contained in:
parent
44c9ef6aea
commit
acaed763b7
42 changed files with 416 additions and 600 deletions
|
@ -30,7 +30,7 @@ use uv_pypi_types::Requirement;
|
|||
use uv_python::{Interpreter, PythonEnvironment};
|
||||
use uv_resolver::{
|
||||
ExcludeNewer, FlatIndex, Flexibility, InMemoryIndex, Manifest, OptionsBuilder,
|
||||
PythonRequirement, Resolver, ResolverMarkers,
|
||||
PythonRequirement, Resolver, ResolverEnvironment,
|
||||
};
|
||||
use uv_types::{BuildContext, BuildIsolation, EmptyInstalledPackages, HashStrategy, InFlight};
|
||||
|
||||
|
@ -174,7 +174,7 @@ impl<'a> BuildContext for BuildDispatch<'a> {
|
|||
|
||||
async fn resolve<'data>(&'data self, requirements: &'data [Requirement]) -> Result<Resolution> {
|
||||
let python_requirement = PythonRequirement::from_interpreter(self.interpreter);
|
||||
let markers = self.interpreter.resolver_markers();
|
||||
let marker_env = self.interpreter.resolver_marker_environment();
|
||||
let tags = self.interpreter.tags()?;
|
||||
|
||||
let resolver = Resolver::new(
|
||||
|
@ -185,7 +185,7 @@ impl<'a> BuildContext for BuildDispatch<'a> {
|
|||
.flexibility(Flexibility::Fixed)
|
||||
.build(),
|
||||
&python_requirement,
|
||||
ResolverMarkers::specific_environment(markers),
|
||||
ResolverEnvironment::specific(marker_env),
|
||||
Some(tags),
|
||||
self.flat_index,
|
||||
self.index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue