33import re
44import sys
55from dataclasses import dataclass
6+ from datetime import datetime
67from pathlib import Path
78from typing import (
89 TYPE_CHECKING ,
@@ -271,7 +272,7 @@ class PackageArchive:
271272 url : Optional [str ]
272273 path : Optional [str ]
273274 size : Optional [int ]
274- # (not supported) upload_time: Optional[datetime]
275+ upload_time : Optional [datetime ]
275276 hashes : Dict [str , str ]
276277 subdirectory : Optional [str ]
277278
@@ -285,6 +286,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
285286 url = _get (d , str , "url" ),
286287 path = _get (d , str , "path" ),
287288 size = _get (d , int , "size" ),
289+ upload_time = _get (d , datetime , "upload-time" ),
288290 hashes = _get_required (d , dict , "hashes" ),
289291 subdirectory = _get (d , str , "subdirectory" ),
290292 )
@@ -293,7 +295,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
293295@dataclass
294296class PackageSdist :
295297 name : str
296- # (not supported) upload_time: Optional[datetime]
298+ upload_time : Optional [datetime ]
297299 url : Optional [str ]
298300 path : Optional [str ]
299301 size : Optional [int ]
@@ -307,6 +309,7 @@ def __post_init__(self) -> None:
307309 def from_dict (cls , d : Dict [str , Any ]) -> "Self" :
308310 return cls (
309311 name = _get_required (d , str , "name" ),
312+ upload_time = _get (d , datetime , "upload-time" ),
310313 url = _get (d , str , "url" ),
311314 path = _get (d , str , "path" ),
312315 size = _get (d , int , "size" ),
@@ -317,7 +320,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
317320@dataclass
318321class PackageWheel :
319322 name : str
320- # (not supported) upload_time: Optional[datetime]
323+ upload_time : Optional [datetime ]
321324 url : Optional [str ]
322325 path : Optional [str ]
323326 size : Optional [int ]
@@ -331,6 +334,7 @@ def __post_init__(self) -> None:
331334 def from_dict (cls , d : Dict [str , Any ]) -> "Self" :
332335 wheel = cls (
333336 name = _get_required (d , str , "name" ),
337+ upload_time = _get (d , datetime , "upload-time" ),
334338 url = _get (d , str , "url" ),
335339 path = _get (d , str , "path" ),
336340 size = _get (d , int , "size" ),
0 commit comments