Avoid fatal error when searching for egg-info with missing directory (#7498)

## Summary

Closes https://github.com/astral-sh/uv/issues/7485.

## Test Plan

```
$ cargo run cache clean
$ cargo run venv
$ cargo run pip install django-allauth==0.51.0
$ cargo run venv
$ cargo run pip install django-allauth==0.51.0
```
This commit is contained in:
Charlie Marsh 2024-09-18 09:33:11 -04:00 committed by GitHub
parent f942561158
commit 97ae811b86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1899,6 +1899,9 @@ async fn read_egg_info(
let egg_info = match find_egg_info(directory.as_ref()) {
Ok(Some(path)) => path,
Ok(None) => return Err(Error::MissingEggInfo),
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
return Err(Error::MissingEggInfo)
}
Err(err) => return Err(Error::CacheRead(err)),
};