hmr 0.3.2.1__py3-none-any.whl → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hmr
3
- Version: 0.3.2.1
3
+ Version: 0.3.3
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
@@ -1,13 +1,13 @@
1
- hmr-0.3.2.1.dist-info/METADATA,sha256=8yvIUd65G_YzVZMlVawIKx4DFoheLd_IRPdewGk37Ew,260
2
- hmr-0.3.2.1.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- hmr-0.3.2.1.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
1
+ hmr-0.3.3.dist-info/METADATA,sha256=pBTW65YJHP8X5EMGNol-ErbXuNjtsLCS-U5JtFZag8c,258
2
+ hmr-0.3.3.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ hmr-0.3.3.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
6
  reactivity/helpers.py,sha256=7gwsIKKrjEahSz9G9oR4s1LdYXQTCIMO0k4UGXGla9Y,3714
7
7
  reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
8
8
  reactivity/hmr/api.py,sha256=eqxQuqJUCbHE6vdHplWxxJt1RdItFC42neOB_exbPkE,1665
9
- reactivity/hmr/core.py,sha256=XAG9xS-2zgyr-EyXGCA8B4dqRMhfqxY4stugA9KPLcQ,10135
9
+ reactivity/hmr/core.py,sha256=c9N5eJvWnr7KQp6UtaPKqOdDkLXZJ5B3PfNrxqgort4,10203
10
10
  reactivity/hmr/hooks.py,sha256=-yLr5ktiyqPb1nDbHsgv6-c_ZkziBjNqCU-0PCfXGYU,592
11
11
  reactivity/hmr/utils.py,sha256=zgKjz3RhcUDYLoIqZFRVBcPtPWUJA1YphJycyrQx3tk,1464
12
12
  reactivity/primitives.py,sha256=DR2waJbzhVKOioHXMliE4FIsxQUq7DZA0umPrlvchA4,4217
13
- hmr-0.3.2.1.dist-info/RECORD,,
13
+ hmr-0.3.3.dist-info/RECORD,,
reactivity/hmr/core.py CHANGED
@@ -194,12 +194,11 @@ class BaseReloader:
194
194
  def run_entry_file(self):
195
195
  call_pre_reload_hooks()
196
196
 
197
- with self.error_filter:
198
- if not isinstance(module := sys.modules["__main__"], ReactiveModule):
199
- namespace = {"__file__": self.entry, "__name__": "__main__"}
200
- module = sys.modules["__main__"] = ReactiveModule(Path(self.entry), namespace, "__main__")
201
- module.load.invalidate()
202
- module.load()
197
+ if not isinstance(module := sys.modules["__main__"], ReactiveModule):
198
+ namespace = {"__file__": self.entry, "__name__": "__main__"}
199
+ module = sys.modules["__main__"] = ReactiveModule(Path(self.entry), namespace, "__main__")
200
+ module.load.invalidate()
201
+ module.load()
203
202
 
204
203
  call_post_reload_hooks()
205
204
 
@@ -224,13 +223,14 @@ class BaseReloader:
224
223
  if path.samefile(self.entry):
225
224
  self.run_entry_file.invalidate()
226
225
  elif module := path2module.get(path):
227
- with self.error_filter:
228
- module.load.invalidate()
226
+ module.load.invalidate()
229
227
 
230
- for module in path2module.values():
231
- with self.error_filter:
228
+ with self.error_filter:
229
+ for module in path2module.values():
230
+ if module.file.samefile(self.entry):
231
+ continue
232
232
  module.load()
233
- self.run_entry_file()
233
+ self.run_entry_file()
234
234
 
235
235
 
236
236
  class _SimpleEvent:
@@ -262,7 +262,8 @@ class SyncReloader(BaseReloader):
262
262
 
263
263
  def keep_watching_until_interrupt(self):
264
264
  with suppress(KeyboardInterrupt):
265
- self.run_entry_file()
265
+ with self.error_filter:
266
+ self.run_entry_file()
266
267
  self.start_watching()
267
268
  self.run_entry_file.dispose()
268
269
 
@@ -287,7 +288,8 @@ class AsyncReloader(BaseReloader):
287
288
 
288
289
  async def keep_watching_until_interrupt(self):
289
290
  with suppress(KeyboardInterrupt):
290
- self.run_entry_file()
291
+ with self.error_filter:
292
+ self.run_entry_file()
291
293
  await self.start_watching()
292
294
  self.run_entry_file.dispose()
293
295
 
@@ -303,4 +305,4 @@ def cli():
303
305
  SyncReloader(entry).keep_watching_until_interrupt()
304
306
 
305
307
 
306
- __version__ = "0.3.2.1"
308
+ __version__ = "0.3.3"
File without changes