Skip to content
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

Revert 1193 fix ci issue #6

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions packages/voila/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"main": "lib/index.js",
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
"dependencies": {
"@jupyter-widgets/base": "^4.1.0",
"@jupyter-widgets/controls": "^3.1.0",
"@jupyter-widgets/jupyterlab-manager": "^3.1.0",
"@jupyter-widgets/base": "^6.0.1",
"@jupyter-widgets/controls": "^5.0.1",
"@jupyter-widgets/jupyterlab-manager": "^5.0.3",
"@jupyterlab/application": "^3.0.0",
"@jupyterlab/apputils": "^3.0.0",
"@jupyterlab/coreutils": "^5.0.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/voila/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ export class WidgetManager extends JupyterLabManager {
const model = await this.get_model(model_id);
const widgetel = document.createElement('div');
viewtag.parentElement.insertBefore(widgetel, viewtag);
const view = await this.create_view(model);
// TODO: fix typing
await this.display_model(undefined as any, model, {
await this.display_view(undefined as any, view, {
el: widgetel
});
} catch (error) {
Expand All @@ -131,7 +132,7 @@ export class WidgetManager extends JupyterLabManager {

async display_view(msg: any, view: any, options: any): Promise<Widget> {
if (options.el) {
LuminoWidget.Widget.attach(view.pWidget, options.el);
LuminoWidget.Widget.attach(view.luminoWidget, options.el);
}
if (view.el) {
view.el.setAttribute('data-voila-jupyter-widget', '');
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ visual_test =
jupyterlab~=3.0
bqplot
scipy
ipympl==0.8.7
ipyvolume
ipympl==0.9.2
ipyvolume @ git+https://github.com/jtpio/ipyvolume@ipywidgets-8
jupyterlab_miami_nights==0.3.2

[options.entry_points]
Expand Down
2 changes: 1 addition & 1 deletion tests/app/preheat_multiple_notebooks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

BASE_DIR = os.path.dirname(__file__)
NOTEBOOK_EXECUTION_TIME = 3
NOTEBOOK_EXECUTION_TIME = 2
NUMBER_PREHEATED_KERNEL = 2
TIME_THRESHOLD = 1

Expand Down
21 changes: 6 additions & 15 deletions tests/execute_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def normalize_output(output):
if 'traceback' in output:
del output['traceback']
if 'application/vnd.jupyter.widget-view+json' in output.get('data', {}):
output['data']['application/vnd.jupyter.widget-view+json'][
'model_id'
] = '<MODEL_ID>'
output['data']['application/vnd.jupyter.widget-view+json']['model_id'] = '<MODEL_ID>'


def normalize_outputs(outputs):
Expand All @@ -36,31 +34,24 @@ def normalize_outputs(outputs):


def test_execute_output():
path = os.path.join(BASE_DIR, 'notebooks/output.ipynb')
path = os.path.join(BASE_DIR, "notebooks/output.ipynb")
nb = read(path, NO_CONVERT)
nb_voila = deepcopy(nb)
executenb(nb_voila)

widget_states = nb.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state']
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE][
'state'
]
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state']

for cell_voila, cell in zip(nb_voila.cells, nb.cells):
for output_voila, output in zip(cell_voila.outputs, cell.outputs):
if 'data' in output and WIDGET_MIME_TYPE_VIEW in output['data']:
widget_id = output['data'][WIDGET_MIME_TYPE_VIEW]['model_id']
widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW][
'model_id'
]
widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW]['model_id']
widget_state = widget_states[widget_id]
widget_state_voila = widget_states_voila[widget_id_voila]
# if the widget is an output widget, it has the outputs, which we also check
assert normalize_outputs(
widget_state.state.get('outputs', [])
) == normalize_outputs(
widget_state_voila.state.get('outputs', [])
)
assert normalize_outputs(widget_state.state.get('outputs', [])) ==\
normalize_outputs(widget_state_voila.state.get('outputs', []))
normalize_output(output_voila)
normalize_output(output)
assert output_voila == output
36 changes: 10 additions & 26 deletions tests/notebooks/output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"Output()"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand Down Expand Up @@ -73,9 +72,8 @@
"Output()"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand Down Expand Up @@ -120,9 +118,8 @@
"Output()"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand Down Expand Up @@ -168,9 +165,8 @@
"Output()"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand Down Expand Up @@ -215,9 +211,8 @@
"Output()"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand Down Expand Up @@ -254,9 +249,8 @@
"Output()"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand All @@ -282,9 +276,8 @@
"Output()"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
"output_type": "display_data"
}
],
"source": [
Expand All @@ -303,20 +296,11 @@
" print('in outer')\n",
" print('also in inner')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
"language": "python"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -328,7 +312,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.7.3"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down Expand Up @@ -788,5 +772,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 4
"nbformat_minor": 2
}
Binary file modified ui-tests/tests/voila.test.ts-snapshots/basics-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/basics-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/basics-miami-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/gridspecLayout-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/interactive-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/ipyvolume-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/voila.test.ts-snapshots/reveal-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading