From 665a59dae6925e7a09f02e6239f5a5796f5bb6c2 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 20 Dec 2023 04:53:48 -0600 Subject: [PATCH] Fix deserialization of index response when `requires_python` field is missing (#708) Closes https://github.com/astral-sh/puffin/issues/707 --- crates/pypi-types/src/simple_json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pypi-types/src/simple_json.rs b/crates/pypi-types/src/simple_json.rs index 2d6352e13..3aed134dc 100644 --- a/crates/pypi-types/src/simple_json.rs +++ b/crates/pypi-types/src/simple_json.rs @@ -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, pub size: Option, pub upload_time: Option>,