Skip to content

Commit

Permalink
Update pyodide and pyscript and switch to pyc build
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 23, 2023
1 parent 9c0d993 commit 0141f5e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions panel/io/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@
PANEL_ROOT = pathlib.Path(__file__).parent.parent
BOKEH_VERSION = base_version(bokeh.__version__)
PY_VERSION = base_version(__version__)
PYODIDE_VERSION = 'v0.23.4'
PYSCRIPT_VERSION = '2023.05.1'
PANEL_LOCAL_WHL = DIST_DIR / 'wheels' / f'panel-{__version__.replace("-dirty", "")}-py3-none-any.whl'
BOKEH_LOCAL_WHL = DIST_DIR / 'wheels' / f'bokeh-{BOKEH_VERSION}-py3-none-any.whl'
PANEL_CDN_WHL = f'{CDN_DIST}wheels/panel-{PY_VERSION}-py3-none-any.whl'
BOKEH_CDN_WHL = f'{CDN_DIST}wheels/bokeh-{BOKEH_VERSION}-py3-none-any.whl'
PYODIDE_URL = 'https://cdn.jsdelivr.net/pyodide/v0.23.0/full/pyodide.js'
PYSCRIPT_CSS = '<link rel="stylesheet" href="https://pyscript.net/releases/2022.12.1/pyscript.css" />'
PYSCRIPT_JS = '<script defer src="https://pyscript.net/releases/2022.12.1/pyscript.js"></script>'
PYODIDE_URL = f'https://cdn.jsdelivr.net/pyodide/{PYODIDE_VERSION}/full/pyodide.js'
PYODIDE_PYC_URL = f'https://cdn.jsdelivr.net/pyodide/{PYODIDE_VERSION}/pyc/pyodide.js'
PYSCRIPT_CSS = f'<link rel="stylesheet" href="https://pyscript.net/releases/{PYSCRIPT_VERSION}/pyscript.css" />'
PYSCRIPT_JS = f'<script defer src="https://pyscript.net/releases/{PYSCRIPT_VERSION}/pyscript.js"></script>'
PYODIDE_JS = f'<script src="{PYODIDE_URL}"></script>'
PYODIDE_PYC_JS = f'<script src="{PYODIDE_URL}"></script>'

MINIMUM_VERSIONS = {}

Expand Down Expand Up @@ -290,14 +294,14 @@ def script_to_html(
'loading_spinner': config.loading_spinner
})
web_worker = WEB_WORKER_TEMPLATE.render({
'PYODIDE_URL': PYODIDE_URL,
'PYODIDE_URL': PYODIDE_PYC_URL,
'env_spec': env_spec,
'code': code
})
plot_script = wrap_in_script_tag(worker_handler)
else:
if js_resources == 'auto':
js_resources = [PYODIDE_JS]
js_resources = [PYODIDE_PYC_JS]
script_template = _pn_env.from_string(PYODIDE_SCRIPT)
plot_script = script_template.render({
'env_spec': env_spec,
Expand Down

0 comments on commit 0141f5e

Please sign in to comment.