hmr 0.3.3__py3-none-any.whl → 0.3.3.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.
- {hmr-0.3.3.dist-info → hmr-0.3.3.1.dist-info}/METADATA +1 -1
- {hmr-0.3.3.dist-info → hmr-0.3.3.1.dist-info}/RECORD +6 -6
- reactivity/hmr/api.py +13 -10
- reactivity/hmr/core.py +8 -6
- {hmr-0.3.3.dist-info → hmr-0.3.3.1.dist-info}/WHEEL +0 -0
- {hmr-0.3.3.dist-info → hmr-0.3.3.1.dist-info}/entry_points.txt +0 -0
@@ -1,13 +1,13 @@
|
|
1
|
-
hmr-0.3.3.dist-info/METADATA,sha256=
|
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
|
1
|
+
hmr-0.3.3.1.dist-info/METADATA,sha256=i7tLdHbmQlSY2AiGNO_3uqmEStVLcsD12rmmzF9O8Yw,260
|
2
|
+
hmr-0.3.3.1.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
hmr-0.3.3.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
7
|
reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
|
8
|
-
reactivity/hmr/api.py,sha256
|
9
|
-
reactivity/hmr/core.py,sha256=
|
8
|
+
reactivity/hmr/api.py,sha256=-0-6Tn0AVkaDs7_qrCCd9TXxRTPDMDB08-UYfepTdec,1644
|
9
|
+
reactivity/hmr/core.py,sha256=SCZi7vlSy4IPHQRTVpjlMn3am5L9sYN5zCE1nKw07eM,10163
|
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.3.dist-info/RECORD,,
|
13
|
+
hmr-0.3.3.1.dist-info/RECORD,,
|
reactivity/hmr/api.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
from .core import AsyncReloader, SyncReloader
|
1
|
+
from .core import AsyncReloader, BaseReloader, SyncReloader
|
2
|
+
|
3
|
+
|
4
|
+
def _clean_up(r: BaseReloader):
|
5
|
+
r.run_entry_file.dispose()
|
6
|
+
r.run_entry_file.invalidate()
|
7
|
+
r.entry_module.load.dispose()
|
8
|
+
r.entry_module.load.invalidate()
|
2
9
|
|
3
10
|
|
4
11
|
class SyncReloaderAPI(SyncReloader):
|
@@ -13,21 +20,19 @@ class SyncReloaderAPI(SyncReloader):
|
|
13
20
|
def __exit__(self, *_):
|
14
21
|
self.stop_watching()
|
15
22
|
self.thread.join()
|
16
|
-
self
|
17
|
-
self.run_entry_file.invalidate()
|
23
|
+
_clean_up(self)
|
18
24
|
|
19
25
|
async def __aenter__(self):
|
20
26
|
from asyncio import ensure_future, to_thread
|
21
27
|
|
22
|
-
self.run_entry_file
|
28
|
+
await to_thread(self.run_entry_file)
|
23
29
|
self.future = ensure_future(to_thread(self.start_watching))
|
24
30
|
return super()
|
25
31
|
|
26
32
|
async def __aexit__(self, *_):
|
27
33
|
self.stop_watching()
|
28
34
|
await self.future
|
29
|
-
self
|
30
|
-
self.run_entry_file.invalidate()
|
35
|
+
_clean_up(self)
|
31
36
|
|
32
37
|
|
33
38
|
class AsyncReloaderAPI(AsyncReloader):
|
@@ -43,8 +48,7 @@ class AsyncReloaderAPI(AsyncReloader):
|
|
43
48
|
def __exit__(self, *_):
|
44
49
|
self.stop_watching()
|
45
50
|
self.thread.join()
|
46
|
-
self
|
47
|
-
self.run_entry_file.invalidate()
|
51
|
+
_clean_up(self)
|
48
52
|
|
49
53
|
async def __aenter__(self):
|
50
54
|
from asyncio import ensure_future, to_thread
|
@@ -56,5 +60,4 @@ class AsyncReloaderAPI(AsyncReloader):
|
|
56
60
|
async def __aexit__(self, *_):
|
57
61
|
self.stop_watching()
|
58
62
|
await self.future
|
59
|
-
self
|
60
|
-
self.run_entry_file.invalidate()
|
63
|
+
_clean_up(self)
|
reactivity/hmr/core.py
CHANGED
@@ -190,15 +190,17 @@ class BaseReloader:
|
|
190
190
|
patch_meta_path(includes, excludes)
|
191
191
|
self.error_filter = ErrorFilter(*(str(i) for i in Path(__file__, "../..").resolve().glob("**/*.py")))
|
192
192
|
|
193
|
+
@cached_property
|
194
|
+
def entry_module(self):
|
195
|
+
namespace = {"__file__": self.entry, "__name__": "__main__"}
|
196
|
+
return ReactiveModule(Path(self.entry), namespace, "__main__")
|
197
|
+
|
193
198
|
@memoized_method
|
194
199
|
def run_entry_file(self):
|
195
200
|
call_pre_reload_hooks()
|
196
201
|
|
197
|
-
|
198
|
-
|
199
|
-
module = sys.modules["__main__"] = ReactiveModule(Path(self.entry), namespace, "__main__")
|
200
|
-
module.load.invalidate()
|
201
|
-
module.load()
|
202
|
+
self.entry_module.load.invalidate()
|
203
|
+
self.entry_module.load()
|
202
204
|
|
203
205
|
call_post_reload_hooks()
|
204
206
|
|
@@ -305,4 +307,4 @@ def cli():
|
|
305
307
|
SyncReloader(entry).keep_watching_until_interrupt()
|
306
308
|
|
307
309
|
|
308
|
-
__version__ = "0.3.3"
|
310
|
+
__version__ = "0.3.3.1"
|
File without changes
|
File without changes
|