huggingface-hub 0.26.2__py3-none-any.whl → 0.26.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of huggingface-hub might be problematic. Click here for more details.

@@ -46,7 +46,7 @@ import sys
46
46
  from typing import TYPE_CHECKING
47
47
 
48
48
 
49
- __version__ = "0.26.2"
49
+ __version__ = "0.26.3"
50
50
 
51
51
  # Alphabetical order of definitions is ensured in tests
52
52
  # WARNING: any comment added in this dictionary definition will be lost when
@@ -46,15 +46,20 @@ def parse_datetime(date_string: str) -> datetime:
46
46
  If `date_string` cannot be parsed.
47
47
  """
48
48
  try:
49
- # Datetime ending with a Z means "UTC". We parse the date and then explicitly
50
- # set the timezone to UTC.
51
- # See https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)
52
- # Taken from https://stackoverflow.com/a/3168394.
53
- if len(date_string) == 30:
54
- # Means timezoned-timestamp with nanoseconds precision. We need to truncate the last 3 digits.
55
- date_string = date_string[:-4] + "Z"
56
- dt = datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S.%fZ")
57
- return dt.replace(tzinfo=timezone.utc) # Set explicit timezone
49
+ # Normalize the string to always have 6 digits of fractional seconds
50
+ if date_string.endswith("Z"):
51
+ # Case 1: No decimal point (e.g., "2024-11-16T00:27:02Z")
52
+ if "." not in date_string:
53
+ # No fractional seconds - insert .000000
54
+ date_string = date_string[:-1] + ".000000Z"
55
+ # Case 2: Has decimal point (e.g., "2022-08-19T07:19:38.123456789Z")
56
+ else:
57
+ # Get the fractional and base parts
58
+ base, fraction = date_string[:-1].split(".")
59
+ # fraction[:6] takes first 6 digits and :0<6 pads with zeros if less than 6 digits
60
+ date_string = f"{base}.{fraction[:6]:0<6}Z"
61
+
62
+ return datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=timezone.utc)
58
63
  except ValueError as e:
59
64
  raise ValueError(
60
65
  f"Cannot parse '{date_string}' as a datetime. Date string is expected to"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 0.26.2
3
+ Version: 0.26.3
4
4
  Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
5
  Home-page: https://github.com/huggingface/huggingface_hub
6
6
  Author: Hugging Face, Inc.
@@ -1,4 +1,4 @@
1
- huggingface_hub/__init__.py,sha256=sIbMsG9xCYwthM45i9PiivGupn4uPd1AgjAsOERbH18,35993
1
+ huggingface_hub/__init__.py,sha256=TvADZbi2Jw5oeg_Mu-yZ7xo66rN_x7RTs1F6c9gt2aI,35993
2
2
  huggingface_hub/_commit_api.py,sha256=Y9eTaW4bYzxtrZsSniVtfeAuFafqx8x1ofMI5es8hvM,31057
3
3
  huggingface_hub/_commit_scheduler.py,sha256=nlJS_vnLb8i92NLrRwJX8Mg9QZ7f3kfLbLlQuEd5YjU,13647
4
4
  huggingface_hub/_inference_endpoints.py,sha256=wzjD8P68VpUDHzIDbXzFXsM2Y-aNVSAap7BXsZFuthk,16750
@@ -87,7 +87,7 @@ huggingface_hub/utils/_auth.py,sha256=-9p3SSOtWKMMCDKlsM_-ebsIGX0sSgKTSnC-_O4kTx
87
87
  huggingface_hub/utils/_cache_assets.py,sha256=kai77HPQMfYpROouMBQCr_gdBCaeTm996Sqj0dExbNg,5728
88
88
  huggingface_hub/utils/_cache_manager.py,sha256=kfuZDQy6FbWXrwKqp5sAJHte1BooTYKnjyuS0kbR6Eo,34495
89
89
  huggingface_hub/utils/_chunk_utils.py,sha256=kRCaj5228_vKcyLWspd8Xq01f17Jz6ds5Sr9ed5d_RU,2130
90
- huggingface_hub/utils/_datetime.py,sha256=DHnktKm1taeOe2XCBgNU4pVck5d70qu8FJ7nACD6C3k,2554
90
+ huggingface_hub/utils/_datetime.py,sha256=kCS5jaKV25kOncX1xujbXsz5iDLcjLcLw85semGNzxQ,2770
91
91
  huggingface_hub/utils/_deprecation.py,sha256=HZhRGGUX_QMKBBBwHHlffLtmCSK01TOpeXHefZbPfwI,4872
92
92
  huggingface_hub/utils/_experimental.py,sha256=crCPH6k6-11wwH2GZuZzZzZbjUotay49ywV1SSJhMHM,2395
93
93
  huggingface_hub/utils/_fixes.py,sha256=C-feEQOZtXGHP4E2Qlg2VyxWSZhdCVmd0_B6zgiPcWA,4045
@@ -109,9 +109,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-
109
109
  huggingface_hub/utils/logging.py,sha256=Cp03s0uEl3kDM9XHQW9a8GAoExODQ-e7kEtgMt-_To8,4728
110
110
  huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
111
111
  huggingface_hub/utils/tqdm.py,sha256=jQiVYwRG78HK4_54u0vTtz6Kt9IMGiHy3ixbIn3h2TU,9368
112
- huggingface_hub-0.26.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
113
- huggingface_hub-0.26.2.dist-info/METADATA,sha256=h9cDU1nJ7L3J4CI7nXZp4AOBb1JxgM58DU99ilZb1RY,13091
114
- huggingface_hub-0.26.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
115
- huggingface_hub-0.26.2.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
116
- huggingface_hub-0.26.2.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
117
- huggingface_hub-0.26.2.dist-info/RECORD,,
112
+ huggingface_hub-0.26.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
113
+ huggingface_hub-0.26.3.dist-info/METADATA,sha256=xeabjkgCLGRol8NXGS0ftagVPKUfTaq2iaKfd_k5P9M,13091
114
+ huggingface_hub-0.26.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
115
+ huggingface_hub-0.26.3.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
116
+ huggingface_hub-0.26.3.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
117
+ huggingface_hub-0.26.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5