hmr 0.4.1.1__py3-none-any.whl → 0.4.1.2__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.
- {hmr-0.4.1.1.dist-info → hmr-0.4.1.2.dist-info}/METADATA +1 -1
- {hmr-0.4.1.1.dist-info → hmr-0.4.1.2.dist-info}/RECORD +6 -6
- reactivity/helpers.py +4 -2
- reactivity/hmr/core.py +9 -10
- {hmr-0.4.1.1.dist-info → hmr-0.4.1.2.dist-info}/WHEEL +0 -0
- {hmr-0.4.1.1.dist-info → hmr-0.4.1.2.dist-info}/entry_points.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
|
-
hmr-0.4.1.
|
2
|
-
hmr-0.4.1.
|
3
|
-
hmr-0.4.1.
|
1
|
+
hmr-0.4.1.2.dist-info/METADATA,sha256=VdPRpEn_Abq_5nmi3GZr9vGKNb-f2IhZSEfOalHdPhw,260
|
2
|
+
hmr-0.4.1.2.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
hmr-0.4.1.2.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
|
4
4
|
reactivity/__init__.py,sha256=pX-RUzkezCC1x4eOWGxNhXbwrbvBLP_3pQuZr9eZz1Y,300
|
5
5
|
reactivity/functional.py,sha256=U06vshcVhZ0sb218gcmHtEhfgTNAGtQ7zyvPz2w5qKM,1292
|
6
|
-
reactivity/helpers.py,sha256=
|
6
|
+
reactivity/helpers.py,sha256=DVwhsEEs9aRcsyMqTdF5eRG-Z0zVhS7AbmR-Y-PXCkg,5321
|
7
7
|
reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
|
8
8
|
reactivity/hmr/__main__.py,sha256=uIcyjR5gMFIXH_3hS0B3SD00RirVf7GIct-uItx675o,64
|
9
9
|
reactivity/hmr/api.py,sha256=Esb1fYiBW0SLxQ0MPXby25ZgIIZhIp-M3b2KiqpffmU,2094
|
10
|
-
reactivity/hmr/core.py,sha256=
|
10
|
+
reactivity/hmr/core.py,sha256=3FbPolLqcbbNvByAeFviyVsddki36n_Qq0310FqX3oE,11500
|
11
11
|
reactivity/hmr/hooks.py,sha256=jIFpe4CNxfaS9RcR4OIodx_sOZlnJ_IA1T1RtHPXhwU,945
|
12
12
|
reactivity/hmr/utils.py,sha256=-PO-LMP4sc3IP-Bn_baq2w9IFWBZ3zGesgRn5wR6bS0,1555
|
13
13
|
reactivity/primitives.py,sha256=mB6cbHKDqtilOfgaEhshtRWJq9s0nPEKqRK0hfCoyFE,5671
|
14
|
-
hmr-0.4.1.
|
14
|
+
hmr-0.4.1.2.dist-info/RECORD,,
|
reactivity/helpers.py
CHANGED
@@ -112,11 +112,13 @@ class Reactive[K, V](Subscribable, MutableMapping[K, V]):
|
|
112
112
|
|
113
113
|
def __iter__(self):
|
114
114
|
self.track()
|
115
|
-
|
115
|
+
unset = self.UNSET
|
116
|
+
return (key for key, signal in self._signals.items() if signal.get(track=False) is not unset)
|
116
117
|
|
117
118
|
def __len__(self):
|
118
119
|
self.track()
|
119
|
-
|
120
|
+
unset = self.UNSET
|
121
|
+
return sum(signal.get(track=False) is not unset for signal in self._signals.values())
|
120
122
|
|
121
123
|
def __repr__(self):
|
122
124
|
self.track()
|
reactivity/hmr/core.py
CHANGED
@@ -33,8 +33,7 @@ def is_called_in_this_file() -> bool:
|
|
33
33
|
|
34
34
|
|
35
35
|
class Name(Signal, BaseDerived):
|
36
|
-
|
37
|
-
super().__init__(initial_value)
|
36
|
+
pass
|
38
37
|
|
39
38
|
|
40
39
|
class NamespaceProxy(Reactive[str, Any]):
|
@@ -44,7 +43,7 @@ class NamespaceProxy(Reactive[str, Any]):
|
|
44
43
|
self.module = module
|
45
44
|
|
46
45
|
def _null(self):
|
47
|
-
self.module.load.subscribers.add(signal := Name(self.UNSET))
|
46
|
+
self.module.load.subscribers.add(signal := Name(self.UNSET, self._check_equality))
|
48
47
|
signal.dependencies.add(self.module.load)
|
49
48
|
return signal
|
50
49
|
|
@@ -97,8 +96,9 @@ class ReactiveModule(ModuleType):
|
|
97
96
|
else:
|
98
97
|
exec(code, self.__namespace, self.__namespace_proxy)
|
99
98
|
finally:
|
100
|
-
|
101
|
-
|
99
|
+
load = self.__load
|
100
|
+
assert ismethod(load.fn) # for type narrowing
|
101
|
+
for dep in list(load.dependencies):
|
102
102
|
if isinstance(dep, Derived) and ismethod(dep.fn) and isinstance(dep.fn.__self__, ReactiveModule) and dep.fn.__func__ is load.fn.__func__:
|
103
103
|
# unsubscribe it because we want invalidation to be fine-grained
|
104
104
|
dep.subscribers.remove(load)
|
@@ -133,14 +133,13 @@ class ReactiveModule(ModuleType):
|
|
133
133
|
|
134
134
|
|
135
135
|
class ReactiveModuleLoader(Loader):
|
136
|
-
def __init__(self, file: Path
|
136
|
+
def __init__(self, file: Path):
|
137
137
|
super().__init__()
|
138
138
|
self._file = file
|
139
|
-
self._is_package = is_package
|
140
139
|
|
141
140
|
def create_module(self, spec: ModuleSpec):
|
142
141
|
namespace = {"__file__": str(self._file), "__spec__": spec, "__loader__": self, "__name__": spec.name}
|
143
|
-
if
|
142
|
+
if spec.submodule_search_locations is not None:
|
144
143
|
assert self._file.name == "__init__.py"
|
145
144
|
namespace["__path__"] = [str(self._file.parent)]
|
146
145
|
return ReactiveModule(self._file, namespace, spec.name)
|
@@ -173,7 +172,7 @@ class ReactiveModuleFinder(MetaPathFinder):
|
|
173
172
|
return spec_from_loader(fullname, ReactiveModuleLoader(file), origin=str(file))
|
174
173
|
file = directory / f"{fullname.replace('.', '/')}/__init__.py"
|
175
174
|
if self._accept(file) and (paths is None or is_relative_to_any(file, paths)):
|
176
|
-
return spec_from_loader(fullname, ReactiveModuleLoader(file
|
175
|
+
return spec_from_loader(fullname, ReactiveModuleLoader(file), origin=str(file), is_package=True)
|
177
176
|
|
178
177
|
|
179
178
|
def is_relative_to_any(path: Path, paths: Iterable[str | Path]):
|
@@ -339,4 +338,4 @@ def cli():
|
|
339
338
|
SyncReloader(entry).keep_watching_until_interrupt()
|
340
339
|
|
341
340
|
|
342
|
-
__version__ = "0.4.1.
|
341
|
+
__version__ = "0.4.1.2"
|
File without changes
|
File without changes
|