reacton 1.11.1__tar.gz → 1.11.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.
- {reacton-1.11.1 → reacton-1.11.2}/PKG-INFO +1 -1
- reacton-1.11.2/reacton/_version.py +1 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/core.py +10 -8
- {reacton-1.11.1 → reacton-1.11.2}/reacton/core_test.py +25 -0
- reacton-1.11.1/reacton/_version.py +0 -1
- {reacton-1.11.1 → reacton-1.11.2}/.gitignore +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/LICENSE +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/pyproject.toml +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/react_ipywidgets/__init__.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/react_ipywidgets/core.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/__init__.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/bqplot.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/deprecated/__init__.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/deprecated/ipyvuetify.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/find.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/find_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/fuzz_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/generate.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/generate_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/ipycanvas.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/ipyvue.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/ipyvue_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/ipyvuetify.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/ipywidgets.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/logging.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/patch.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/patch_display.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/py.typed +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/rx.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/test.vue +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/test_rx.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/threads_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/utils.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/utils_test.py +0 -0
- {reacton-1.11.1 → reacton-1.11.2}/reacton/work.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.11.2"
|
|
@@ -517,14 +517,10 @@ class Element(Generic[W]):
|
|
|
517
517
|
try:
|
|
518
518
|
try:
|
|
519
519
|
widget = self.component.widget(**kwargs)
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
with rc, hold_trait_notifications(*args, **kwargs):
|
|
525
|
-
yield
|
|
526
|
-
|
|
527
|
-
widget.hold_trait_notifications = hold_trait_notifications_extra
|
|
520
|
+
# A partial of one module-level context manager, not a @contextlib.contextmanager defined here:
|
|
521
|
+
# that decorator runs functools.wraps for every widget, and on free-threaded Python setting
|
|
522
|
+
# attributes on a function object stops all threads.
|
|
523
|
+
widget.hold_trait_notifications = functools.partial(_hold_trait_notifications_extra, rc, widget.hold_trait_notifications)
|
|
528
524
|
|
|
529
525
|
if self._meta:
|
|
530
526
|
widget._react_meta = dict(self._meta)
|
|
@@ -3423,3 +3419,9 @@ _default_container: Optional[Callable[..., Element]] = Fragment
|
|
|
3423
3419
|
# not a public api yet, used in solara for now only.
|
|
3424
3420
|
# lifecycle of context objects are linked to the lifecycle of the component
|
|
3425
3421
|
_component_context_manager_classes: List[Any] = []
|
|
3422
|
+
|
|
3423
|
+
|
|
3424
|
+
@contextlib.contextmanager
|
|
3425
|
+
def _hold_trait_notifications_extra(rc, hold_trait_notifications, *args, **kwargs):
|
|
3426
|
+
with rc, hold_trait_notifications(*args, **kwargs):
|
|
3427
|
+
yield
|
|
@@ -4437,3 +4437,28 @@ def test_close_after_a_failed_render_of_a_deep_tree_is_fast():
|
|
|
4437
4437
|
with pytest.raises(ValueError):
|
|
4438
4438
|
rc.close() # close() raises the error of the failed render again
|
|
4439
4439
|
assert time.monotonic() - start < 2
|
|
4440
|
+
|
|
4441
|
+
|
|
4442
|
+
def test_create_widget_does_not_wrap_a_function_per_widget():
|
|
4443
|
+
# on free-threaded Python, functools.wraps (setting attributes on a function) stops all threads,
|
|
4444
|
+
# so creating a widget should not define and wrap a new function
|
|
4445
|
+
import functools
|
|
4446
|
+
|
|
4447
|
+
@react.component
|
|
4448
|
+
def Test():
|
|
4449
|
+
with w.VBox() as main:
|
|
4450
|
+
for i in range(10):
|
|
4451
|
+
w.IntSlider(value=i)
|
|
4452
|
+
return main
|
|
4453
|
+
|
|
4454
|
+
with unittest.mock.patch("functools.update_wrapper", wraps=functools.update_wrapper) as update_wrapper:
|
|
4455
|
+
box, rc = react.render(Test(), handle_error=False)
|
|
4456
|
+
assert update_wrapper.call_count == 0
|
|
4457
|
+
slider = rc.find(widgets.IntSlider).widgets[0]
|
|
4458
|
+
changes = []
|
|
4459
|
+
slider.observe(lambda change: changes.append(change["new"]), "value")
|
|
4460
|
+
with slider.hold_trait_notifications():
|
|
4461
|
+
slider.value = 42
|
|
4462
|
+
assert changes == []
|
|
4463
|
+
assert changes == [42]
|
|
4464
|
+
rc.close()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.11.1"
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|