hmr 0.6.1.1__tar.gz → 0.6.1.3__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hmr
3
- Version: 0.6.1.1
3
+ Version: 0.6.1.3
4
4
  Summary: Hot Module Reload for Python
5
5
  Keywords: reactive-programming,reload,signals,hmr
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -20,7 +20,7 @@ description = "Hot Module Reload for Python"
20
20
  dependencies = [
21
21
  "watchfiles>=0.21,<2 ; sys_platform != 'emscripten'",
22
22
  ]
23
- version = "0.6.1.1"
23
+ version = "0.6.1.3"
24
24
 
25
25
  [project.scripts]
26
26
  hmr = "reactivity.hmr:cli"
@@ -84,7 +84,7 @@ class Reactive[K, V](Subscribable, MutableMapping[K, V]):
84
84
  return id(self)
85
85
 
86
86
  def _null(self):
87
- return Signal(self.UNSET, self._check_equality)
87
+ return Signal(self.UNSET, self._check_equality, context=self.context)
88
88
 
89
89
  def __init__(self, initial: Mapping[K, V] | None = None, check_equality=True, *, context: Context | None = None):
90
90
  super().__init__(context=context)
@@ -46,7 +46,7 @@ class NamespaceProxy(Reactive[str, Any]):
46
46
  self.module = module
47
47
 
48
48
  def _null(self):
49
- self.module.load.subscribers.add(signal := Name(self.UNSET, self._check_equality, context=HMR_CONTEXT))
49
+ self.module.load.subscribers.add(signal := Name(self.UNSET, self._check_equality, context=self.context))
50
50
  signal.dependencies.add(self.module.load)
51
51
  return signal
52
52
 
@@ -344,4 +344,4 @@ def cli():
344
344
  reloader.keep_watching_until_interrupt()
345
345
 
346
346
 
347
- __version__ = "0.6.1.1"
347
+ __version__ = "0.6.1.3"
@@ -5,8 +5,8 @@ from inspect import getsource, getsourcefile
5
5
  from pathlib import Path
6
6
  from types import FunctionType
7
7
 
8
- from .. import create_memo
9
- from .core import NamespaceProxy, ReactiveModule
8
+ from ..helpers import Memoized
9
+ from .core import HMR_CONTEXT, NamespaceProxy, ReactiveModule
10
10
  from .hooks import post_reload, pre_reload
11
11
 
12
12
  memos: dict[str, Callable] = {}
@@ -48,14 +48,12 @@ def cache_across_reloads[T](func: Callable[[], T]) -> Callable[[], T]:
48
48
  if source in memos and source in functions_last:
49
49
  return memos[source]
50
50
 
51
- @wraps(func)
52
- @create_memo
53
51
  def wrapper() -> T:
54
52
  return functions[source]()
55
53
 
56
- memos[source] = wrapper
54
+ memos[source] = memo = Memoized(wrapper, context=HMR_CONTEXT)
57
55
 
58
- return wrapper
56
+ return wraps(func)(memo)
59
57
 
60
58
 
61
59
  class DictProxy(UserDict, dict): # type: ignore
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes