hmr 0.2.0__py3-none-any.whl → 0.2.1__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.2.0
3
+ Version: 0.2.1
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,9 +1,9 @@
1
- hmr-0.2.0.dist-info/METADATA,sha256=EOVgm-SYoDvhCdf7X3stdnfoOwt4JiJz4dU-MH5qp4A,258
2
- hmr-0.2.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- hmr-0.2.0.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
1
+ hmr-0.2.1.dist-info/METADATA,sha256=QnthYHF5mqiGCrS_KTlsy8klZV8q_ebFLuDJyk68bV0,258
2
+ hmr-0.2.1.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ hmr-0.2.1.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
- reactivity/hmr.py,sha256=CeJSXPeDA-wc_tE_JC0gXfFgeaGsCEvmVbbsCYJtGok,9603
7
+ reactivity/hmr.py,sha256=NeluXz7ufmQybqp8BivF-q_tSl2XTPyj8tVvKWz9S1c,9631
8
8
  reactivity/primitives.py,sha256=DR2waJbzhVKOioHXMliE4FIsxQUq7DZA0umPrlvchA4,4217
9
- hmr-0.2.0.dist-info/RECORD,,
9
+ hmr-0.2.1.dist-info/RECORD,,
reactivity/hmr.py CHANGED
@@ -8,6 +8,7 @@ from importlib.util import spec_from_loader
8
8
  from inspect import currentframe
9
9
  from pathlib import Path
10
10
  from runpy import run_path
11
+ from site import getsitepackages
11
12
  from types import ModuleType, TracebackType
12
13
  from typing import Any
13
14
 
@@ -115,7 +116,7 @@ class ReactiveModuleFinder(MetaPathFinder):
115
116
  def __init__(self, includes: Iterable[str] = ".", excludes: Iterable[str] = ()):
116
117
  super().__init__()
117
118
  self.includes = [Path(i).resolve() for i in includes]
118
- self.excludes = [Path(e).resolve() for e in excludes]
119
+ self.excludes = [Path(e).resolve() for e in (*excludes, *getsitepackages())]
119
120
 
120
121
  def _accept(self, path: Path):
121
122
  return path.is_file() and not is_relative_to_any(path, self.excludes) and is_relative_to_any(path, self.includes)
@@ -149,7 +150,7 @@ def patch_module(name_or_module: str | ModuleType):
149
150
  return m
150
151
 
151
152
 
152
- def patch_meta_path(includes: Iterable[str] = (".",), excludes: Iterable[str] = (".venv",)):
153
+ def patch_meta_path(includes: Iterable[str] = (".",), excludes: Iterable[str] = ()):
153
154
  sys.meta_path.insert(0, ReactiveModuleFinder(includes, excludes))
154
155
 
155
156
 
@@ -281,7 +282,7 @@ def cli():
281
282
  if not (path := Path(entry)).is_file():
282
283
  raise FileNotFoundError(path.resolve())
283
284
  sys.path.insert(0, ".")
284
- SyncReloader(entry, excludes={".venv"}).keep_watching_until_interrupt()
285
+ SyncReloader(entry).keep_watching_until_interrupt()
285
286
 
286
287
 
287
- __version__ = "0.2.0"
288
+ __version__ = "0.2.1"
File without changes