hmr 0.6.0.1__tar.gz → 0.6.0.2__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.0.1
3
+ Version: 0.6.0.2
4
4
  Summary: Hot Module Reload for Python
5
5
  Project-URL: repository, https://github.com/promplate/pyth-on-line/tree/reactivity
6
6
  Requires-Python: >=3.12
@@ -7,7 +7,7 @@ description = "Hot Module Reload for Python"
7
7
  dependencies = [
8
8
  "watchfiles>=0.21,<2 ; sys_platform != 'emscripten'",
9
9
  ]
10
- version = "0.6.0.1"
10
+ version = "0.6.0.2"
11
11
 
12
12
  [project.scripts]
13
13
  hmr = "reactivity.hmr:cli"
@@ -38,6 +38,15 @@ class Context(NamedTuple):
38
38
  def effect(self):
39
39
  return partial(Effect, context=self)
40
40
 
41
+ @contextmanager
42
+ def untrack(self):
43
+ computations = self.current_computations[:]
44
+ self.current_computations.clear()
45
+ try:
46
+ yield
47
+ finally:
48
+ self.current_computations[:] = computations
49
+
41
50
 
42
51
  def new_context():
43
52
  return Context([], [])
@@ -344,4 +344,4 @@ def cli():
344
344
  reloader.keep_watching_until_interrupt()
345
345
 
346
346
 
347
- __version__ = "0.6.0.1"
347
+ __version__ = "0.6.0.2"
@@ -34,8 +34,9 @@ class Subscribable:
34
34
  return
35
35
  last = self.context.current_computations[-1]
36
36
  if last is not self:
37
- self.subscribers.add(last)
38
- last.dependencies.add(self)
37
+ with self.context.untrack():
38
+ self.subscribers.add(last)
39
+ last.dependencies.add(self)
39
40
 
40
41
  def notify(self):
41
42
  if self.context.batches:
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