Skip to content

Commit 2a4dfd4

Browse files
hoxbrophilippjfr
andauthored
compat: Bokeh 3.10.0 (#8716)
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
1 parent be0b5e2 commit 2a4dfd4

41 files changed

Lines changed: 928 additions & 407 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
env:
2020
NODE_VERSION: "24"
2121
PACKAGE: "panel"
22-
PYTHON_VERSION: "3.10"
22+
PYTHON_VERSION: "3.12"
2323

2424
jobs:
2525
waiting_room:

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,23 @@ jobs:
114114
run: |
115115
MATRIX=$(jq -nsc '{
116116
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
117-
"environment": ["test-310", "test-314"]
117+
"environment": ["test-312", "test-314"]
118118
}')
119119
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
120120
- name: Set test matrix with 'full' option
121121
if: env.MATRIX_OPTION == 'full'
122122
run: |
123123
MATRIX=$(jq -nsc '{
124124
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
125-
"environment": ["test-310", "test-311", "test-312", "test-313", "test-314"]
125+
"environment": ["test-312", "test-313", "test-314"]
126126
}')
127127
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
128128
- name: Set test matrix with 'downstream' option
129129
if: env.MATRIX_OPTION == 'downstream'
130130
run: |
131131
MATRIX=$(jq -nsc '{
132132
"os": ["ubuntu-latest"],
133-
"environment": ["test-310"]
133+
"environment": ["test-312"]
134134
}')
135135
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
136136
@@ -256,7 +256,7 @@ jobs:
256256
fail-fast: false
257257
matrix:
258258
os: ["ubuntu-latest"]
259-
environment: ["test-core", "test-bokeh38"]
259+
environment: ["test-core"]
260260
timeout-minutes: 30
261261
steps:
262262
- uses: holoviz-dev/holoviz_tasks/pixi-install@11eb638302f76ec64217e2eeddfb11df1f788b54 # v1.0.2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,4 @@ panel/_version.py
164164
.uicoveragerc
165165
mario_button.*
166166
counter_button.*
167+
/.claude/skills/developing-with-holoviz/skills/panel/reviewing-panel-apps.md

panel/_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from param import Parameter, _is_number
77

88
AlignmentType = t.Literal["auto", "start", "center", "end"]
9-
Alignment = enumeration(AlignmentType)
9+
Alignment = enumeration(*t.get_args(AlignmentType))
1010
MarginType: t.TypeAlias = int | tuple[int, int] | tuple[int, int, int, int]
1111

1212

panel/command/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def main(args: list[str] | None = None):
9595
raise e
9696
die("ERROR: " + str(e))
9797
else:
98-
ret = bokeh_entry_point()
98+
bokeh_entry_point()
99+
ret = None
99100
else:
100101
parser.parse_args(sys.argv[1:])
101102
sys.exit(1)

panel/command/serve.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,13 @@ def setup_file():
461461
if args.warm or config.autoreload:
462462
argvs = {f: args.args for f in files}
463463
applications = build_single_handler_applications(files, argvs)
464-
initialize_session = not (args.num_procs != 1 and sys.version_info < (3, 12))
465464
if config.autoreload:
466465
with record_modules(list(applications.values())):
467466
self.warm_applications(
468-
applications, args.reuse_sessions, error=False, initialize_session=initialize_session, index=kwargs['index']
467+
applications, args.reuse_sessions, error=False, index=kwargs['index']
469468
)
470469
else:
471-
self.warm_applications(applications, args.reuse_sessions, initialize_session=initialize_session, index=kwargs['index'])
470+
self.warm_applications(applications, args.reuse_sessions, index=kwargs['index'])
472471

473472
# Disable Tornado's autoreload
474473
if args.dev:

panel/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import typing as t
1616
import warnings
1717

18-
from concurrent.futures import ThreadPoolExecutor
1918
from contextlib import contextmanager
2019
from weakref import WeakKeyDictionary
2120

@@ -397,15 +396,16 @@ def __init__(self, **params):
397396

398397
@param.depends('_nthreads', watch=True, on_init=True)
399398
def _set_thread_pool(self):
399+
from .io.state import _SharedThreadPoolExecutor
400400
if self.nthreads is None:
401401
if state._thread_pool is not None:
402-
state._thread_pool.shutdown(wait=False)
402+
state._thread_pool.shutdown(wait=False, _shared=False)
403403
state._thread_pool = None
404404
return
405405
if state._thread_pool:
406406
raise RuntimeError("Thread pool already running")
407407
threads = self.nthreads if self.nthreads else None
408-
state._thread_pool = ThreadPoolExecutor(max_workers=threads)
408+
state._thread_pool = _SharedThreadPoolExecutor(max_workers=threads)
409409

410410
@param.depends('notifications', watch=True)
411411
def _setup_notifications(self):

panel/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def _get_model(
571571
parent: Model | None = None, comm: Comm | None = None
572572
) -> Model:
573573
props = self._get_properties(doc)
574-
model = self._bokeh_model(**props)
574+
model = self._bokeh_model(**props) # type: ignore[abstract]
575575
root = root or model
576576
children, _ = self._get_children(model.data, doc, root, model, comm)
577577
model.data.update(**children)

panel/entry_points.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@
1010

1111

1212
def entry_points_for(group: str) -> Iterator[importlib.metadata.EntryPoint]:
13-
try:
14-
eps = importlib.metadata.entry_points(group=group)
15-
except TypeError:
16-
# Load-time selection requires Python >= 3.10 or importlib_metadata >= 3.6,
17-
# so we'll retain this fallback logic for some time to come. See also
18-
# https://importlib-metadata.readthedocs.io/en/latest/using.html
19-
eps = importlib.metadata.entry_points().get(group, []) # type: ignore[arg-type]
20-
yield from eps
13+
yield from importlib.metadata.entry_points(group=group)
2114

2215

2316
def load_entry_points(group: str) -> None:

panel/io/callbacks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ def start(self):
172172
self._start_time = time.time()
173173
if state.curdoc and state.curdoc.session_context and not state._is_pyodide and self.session_scoped:
174174
self._doc = state.curdoc
175-
if state._unblocked(state.curdoc):
176-
self._cb = self._doc.add_periodic_callback(self._periodic_callback, self.period)
177-
else:
178-
self._doc.add_next_tick_callback(self.start)
179-
elif state._thread_id and state._thread_id != state._current_thread:
175+
# Bokeh schedules periodic callbacks in a threadsafe manner so we
176+
# can register directly even when initialization runs on a worker
177+
# thread rather than the server event loop thread.
178+
self._cb = self._doc.add_periodic_callback(self._periodic_callback, self.period)
179+
elif not state._on_loop_thread:
180180
state.execute(self.start, schedule=True)
181181
else:
182182
try:

0 commit comments

Comments
 (0)