mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
impl TryFrom<&VersionSpecifiers> for PubGrubSpecifier
(#4010)
Add a missing utility conversion method from PEP 440 versions specifiers to a pubgrub range.
This commit is contained in:
parent
40e0dddd00
commit
36f7fa3917
3 changed files with 21 additions and 15 deletions
|
@ -7,7 +7,6 @@ use std::thread;
|
|||
|
||||
use dashmap::DashMap;
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt};
|
||||
use itertools::Itertools;
|
||||
use pubgrub::error::PubGrubError;
|
||||
use pubgrub::range::Range;
|
||||
use pubgrub::solver::{Incompatibility, State};
|
||||
|
@ -412,12 +411,8 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
)),
|
||||
) = reason
|
||||
{
|
||||
let python_version = requires_python
|
||||
.iter()
|
||||
.map(PubGrubSpecifier::try_from)
|
||||
.fold_ok(Range::full(), |range, specifier| {
|
||||
range.intersection(&specifier.into())
|
||||
})?;
|
||||
let python_version: Range<Version> =
|
||||
PubGrubSpecifier::try_from(&requires_python)?.into();
|
||||
|
||||
let package = &state.next;
|
||||
state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue