checkpointer 2.10.0__tar.gz → 2.10.1__tar.gz

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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: checkpointer
3
- Version: 2.10.0
4
- Summary: A Python library for memoizing function results with support for multiple storage backends, async runtimes, and automatic cache invalidation
3
+ Version: 2.10.1
4
+ Summary: checkpointer adds code-aware caching to Python functions, maintaining correctness and speeding up execution as your code changes.
5
5
  Project-URL: Repository, https://github.com/Reddan/checkpointer.git
6
6
  Author: Hampus Hallman
7
7
  License: Copyright 2018-2025 Hampus Hallman
@@ -116,7 +116,7 @@ class CachedFunction(Generic[Fn]):
116
116
  return str(ObjectHash(hash_params, digest_size=16))
117
117
 
118
118
  async def _resolve_awaitable(self, call_id: str, awaitable: Awaitable):
119
- return await self.storage.store(call_id, AwaitableValue(await awaitable))
119
+ return self.storage.store(call_id, AwaitableValue(await awaitable)).value
120
120
 
121
121
  def _call(self: CachedFunction[Callable[P, R]], args: tuple, kw: dict, rerun=False) -> R:
122
122
  full_args = self.bound + args
@@ -202,5 +202,7 @@ class ObjectHash:
202
202
  return self.header("slots").update(slots)
203
203
  if d := getattr(obj, "__dict__", {}):
204
204
  return self.header("dict").update(d)
205
+ if isinstance(obj, Iterable):
206
+ return self._update_iterator(obj)
205
207
  repr_str = re.sub(r"\s+(at\s+0x[0-9a-fA-F]+)(>)$", r"\2", repr(obj))
206
208
  return self.header("repr").update(repr_str)
@@ -1,8 +1,6 @@
1
1
  import asyncio
2
2
  import pytest
3
- from riprint import riprint as print
4
- from . import checkpoint
5
- from .checkpoint import CheckpointError
3
+ from . import CheckpointError, checkpoint
6
4
  from .utils import AttrDict
7
5
 
8
6
  def global_multiply(a: int, b: int) -> int:
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "checkpointer"
3
- version = "2.10.0"
3
+ version = "2.10.1"
4
4
  requires-python = ">=3.11"
5
5
  dependencies = []
6
6
  authors = [
7
7
  {name = "Hampus Hallman"}
8
8
  ]
9
- description = "A Python library for memoizing function results with support for multiple storage backends, async runtimes, and automatic cache invalidation"
9
+ description = "checkpointer adds code-aware caching to Python functions, maintaining correctness and speeding up execution as your code changes."
10
10
  readme = "README.md"
11
11
  license = {file = "LICENSE"}
12
12
  classifiers = [
@@ -21,11 +21,10 @@ Repository = "https://github.com/Reddan/checkpointer.git"
21
21
  [dependency-groups]
22
22
  dev = [
23
23
  "numpy>=2.2.1",
24
- "omg>=1.2.3",
24
+ "omg>=1.3.4",
25
25
  "poethepoet>=0.30.0",
26
26
  "pytest>=8.3.5",
27
27
  "pytest-asyncio>=0.26.0",
28
- "relib>=1.0.8",
29
28
  "torch>=2.5.1",
30
29
  ]
31
30
 
@@ -8,7 +8,7 @@ resolution-markers = [
8
8
 
9
9
  [[package]]
10
10
  name = "checkpointer"
11
- version = "2.10.0"
11
+ version = "2.10.1"
12
12
  source = { editable = "." }
13
13
 
14
14
  [package.dev-dependencies]
@@ -18,8 +18,6 @@ dev = [
18
18
  { name = "poethepoet" },
19
19
  { name = "pytest" },
20
20
  { name = "pytest-asyncio" },
21
- { name = "relib", version = "1.0.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
22
- { name = "relib", version = "1.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
23
21
  { name = "torch" },
24
22
  ]
25
23
 
@@ -28,11 +26,10 @@ dev = [
28
26
  [package.metadata.requires-dev]
29
27
  dev = [
30
28
  { name = "numpy", specifier = ">=2.2.1" },
31
- { name = "omg", specifier = ">=1.2.3" },
29
+ { name = "omg", specifier = ">=1.3.4" },
32
30
  { name = "poethepoet", specifier = ">=0.30.0" },
33
31
  { name = "pytest", specifier = ">=8.3.5" },
34
32
  { name = "pytest-asyncio", specifier = ">=0.26.0" },
35
- { name = "relib", specifier = ">=1.0.8" },
36
33
  { name = "torch", specifier = ">=2.5.1" },
37
34
  ]
38
35
 
@@ -310,16 +307,14 @@ wheels = [
310
307
 
311
308
  [[package]]
312
309
  name = "omg"
313
- version = "1.2.3"
310
+ version = "1.3.4"
314
311
  source = { registry = "https://pypi.org/simple" }
315
312
  dependencies = [
316
- { name = "riprint" },
317
- { name = "termcolor" },
318
313
  { name = "watchdog" },
319
314
  ]
320
- sdist = { url = "https://files.pythonhosted.org/packages/84/b6/91651c750cb555ac3abd71485982bebe41a373ce0e688a9559cd2823cffe/omg-1.2.3.tar.gz", hash = "sha256:7f2009359ed6a50c51d2b911857e90b3f144903e800008464814c7eabc5191b9", size = 11409 }
315
+ sdist = { url = "https://files.pythonhosted.org/packages/0b/12/9037613ad41ad71f6342e18a7fdf8f19826dfe61555c45541d87045cd084/omg-1.3.4.tar.gz", hash = "sha256:31e5fd82c2d2fdc53e944b1cb9fb7f630919f9441b8822fb5ae108962fabb49b", size = 14193 }
321
316
  wheels = [
322
- { url = "https://files.pythonhosted.org/packages/bb/21/cf8b7a549506e5fbc1c2eed228ccab8774a1d5da5939c4593ac0968ec654/omg-1.2.3-py3-none-any.whl", hash = "sha256:110b242021fffc200eda3be86f09f8010a3eef1139346c6395cc24082f191a13", size = 4428 },
317
+ { url = "https://files.pythonhosted.org/packages/fd/88/4a4e1cc054f141744a60e17d76c8ea1aea7af7e125cae0713d9b0d5ec12f/omg-1.3.4-py3-none-any.whl", hash = "sha256:449e00d341b63afa23633f47cd751a1874ad2545162e5f9abbdd115525fd7a71", size = 7926 },
323
318
  ]
324
319
 
325
320
  [[package]]
@@ -424,45 +419,6 @@ wheels = [
424
419
  { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446 },
425
420
  ]
426
421
 
427
- [[package]]
428
- name = "relib"
429
- version = "1.0.8"
430
- source = { registry = "https://pypi.org/simple" }
431
- resolution-markers = [
432
- "python_full_version < '3.12'",
433
- ]
434
- dependencies = [
435
- { name = "numpy", marker = "python_full_version < '3.12'" },
436
- { name = "termcolor", marker = "python_full_version < '3.12'" },
437
- ]
438
- wheels = [
439
- { url = "https://files.pythonhosted.org/packages/cc/2e/0ad818236f0d451b378fed6c985798f27e94140e567c76876f7c0823af4b/relib-1.0.8-py3-none-any.whl", hash = "sha256:4c99fb9da7c1e40cbdc088a0d2f0000ce16caf16674dc1c5a8bff9e68664d315", size = 8907 },
440
- ]
441
-
442
- [[package]]
443
- name = "relib"
444
- version = "1.2.1"
445
- source = { registry = "https://pypi.org/simple" }
446
- resolution-markers = [
447
- "python_full_version >= '3.12'",
448
- ]
449
- sdist = { url = "https://files.pythonhosted.org/packages/21/0e/eeac07953e649a92c8c92d646d3c5706624e9254f5f5d35837cf4a7132d9/relib-1.2.1.tar.gz", hash = "sha256:1c12ad491e5adf7e1f961fa26a2c08a5c1c741508ae487d9d4aff125a5433526", size = 6163 }
450
- wheels = [
451
- { url = "https://files.pythonhosted.org/packages/af/d3/6baacf316516e809c6e14f83a1b3de69d3b06b067066d5ae361fb0399f33/relib-1.2.1-py3-none-any.whl", hash = "sha256:587883d7cdd479b8518619b25b871ea39395658407442a707e71501a5c67a737", size = 7879 },
452
- ]
453
-
454
- [[package]]
455
- name = "riprint"
456
- version = "1.0.5"
457
- source = { registry = "https://pypi.org/simple" }
458
- dependencies = [
459
- { name = "numpy" },
460
- { name = "termcolor" },
461
- ]
462
- wheels = [
463
- { url = "https://files.pythonhosted.org/packages/30/34/6206ab33d8244417f52d5e623d42180132d951b8301a70fed1b3a033cd83/riprint-1.0.5-py3-none-any.whl", hash = "sha256:9796e410e27b3f24397507f981edad0d1c1d99f61df1c60eb5d29033887dcbdf", size = 2861 },
464
- ]
465
-
466
422
  [[package]]
467
423
  name = "setuptools"
468
424
  version = "75.6.0"
@@ -484,15 +440,6 @@ wheels = [
484
440
  { url = "https://files.pythonhosted.org/packages/b2/fe/81695a1aa331a842b582453b605175f419fe8540355886031328089d840a/sympy-1.13.1-py3-none-any.whl", hash = "sha256:db36cdc64bf61b9b24578b6f7bab1ecdd2452cf008f34faa33776680c26d66f8", size = 6189177 },
485
441
  ]
486
442
 
487
- [[package]]
488
- name = "termcolor"
489
- version = "2.5.0"
490
- source = { registry = "https://pypi.org/simple" }
491
- sdist = { url = "https://files.pythonhosted.org/packages/37/72/88311445fd44c455c7d553e61f95412cf89054308a1aa2434ab835075fc5/termcolor-2.5.0.tar.gz", hash = "sha256:998d8d27da6d48442e8e1f016119076b690d962507531df4890fcd2db2ef8a6f", size = 13057 }
492
- wheels = [
493
- { url = "https://files.pythonhosted.org/packages/7f/be/df630c387a0a054815d60be6a97eb4e8f17385d5d6fe660e1c02750062b4/termcolor-2.5.0-py3-none-any.whl", hash = "sha256:37b17b5fc1e604945c2642c872a3764b5d547a48009871aea3edd3afa180afb8", size = 7755 },
494
- ]
495
-
496
443
  [[package]]
497
444
  name = "torch"
498
445
  version = "2.5.1"
File without changes
File without changes
File without changes