mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Narrow requires-python
requirement in resolver forks (#4707)
## Summary Given: ```text numpy >=1.26 ; python_version >= '3.9' numpy <1.26 ; python_version < '3.9' ``` When resolving for Python 3.8, we need to narrow the `requires-python` requirement in the top branch of the fork, because `numpy >=1.26` all require Python 3.9 or later -- but we know (in that branch) that we only need to _solve_ for Python 3.9 or later. Closes https://github.com/astral-sh/uv/issues/4669.
This commit is contained in:
parent
89b3324ae1
commit
d9f389a58d
9 changed files with 251 additions and 58 deletions
|
@ -436,7 +436,7 @@ impl VersionSpecifier {
|
|||
}
|
||||
|
||||
/// Returns a version specifier representing the given lower bound.
|
||||
fn from_lower_bound(bound: &Bound<Version>) -> Option<VersionSpecifier> {
|
||||
pub fn from_lower_bound(bound: &Bound<Version>) -> Option<VersionSpecifier> {
|
||||
match bound {
|
||||
Bound::Included(version) => Some(
|
||||
VersionSpecifier::from_version(Operator::GreaterThanEqual, version.clone())
|
||||
|
@ -450,7 +450,7 @@ impl VersionSpecifier {
|
|||
}
|
||||
|
||||
/// Returns a version specifier representing the given upper bound.
|
||||
fn from_upper_bound(bound: &Bound<Version>) -> Option<VersionSpecifier> {
|
||||
pub fn from_upper_bound(bound: &Bound<Version>) -> Option<VersionSpecifier> {
|
||||
match bound {
|
||||
Bound::Included(version) => Some(
|
||||
VersionSpecifier::from_version(Operator::LessThanEqual, version.clone()).unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue