#1678 Fix resource setting in notebook

Merged Philipp Rudiger philippjfr
Coverage Reach
panel/tests/pane/test_holoviews.py panel/tests/pane/test_vtk.py panel/tests/pane/test_markup.py panel/tests/pane/test_plotly.py panel/tests/pane/test_deckgl.py panel/tests/pane/test_vega.py panel/tests/pane/test_image.py panel/tests/pane/test_plot.py panel/tests/pane/test_base.py panel/tests/pane/test_alert.py panel/tests/pane/test_ace.py panel/tests/pane/test_equation.py panel/tests/layout/test_tabs.py panel/tests/layout/test_base.py panel/tests/layout/test_grid.py panel/tests/layout/test_accordion.py panel/tests/layout/test_card.py panel/tests/layout/test_spacer.py panel/tests/widgets/test_select.py panel/tests/widgets/test_slider.py panel/tests/widgets/test_tables.py panel/tests/widgets/test_misc.py panel/tests/widgets/test_input.py panel/tests/widgets/test_file_selector.py panel/tests/widgets/test_base.py panel/tests/widgets/test_indicators.py panel/tests/widgets/test_button.py panel/tests/widgets/test_player.py panel/tests/widgets/test_ace.py panel/tests/test_param.py panel/tests/io/test_embed.py panel/tests/io/test_location.py panel/tests/io/test_notebook.py panel/tests/io/test_state.py panel/tests/io/test_model.py panel/tests/test_pipeline.py panel/tests/test_interact.py panel/tests/test_links.py panel/tests/template/test_manual.py panel/tests/template/test_vanilla_manual.py panel/tests/test_config.py panel/tests/test_template.py panel/tests/conftest.py panel/tests/test_reactive.py panel/tests/test_server.py panel/tests/util.py panel/tests/models/test_location.py panel/tests/models/test_deckgl.py panel/tests/test_docs.py panel/tests/test_util.py panel/tests/test_viewable.py panel/tests/test_models.py panel/tests/test_cli.py panel/pane/vtk/synchronizable_serializer.py panel/pane/vtk/vtk.py panel/pane/vtk/synchronizable_deserializer.py panel/pane/vtk/enums.py panel/pane/vtk/__init__.py panel/pane/holoviews.py panel/pane/base.py panel/pane/plot.py panel/pane/markup.py panel/pane/plotly.py panel/pane/image.py panel/pane/deckgl.py panel/pane/vega.py panel/pane/media.py panel/pane/equation.py panel/pane/echarts.py panel/pane/streamz.py panel/pane/ipywidget.py panel/pane/ace.py panel/pane/alert.py panel/pane/__init__.py panel/widgets/select.py panel/widgets/input.py panel/widgets/indicators.py panel/widgets/slider.py panel/widgets/tables.py panel/widgets/misc.py panel/widgets/file_selector.py panel/widgets/base.py panel/widgets/button.py panel/widgets/player.py panel/widgets/ace.py panel/widgets/__init__.py panel/io/server.py panel/io/embed.py panel/io/state.py panel/io/notebook.py panel/io/location.py panel/io/rest.py panel/io/model.py panel/io/save.py panel/io/resources.py panel/io/callbacks.py panel/io/ipywidget.py panel/io/__init__.py panel/layout/base.py panel/layout/grid.py panel/layout/tabs.py panel/layout/accordion.py panel/layout/card.py panel/layout/spacer.py panel/layout/__init__.py panel/template/base.py panel/template/react/__init__.py panel/template/material/__init__.py panel/template/golden/__init__.py panel/template/theme.py panel/template/vanilla/__init__.py panel/template/bootstrap/__init__.py panel/template/__init__.py panel/param.py panel/pipeline.py panel/models/vtk.py panel/models/widgets.py panel/models/deckgl.py panel/models/plotly.py panel/models/ace.py panel/models/comm_manager.py panel/models/echarts.py panel/models/layout.py panel/models/vega.py panel/models/location.py panel/models/ipywidget.py panel/models/markup.py panel/models/state.py panel/models/__init__.py panel/models/katex.py panel/models/mathjax.py panel/models/enums.py panel/config.py panel/auth.py panel/links.py panel/interact.py panel/reactive.py panel/viewable.py panel/util.py panel/command/serve.py panel/command/__init__.py panel/command/oauth_secret.py panel/compiler.py panel/depends.py panel/__init__.py panel/__main__.py panel/callbacks.py setup.py dodo.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 1 files from the diff.

@@ -25,7 +25,7 @@
Loading
25 25
from bokeh.embed.wrappers import wrap_in_script_tag
26 26
from bokeh.models import LayoutDOM, Model
27 27
from bokeh.resources import CDN, INLINE
28 -
from bokeh.settings import settings
28 +
from bokeh.settings import settings, _Unset
29 29
from bokeh.util.serialization import make_id
30 30
from pyviz_comms import (
31 31
    PYVIZ_PROXY, Comm, JupyterCommManager as _JupyterCommManager, nb_mime_js
@@ -208,16 +208,20 @@
Loading
208 208
    from IPython.display import publish_display_data
209 209
210 210
    resources = INLINE if inline else CDN
211 -
    prev_resources = settings.resources()
211 +
    prev_resources = settings.resources(default="server")
212 +
    user_resources = settings.resources._user_value is not _Unset
212 213
    try:
213 -
        settings.resources = 'cdn'
214 +
        settings.resources = 'inline' if inline else 'cdn'
214 215
        bundle = bundle_for_objs_and_resources(None, resources)
215 216
        configs, requirements, exports, skip_imports = require_components()
216 217
        ipywidget = 'ipywidgets_bokeh' in sys.modules
217 218
        bokeh_js = _autoload_js(bundle, configs, requirements, exports,
218 219
                                skip_imports, ipywidget, load_timeout)
219 220
    finally:
220 -
        settings.resources = prev_resources
221 +
        if user_resources:
222 +
            settings.resources = prev_resources
223 +
        else:
224 +
            settings.resources.unset_value()
221 225
222 226
    publish_display_data({
223 227
        'application/javascript': bokeh_js,

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
panel -0.02% 85.45%
dodo.py 0.00%
setup.py 0.00%
Project Totals (149 files) 85.05%
Loading