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

Fix pyscript wasm example #5771

Merged
merged 3 commits into from
Oct 29, 2023
Merged
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
14 changes: 11 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

import panel

from panel.io.convert import BOKEH_VERSION, MINIMUM_VERSIONS, PY_VERSION
from panel.io.convert import (
BOKEH_VERSION, MINIMUM_VERSIONS, PY_VERSION, PYODIDE_VERSION,
PYSCRIPT_VERSION,
)
from panel.io.resources import CDN_DIST

PANEL_ROOT = pathlib.Path(panel.__file__).parent
Expand Down Expand Up @@ -202,13 +205,18 @@ def patched_card_run(self):

CardDirective.run = patched_card_run

def _get_pyodide_version():
if PYODIDE_VERSION.startswith("v"):
return PYODIDE_VERSION[1:]
raise NotImplementedError(F"{PYODIDE_VERSION=} is not valid")

def update_versions(app, docname, source):
# Inspired by: https://stackoverflow.com/questions/8821511
version_replace = {
"{{PANEL_VERSION}}" : PY_VERSION,
"{{BOKEH_VERSION}}" : BOKEH_VERSION,
"{{PYSCRIPT_VERSION}}" : "2022.12.1",
"{{PYODIDE_VERSION}}" : "0.23.4",
"{{PYSCRIPT_VERSION}}" : PYSCRIPT_VERSION,
"{{PYODIDE_VERSION}}" : _get_pyodide_version(),
}

for old, new in version_replace.items():
Expand Down
2 changes: 1 addition & 1 deletion doc/how_to/wasm/standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Once installed you will be able to `import panel` in your `<py-script>` tag. Aga
<body>
<py-config>
packages = [
"https://cdn.holoviz.org/panel/{{PANEL_VERSION}}/dist/wheels/bokeh-{{BOKEH_VERSION}}-py3-none-any.whl"
"https://cdn.holoviz.org/panel/{{PANEL_VERSION}}/dist/wheels/bokeh-{{BOKEH_VERSION}}-py3-none-any.whl",
"https://cdn.holoviz.org/panel/{{PANEL_VERSION}}/dist/wheels/panel-{{PANEL_VERSION}}-py3-none-any.whl"
]
</py-config>
Expand Down
4 changes: 2 additions & 2 deletions panel/io/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
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.03.1'
PYODIDE_VERSION = 'v0.24.1'
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'
Expand Down
Loading