Fix deserialization of index response when requires_python field is missing (#708)

Closes https://github.com/astral-sh/puffin/issues/707
This commit is contained in:
Zanie Blue 2023-12-20 04:53:48 -06:00 committed by GitHub
parent 4e437ba7e5
commit 665a59dae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ pub struct File {
pub hashes: Hashes,
/// Note: Deserialized with [`LenientVersionSpecifiers`] since there are a number of invalid
/// versions on pypi
#[serde(deserialize_with = "deserialize_version_specifiers_lenient")]
#[serde(default, deserialize_with = "deserialize_version_specifiers_lenient")]
pub requires_python: Option<VersionSpecifiers>,
pub size: Option<usize>,
pub upload_time: Option<DateTime<Utc>>,