-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix registry state lookup #3653
Fix registry state lookup #3653
Conversation
40bfd60
to
23eccbc
Compare
23eccbc
to
5ef6573
Compare
Thanks @bollwyvl ! And I agree, this could have been avoided. I'll put it on the agenda for next time we have a widget meeting. |
@@ -74,3 +78,27 @@ def test_compatibility(): | |||
caller_path = inspect.stack(context=0)[1].filename | |||
assert all(x.filename == caller_path for x in record) | |||
assert len(record) == 6 | |||
|
|||
|
|||
def test_create_from_frontend(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Beyond static analysis: it's probably worth pulling off the band-aid and applying |
Yes, I think we all totally agree with you. I'd love to see it. What's your opinion on using pre-commit? |
Also had this error locally... |
FYI, #3566 moves to precommit with all those things applied. |
Fire, |
Hmm, some CI rot? Two seemingly unrelated workflows are failing. Is this something you touched in this PR @bollwyvl, or do you happen to know how to fix this? |
Well, they both fail around playwright, of which I can't claim a lot of knowledge... I'm more concerned about the persist OoM on RTD, and the lack of meaningful output on the karma tests. Without some of these things pinned (or at least archived) during a build, it's hard to say what has shifted. Perhaps a kicked run of |
I've slimmed this back down to just the fix and the tests, with de23fa6 being the last commit with the CI changes. |
@@ -12,29 +12,20 @@ | |||
# A widget with simple traits | |||
class SimpleWidget(Widget): | |||
a = Bool().tag(sync=True) | |||
b = Tuple(Bool(), Bool(), Bool(), default_value=(False, False, False)).tag(sync=True) | |||
b = Tuple(Bool(), Bool(), Bool(), default_value=(False, False, False)).tag( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can i roll these back, too?
Even though the error is being discovered by playwright, i'll wager the issue lies with |
That was merged... maybe a release forthcoming? Then we can get back to the other CI problems here, i suppose... |
ok, that cleared up those two emergent fails. i'm still not sure if blocking this on fixing the docs/js CI fails is the right play, and would prefer to start a second PR to investigate further... though this work did lead to finding two upstream issues, so at least there's that. |
Really appreciate the help here Nick! |
cd39116
to
3a12432
Compare
3a12432
to
3ac0ab3
Compare
Ok, tried a lot of things, but turns out it was just I've removed the |
Awesome work. I'm happy to merge this from this PR. I think I'll rebase/squash it into 2 or 3 commits somewhere tomorrow. Or, if you have your own opinion on how many commits there should be, feel free to do it yourself (I'm ok with force pushing) |
Squash it all!
|
I don't question authority 🙇 😄 |
This is released in ipywidgets 8.0.4 |
Thanks all! I can take a look at the docs as well, but might get a little tinker-y with it. Thoughts on going to |
Why is that? I haven't followed that development much, but I think you are saying myst-nb should replace nbsphinx? I kind of like the pydata-sphinx-theme, looks clean. Maybe opening an issue on this so we can get some opinions in? |
References
Changes
_registry.get
instead ofregister.get
actions/*
to latest versions to squash deprecation warningsTest: JavaScript
jobMotivation
This is relatively difficult to demonstrate, as it requires a widget that creates a new client-side widget. For a reproducer see this in-development notebook:
.ipynb
/lib/python3.10/site-packages/ipywidgets/widgets/widget.py
Future Work
Likely this should probably just get reviewed, and hopefully merged, as it's fairly clearly an improvement by inspection.
A test would emulate a client creating a new, pre-registered Widget.
However, a better long-term check would be applying
mypy
,pyflakes
or the new-fangled (but very fast)ruff
or some related tool which would do a better job at statically analyzing the code for catching these kinds of issues, but is probably out of scope for this one-line fix.