Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d482927
Update Widget List.ipynb
liamb27 Apr 1, 2024
3fec38a
Update package imports
May 26, 2024
2baf3d6
Fix/unify tooltips.
May 26, 2024
53adf75
DirectionalLinkModel - remove link to source and target on cleanup.
May 26, 2024
b9d043e
Add weakref with opt in automatic widget deletion using 'enable_weakr…
May 26, 2024
cf8ef63
Add Children for Box (and subclasses) to support validation of any ty…
May 26, 2024
54bd2c6
Update yarn.lock (ran jlpm dlx yarn-berry-deduplicate).
May 26, 2024
75da2f9
Run lint.
May 28, 2024
0c1dafe
Fix tests that need dummy comm & update yarn.lock.
Jun 9, 2024
077d950
Merge branch 'main' of https://github.com/jupyter-widgets/ipywidgets …
Aug 31, 2024
3e49c8e
Fix tests and lock file.
Aug 31, 2024
7fa9cba
Simplify tooltips to work everywhere
Sep 10, 2024
234752c
Remove unnecessary code.
Sep 11, 2024
9d5a482
Update the widget model specification for 'Children'.
Sep 12, 2024
8286c7c
Make _model_id a property
Oct 26, 2024
dec5524
Merge branch 'main' of https://github.com/jupyter-widgets/ipywidgets …
Nov 2, 2024
ca3d0cb
Change _instances from 'global' variable to class variable.
Nov 4, 2024
1833ca0
Merge branch 'jupyter-widgets:main' into weakref
fleming79 Oct 15, 2025
4aff0cd
Simplify tests (some were failing for an unknown reason when run toge…
Oct 17, 2025
4869104
Fix create_markdown accessing deprecated (removed _widget_types).
Oct 18, 2025
3541511
Change from using Widget._instances class variable to the global _wid…
Oct 19, 2025
1243f70
Improved resilience of Widget.get_state to omit close items in boxes …
Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, windows]
python: ['3.9', '3.13']
python: ['3.10', '3.13']
dist: ['ipywidgets*.tar.gz']
include:
- python: '3.13'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v4
Expand All @@ -96,7 +96,7 @@ jobs:
pip install file://$PWD/python/ipywidgets#egg=ipywidgets[test]
- name: Test with pytest
run: |
pip install "pytest<8"
pip install "pytest"
cd python/ipywidgets
pytest --cov=ipywidgets ipywidgets

Expand Down
1 change: 1 addition & 0 deletions docs/source/dev_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ To update the widget model specification with changes, do something like this in
```
python ./packages/schema/generate-spec.py -f json-pretty packages/schema/jupyterwidgetmodels.latest.json
python ./packages/schema/generate-spec.py -f markdown packages/schema/jupyterwidgetmodels.latest.md
jlpm prettier
```

## Releasing new versions
Expand Down
1 change: 0 additions & 1 deletion packages/base-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"chai": "^4.0.0",
"chai-as-promised": "^7.0.0",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
1 change: 0 additions & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"chai": "^4.0.0",
"chai-as-promised": "^7.0.0",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1101,11 +1101,11 @@ export class DOMWidgetView extends WidgetView {
}

updateTooltip(): void {
const title = this.model.get('tooltip');
if (!title) {
this.el.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
const title = this.model.get('tooltip') ?? this.model.get('description');
if (title) {
this.el.setAttribute('title', title);
} else {
this.el.removeAttribute('title');
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"chai": "^4.0.0",
"css-loader": "^6.5.1",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
13 changes: 1 addition & 12 deletions packages/controls/src/widget_bool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ export class CheckboxView extends DescriptionView {
this.descriptionSpan.textContent = description;
}
this.typeset(this.descriptionSpan);
this.descriptionSpan.title = description;
this.checkbox.title = description;
this.updateTooltip();
}

/**
Expand All @@ -180,16 +179,6 @@ export class CheckboxView extends DescriptionView {
}
}

updateTooltip(): void {
if (!this.checkbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.checkbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.checkbox.setAttribute('title', title);
}
}

events(): { [e: string]: string } {
return {
'click input[type="checkbox"]': '_handle_click',
Expand Down
5 changes: 0 additions & 5 deletions packages/controls/src/widget_description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ export class DescriptionView extends DOMWidgetView {
}
}

updateTooltip(): void {
if (!this.label) return;
this.label.title = this.model.get('tooltip');
}

label: HTMLLabelElement;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/controls/src/widget_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ export class DirectionalLinkModel extends CoreWidgetModel {
undefined
);
this.stopListening(this.sourceModel, 'destroy', undefined);
this.set('source', [null, '']);
}
if (this.targetModel) {
this.stopListening(this.targetModel, 'destroy', undefined);
this.set('target', [null, '']);
this.save_changes();
}
}

Expand Down
10 changes: 0 additions & 10 deletions packages/controls/src/widget_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ export class SelectionView extends DescriptionView {
}
}

updateTooltip(): void {
if (!this.listbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.listbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.listbox.setAttribute('title', title);
}
}

listbox: HTMLSelectElement;
}

Expand Down
20 changes: 0 additions & 20 deletions packages/controls/src/widget_string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,6 @@ export class TextareaView extends StringView {
}
}

updateTooltip(): void {
if (!this.textbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.textbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.textbox.setAttribute('title', title);
}
}

events(): { [e: string]: string } {
return {
'keydown textarea': 'handleKeyDown',
Expand Down Expand Up @@ -504,16 +494,6 @@ export class TextView extends StringView {
}
}

updateTooltip(): void {
if (!this.textbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.textbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.textbox.setAttribute('title', title);
}
}

update(options?: any): void {
/**
* Update the contents of this view
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/generate-spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def create_markdown(spec):
args = parser.parse_args()
format = args.format

widgets_to_document = sorted(widgets.Widget._widget_types.items())
widgets_to_document = sorted(widgets.widget._registry.items())
spec = create_spec(widgets_to_document)

if args.output:
Expand Down
42 changes: 7 additions & 35 deletions packages/schema/jupyterwidgetmodels.latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -935,12 +931,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -3753,12 +3745,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -3850,12 +3838,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -6643,12 +6627,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -6756,12 +6736,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down Expand Up @@ -7914,12 +7890,8 @@
{
"default": [],
"help": "List of widget children",
"items": {
"type": "reference",
"widget": "Widget"
},
"name": "children",
"type": "array"
"type": "Children"
},
{
"default": "reference to new instance",
Expand Down
14 changes: 7 additions & 7 deletions packages/schema/jupyterwidgetmodels.latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'AccordionView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `selected_index` | `null` or number (integer) | `null` | The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected. |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
Expand Down Expand Up @@ -163,7 +163,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'BoxView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
| `tooltip` | `null` or string | `null` | A tooltip caption. |
Expand Down Expand Up @@ -663,7 +663,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'GridBoxView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
| `tooltip` | `null` or string | `null` | A tooltip caption. |
Expand All @@ -680,7 +680,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'HBoxView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
| `tooltip` | `null` or string | `null` | A tooltip caption. |
Expand Down Expand Up @@ -1179,7 +1179,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'StackView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `selected_index` | `null` or number (integer) | `null` | The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected. |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
Expand All @@ -1198,7 +1198,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'TabView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `selected_index` | `null` or number (integer) | `null` | The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected. |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
Expand Down Expand Up @@ -1402,7 +1402,7 @@ that the widget is registered with.
| `_view_module_version` | string | `'2.0.0'` |
| `_view_name` | string | `'VBoxView'` |
| `box_style` | string (one of `'success'`, `'info'`, `'warning'`, `'danger'`, `''`) | `''` | Use a predefined styling for the box. |
| `children` | array of reference to Widget widget | `[]` | List of widget children |
| `children` | Children | `[]` | List of widget children |
| `layout` | reference to Layout widget | reference to new instance |
| `tabbable` | `null` or boolean | `null` | Is widget tabbable? |
| `tooltip` | `null` or string | `null` | A tooltip caption. |
Expand Down
6 changes: 3 additions & 3 deletions python/ipywidgets/ipywidgets/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import json
import re
from .widgets import Widget, DOMWidget, widget as widget_module
from .widgets import Widget, DOMWidget
from .widgets.widget_link import Link
from .widgets.docutils import doc_subst
from ._version import __html_manager_version__
Expand Down Expand Up @@ -129,7 +129,7 @@ def _get_recursive_state(widget, store=None, drop_defaults=False):

def add_resolved_links(store, drop_defaults):
"""Adds the state of any link models between two models in store"""
for widget_id, widget in widget_module._instances.items(): # go over all widgets
for widget_id, widget in Widget.all_widgets().items(): # go over all widgets
if isinstance(widget, Link) and widget_id not in store:
if widget.source[0].model_id in store and widget.target[0].model_id in store:
store[widget.model_id] = widget._get_embed_state(drop_defaults=drop_defaults)
Expand Down Expand Up @@ -207,7 +207,7 @@ def embed_data(views, drop_defaults=True, state=None):
view_specs: a list of widget view specs
"""
if views is None:
views = [w for w in widget_module._instances.values() if isinstance(w, DOMWidget)]
views = [w for w in Widget.all_widgets().values() if isinstance(w, DOMWidget)]
else:
try:
views[0]
Expand Down
Loading