Track yanked versions as incompatibilities (#1290)

Moves yanked version filtering from `VersionMap::from_metadata` to the
resolver and tracks it as a PubGrub unavailable incompatibility so
yanked versions are reflected in error messages.

e.g. before
```
╰─▶ Because only albatross<=0.1.0 is available and you require albatross>0.1.0, 
       we can conclude that the requirements are unsatisfiable.
```

after

```
╰─▶ Because only the following versions of albatross are available:
            albatross<=0.1.0
            albatross==1.0.0
      and albatross==1.0.0 is unusable because it was yanked, we can conclude that albatross>0.1.0 cannot be used.
      And because you require albatross>0.1.0, we can conclude that the requirements are unsatisfiable.
```
This commit is contained in:
Zanie Blue 2024-02-12 22:01:17 -06:00 committed by GitHub
parent d8619f668a
commit b5dd8b7de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 263 additions and 138 deletions

View file

@ -108,6 +108,12 @@ impl Yanked {
}
}
impl Default for Yanked {
fn default() -> Self {
Self::Bool(false)
}
}
/// A dictionary mapping a hash name to a hex encoded digest of the file.
///
/// PEP 691 says multiple hashes can be included and the interpretation is left to the client, we