3
3
import re
4
4
import sys
5
5
from dataclasses import dataclass
6
+ from datetime import datetime
6
7
from pathlib import Path
7
8
from typing import (
8
9
TYPE_CHECKING ,
@@ -271,7 +272,7 @@ class PackageArchive:
271
272
url : Optional [str ]
272
273
path : Optional [str ]
273
274
size : Optional [int ]
274
- # (not supported) upload_time: Optional[datetime]
275
+ upload_time : Optional [datetime ]
275
276
hashes : Dict [str , str ]
276
277
subdirectory : Optional [str ]
277
278
@@ -285,6 +286,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
285
286
url = _get (d , str , "url" ),
286
287
path = _get (d , str , "path" ),
287
288
size = _get (d , int , "size" ),
289
+ upload_time = _get (d , datetime , "upload-time" ),
288
290
hashes = _get_required (d , dict , "hashes" ),
289
291
subdirectory = _get (d , str , "subdirectory" ),
290
292
)
@@ -293,7 +295,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
293
295
@dataclass
294
296
class PackageSdist :
295
297
name : str
296
- # (not supported) upload_time: Optional[datetime]
298
+ upload_time : Optional [datetime ]
297
299
url : Optional [str ]
298
300
path : Optional [str ]
299
301
size : Optional [int ]
@@ -307,6 +309,7 @@ def __post_init__(self) -> None:
307
309
def from_dict (cls , d : Dict [str , Any ]) -> "Self" :
308
310
return cls (
309
311
name = _get_required (d , str , "name" ),
312
+ upload_time = _get (d , datetime , "upload-time" ),
310
313
url = _get (d , str , "url" ),
311
314
path = _get (d , str , "path" ),
312
315
size = _get (d , int , "size" ),
@@ -317,7 +320,7 @@ def from_dict(cls, d: Dict[str, Any]) -> "Self":
317
320
@dataclass
318
321
class PackageWheel :
319
322
name : str
320
- # (not supported) upload_time: Optional[datetime]
323
+ upload_time : Optional [datetime ]
321
324
url : Optional [str ]
322
325
path : Optional [str ]
323
326
size : Optional [int ]
@@ -331,6 +334,7 @@ def __post_init__(self) -> None:
331
334
def from_dict (cls , d : Dict [str , Any ]) -> "Self" :
332
335
wheel = cls (
333
336
name = _get_required (d , str , "name" ),
337
+ upload_time = _get (d , datetime , "upload-time" ),
334
338
url = _get (d , str , "url" ),
335
339
path = _get (d , str , "path" ),
336
340
size = _get (d , int , "size" ),
0 commit comments