Warn when there are missing bounds on transitive deps in lowest (#5953)

Warn when there are missing bounds on transitive dependencies with
`--resolution lowest`.

Implemented as a lazy resolution graph check. Dev deps are odd because
they are missing the edge from the root that extras have (they are
currently orphans in the resolution graph), but this is more complex to
solve properly because we can put dev dep information in a `Requirement`
so i special cased them here.

Closes #2797
Should help with #1718

---------

Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
This commit is contained in:
konsti 2024-08-09 19:55:17 +02:00 committed by GitHub
parent ffd18cc75d
commit a129cf7d7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 154 additions and 2 deletions

View file

@ -466,6 +466,17 @@ impl RequirementSource {
pub fn is_editable(&self) -> bool {
matches!(self, Self::Directory { editable: true, .. })
}
/// If the source is the registry, return the version specifiers
pub fn version_specifiers(&self) -> Option<&VersionSpecifiers> {
match self {
RequirementSource::Registry { specifier, .. } => Some(specifier),
RequirementSource::Url { .. }
| RequirementSource::Git { .. }
| RequirementSource::Path { .. }
| RequirementSource::Directory { .. } => None,
}
}
}
impl Display for RequirementSource {