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

Support for Bokeh 3.4 #6072

Merged
merged 32 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
70147af
Update Bokeh pins
hoxbro Dec 18, 2023
1170857
Update to work with resource.url
hoxbro Dec 18, 2023
23cbde8
comment out CustomSelect for now
hoxbro Dec 18, 2023
522e5f8
Update test channel
hoxbro Dec 18, 2023
83a948c
UI test label dev too
hoxbro Dec 18, 2023
171f100
Fix easy failing tests
hoxbro Dec 18, 2023
1c44472
Merge branch 'main' into bokeh34
hoxbro Jan 24, 2024
990f27b
Clean up string
hoxbro Jan 24, 2024
b360a90
Update bokeh pin
hoxbro Jan 24, 2024
90b6eb5
Update package.json
hoxbro Jan 24, 2024
3ff2f1d
Update to work with Bokeh 3.4.0
hoxbro Jan 24, 2024
1299bba
Use URL for bundles to fix autoload.js
hoxbro Jan 24, 2024
f454c93
Use pytest.mark.asyncio for test
hoxbro Jan 24, 2024
23d60c7
Handle URL in notebooks
hoxbro Jan 24, 2024
c4d2dac
Hack around Bokeh setting this.input_el.id
hoxbro Jan 24, 2024
718f4fa
Convert URL to str if needed
hoxbro Jan 24, 2024
deada7d
Comment out pytest.mark.asyncio line
hoxbro Jan 24, 2024
e9d3b81
Use custom encoder to handle URL
hoxbro Jan 24, 2024
5df388b
Remove pytest.mark.asyncio from tests
hoxbro Jan 24, 2024
7f0247d
Update panel/io/resources.py
hoxbro Jan 24, 2024
faddd2e
Use PaletteSelect
hoxbro Jan 24, 2024
f7440ed
Fix indentation in file_download.ts
hoxbro Jan 25, 2024
bc386fe
Update setup.py
hoxbro Jan 25, 2024
a717d9c
Update setup.py
hoxbro Jan 25, 2024
f4455b3
Try pin playwright
hoxbro Jan 25, 2024
b92ae61
Remove playwright pin again
hoxbro Jan 29, 2024
9ba3d7a
Temporarily disable reruns in UI
hoxbro Jan 29, 2024
9980b02
Upgrade to bokeh 3.4.0-dev.8
mattpap Feb 15, 2024
816ed20
Fix tsconfig.json
mattpap Feb 12, 2024
c1056b5
Rename rebuild() -> update_children()
mattpap Feb 15, 2024
6bd6a3c
Re-activate reruns for UI tests
hoxbro Feb 15, 2024
d0a03b1
Fix tests
philippjfr Feb 16, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
with:
name: unit_test_suite
python-version: ${{ matrix.python-version }}
channels: pyviz/label/dev,numba,bokeh,conda-forge,nodefaults
channels: pyviz/label/dev,numba,bokeh/label/dev,conda-forge,nodefaults
conda-update: true
nodejs: true
envs: -o examples -o recommended -o tests -o build
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
with:
name: ui_test_suite
python-version: 3.9
channels: pyviz/label/dev,bokeh,conda-forge,nodefaults
channels: pyviz/label/dev,bokeh/label/dev,conda-forge,nodefaults
envs: "-o recommended -o tests -o build"
cache: true
nodejs: true
Expand Down
4 changes: 4 additions & 0 deletions panel/io/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ def bundle_resources(roots, resources, notebook=False, reloading=False, enable_m
elif mode == "server":
for bundle in extensions:
server_url = bundle.server_url
if not isinstance(server_url, str): # Bokeh 3.4.0.dev4 uses bokeh.embed.bundle.URL
server_url = server_url.url
if resources.root_url and not resources.absolute:
server_url = server_url.replace(resources.root_url, '', 1)
if state.rel_path:
Expand Down Expand Up @@ -600,6 +602,8 @@ def adjust_paths(self, resources):
new_resources = []
cdn_base = f'{config.npm_cdn}/@holoviz/panel@{JS_VERSION}/dist/'
for resource in resources:
if not isinstance(resource, str): # Bokeh 3.4.0.dev4 uses bokeh.embed.bundle.URL
resource = resource.url
hoxbro marked this conversation as resolved.
Show resolved Hide resolved
resource = resource.replace('https://unpkg.com', config.npm_cdn)
if resource.startswith(cdn_base):
resource = resource.replace(cdn_base, CDN_DIST)
Expand Down
2 changes: 1 addition & 1 deletion panel/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export {Card} from "./card"
export {CheckboxButtonGroup} from "./checkbox_button_group"
export {Column} from "./column"
export {CommManager} from "./comm_manager"
export {CustomSelect} from "./customselect"
// export {CustomSelect} from "./customselect"
export {DataTabulator} from "./tabulator"
export {DatetimePicker} from "./datetime_picker"
export {DeckGLPlot} from "./deckgl"
Expand Down
2 changes: 1 addition & 1 deletion panel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/holoviz/panel.git"
},
"dependencies": {
"@bokeh/bokehjs": "~3.3.1",
"@bokeh/bokehjs": "~3.4.0.dev4",
"@luma.gl/constants": "^8.0.3",
"@types/debounce": "^1.2.0",
"@types/gl-matrix": "^2.4.5",
Expand Down
15 changes: 8 additions & 7 deletions panel/tests/io/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

from pathlib import Path

import bokeh

from packaging.version import Version

from panel.config import config, panel_extension as extension
from panel.io.convert import BOKEH_VERSION
from panel.io.resources import (
CDN_DIST, DIST_DIR, PANEL_DIR, Resources, resolve_custom_path,
set_resource_mode,
)
from panel.io.state import set_curdoc
from panel.widgets import Button

bokeh_version = Version(BOKEH_VERSION)
bokeh_version = Version(bokeh.__version__)
if bokeh_version.is_devrelease or bokeh_version.is_prerelease:
bk_prefix = 'dev'
else:
Expand Down Expand Up @@ -41,11 +42,11 @@ def test_resources_cdn():
resources = Resources(mode='cdn', minified=True)
assert resources.js_raw == ['Bokeh.set_log_level("info");']
assert resources.js_files == [
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-{BOKEH_VERSION}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-gl-{BOKEH_VERSION}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-widgets-{BOKEH_VERSION}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-tables-{BOKEH_VERSION}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-mathjax-{BOKEH_VERSION}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-{bokeh_version}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-gl-{bokeh_version}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-widgets-{bokeh_version}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-tables-{bokeh_version}.min.js',
f'https://cdn.bokeh.org/bokeh/{bk_prefix}/bokeh-mathjax-{bokeh_version}.min.js',
]

def test_resources_server_absolute():
Expand Down
5 changes: 3 additions & 2 deletions panel/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@

log = logging.getLogger('panel.util')

bokeh_version = Version(bokeh.__version__)
bokeh_version = Version(Version(bokeh.__version__).base_version)

# Bokeh serializes NaT as this value
# Discussion on why https://github.com/bokeh/bokeh/pull/10449/files#r479988469
BOKEH_JS_NAT = -9223372036854776.0
# Improved in Bokeh 3.4: https://github.com/bokeh/bokeh/pull/13606
BOKEH_JS_NAT = -9223372036854776.0 if bokeh_version < Version("3.4") else np.nan

PARAM_NAME_PATTERN = re.compile(r'^.*\d{5}$')

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"param >=2.0.0",
"pyct >=0.4.4",
"setuptools >=42",
"bokeh >=3.3.0,<3.4.0",
"bokeh ==3.4.0.dev4",
"pyviz_comms >=0.7.4",
"requests",
"bleach",
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def run(self):
########## dependencies ##########

install_requires = [
'bokeh >=3.2.0,<3.4.0',
'bokeh >=3.2.0,<3.5.0',
'param >=2.0.0,<3.0',
'pyviz_comms >=2.0.0',
'xyzservices >=2021.09.1', # Bokeh dependency, but pyodide 23.0.0 does not always pick it up
Expand Down Expand Up @@ -234,7 +234,7 @@ def run(self):
'setuptools >=42',
'requests',
'packaging',
'bokeh >=3.3.0,<3.4.0',
"bokeh ==3.4.0.dev4",
hoxbro marked this conversation as resolved.
Show resolved Hide resolved
'pyviz_comms >=2.0.0',
'bleach',
'markdown',
Expand Down
Loading