mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-19 03:28:42 +00:00
Filter out files with invalid requires python specifiers (#775)
Instead of trying to fixup _all_ the invalid version specifiers on pypi and elsewhere, this filters out distributions with invalid `requires-python` version specifiers that even `LenientVersionSpecifiers` couldn't parse, as opposed to failing entirely, which we currently do. I would be nicer to model through an invalid distribution pubgrub type, together with e.g. source dists with an unknown extension, so that the version itself still shows up in the error trace. At the same time, we reduce the log level for fixups from warning to trace, as they are not actionable for the user.
This commit is contained in:
parent
64da1f0306
commit
b1edecdf1f
6 changed files with 89 additions and 23 deletions
|
|
@ -256,7 +256,7 @@ impl<'a> Candidate<'a> {
|
|||
self.file.install()
|
||||
}
|
||||
|
||||
/// If the candidate doesn't the given requirement, return the version specifiers.
|
||||
/// If the candidate doesn't match the given requirement, return the version specifiers.
|
||||
pub(crate) fn validate(&self, requirement: &PythonRequirement) -> Option<&VersionSpecifiers> {
|
||||
// Validate against the _installed_ file. It's fine if the _resolved_ file is incompatible,
|
||||
// since it could be an incompatible wheel. (If the resolved file is an incompatible source
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue