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

COMPAT: Bokeh 3.6 and add minimal test for Bokeh 3.5 #7322

Merged
merged 18 commits into from
Sep 27, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
environment: ["test-core"]
environment: ["test-core", "test-minimum"]
timeout-minutes: 120
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_install@v0
Expand Down
2 changes: 0 additions & 2 deletions doc/how_to/integrations/FastAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pip install panel[fastapi]
```bash
conda install -c conda-forge bokeh-fastapi
```

Note: As of September 24th 2024 this is waiting on [conda-forge/staged-recipes#27575](https://github.com/conda-forge/staged-recipes/pull/27575).
:::

::::
Expand Down
3 changes: 2 additions & 1 deletion panel/models/tabulator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {undisplay} from "@bokehjs/core/dom"
import {sum} from "@bokehjs/core/util/arrayable"
import {isArray, isBoolean, isString, isNumber} from "@bokehjs/core/util/types"
import {ModelEvent} from "@bokehjs/core/bokeh_events"
import {div} from "@bokehjs/core/dom"
Expand Down Expand Up @@ -80,7 +81,7 @@ function summarize(grouped: any[], columns: any[], aggregators: string[], depth:
const subsummary = summarize(group._children, columns, aggregators, depth+1)
for (const col in subsummary) {
if (isArray(subsummary[col])) {
group[col] = subsummary[col].reduce((a: any, b: any) => a + b, 0) / subsummary[col].length
group[col] = sum(subsummary[col] as number[]) / subsummary[col].length
} else {
group[col] = subsummary[col]
}
Expand Down
68 changes: 34 additions & 34 deletions panel/package-lock.json

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

4 changes: 2 additions & 2 deletions panel/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@holoviz/panel",
"version": "1.5.1-a.1",
"version": "1.5.1-a.2",
"description": "The powerful data exploration & web app framework for Python.",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/holoviz/panel.git"
},
"dependencies": {
"@bokeh/bokehjs": "3.5.2",
"@bokeh/bokehjs": "3.6.0",
"@types/debounce": "^1.2.0",
"@types/gl-matrix": "^2.4.5",
"ace-code": "^1.24.1",
Expand Down
11 changes: 7 additions & 4 deletions panel/tests/ui/widgets/test_tabulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from panel.layout.base import Column
from panel.models.tabulator import _TABULATOR_THEMES_MAPPING
from panel.tests.util import get_ctrl_modifier, serve_component, wait_until
from panel.util import BOKEH_GE_3_6
from panel.widgets import Select, Tabulator, TextInput

pytestmark = pytest.mark.ui
Expand Down Expand Up @@ -366,10 +367,12 @@

serve_component(page, widget)

expect(page.locator('text="A"')).to_have_attribute(
"style",
"font-weight: bold; text-align: center; color: rgb(255, 0, 0);"
)
if BOKEH_GE_3_6:
style = "font-weight: bold; text-align: center; color: red;"
else:
style = "font-weight: bold; text-align: center; color: rgb(255, 0, 0);"

expect(page.locator('text="A"')).to_have_attribute("style", style)


def test_tabulator_formatters_bokeh_html_multiple_columns(page, df_mixed):
Expand Down Expand Up @@ -2829,7 +2832,7 @@
cell = page.locator('text="B"').first
cell.click()
editable_cell = page.locator('input[type="text"]')
editable_cell.fill("Q")

Check failure on line 2835 in panel/tests/ui/widgets/test_tabulator.py

View workflow job for this annotation

GitHub Actions / ui:test-ui:macos-latest

test_tabulator_edit_event_and_header_filters_same_column_pagination[local] playwright._impl._errors.TimeoutError: Locator.fill: Timeout 20000ms exceeded. Call log: waiting for locator("input[type=\"text\"]")
editable_cell.press('Enter')

wait_until(lambda: len(values) == 1, page)
Expand Down
1 change: 1 addition & 0 deletions panel/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
log = logging.getLogger('panel.util')

bokeh_version = Version(Version(bokeh.__version__).base_version)
BOKEH_GE_3_6 = bokeh_version >= Version('3.6')

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

Expand Down
22 changes: 15 additions & 7 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "panel"
channels = ["pyviz/label/dev", "bokeh", "conda-forge"]
channels = ["pyviz/label/dev", "bokeh/label/rc", "conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]

[activation.env]
Expand All @@ -16,6 +16,7 @@ test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit-
test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"]
test-ui = ["py312", "test-core", "test", "test-ui"]
test-core = ["py313", "test-core", "test-unit-task"]
test-minimum = ["py310", "test-core", "test-unit-task", "test-minimum"]
test-type = ["py311", "type"]
docs = ["py311", "example", "doc"]
build = ["py311", "build"]
Expand All @@ -28,7 +29,7 @@ nomkl = "*"
pip = "*"
# Required
bleach = "*"
bokeh = ">=3.5.0,<3.6.0"
bokeh = ">=3.5.0,<3.7.0"
linkify-it-py = "*"
markdown = "*"
markdown-it-py = "*"
Expand All @@ -52,7 +53,7 @@ python = "3.11.*"
python = "3.12.*"

[feature.py313]
channels = ["pyviz/label/dev", "conda-forge/label/python_rc", "conda-forge"]
channels = ["pyviz/label/dev", "bokeh/label/rc", "conda-forge/label/python_rc", "conda-forge"]

[feature.py313.dependencies]
python = "3.13.*"
Expand Down Expand Up @@ -113,6 +114,15 @@ pytest-github-actions-annotate-failures = "*"
pytest-rerunfailures = "*"
pytest-xdist = "*"

[feature.test-minimum.dependencies]
# Lower pin of required dependencies
bokeh = "3.5.*"
# numpy = "1.21.*"
# pandas = "1.3.*" # Pandas 1.2 is not available for Python 3.10
# param = "2.1.*"
# pyviz_comms = "2.0.*"
# tqdm = "4.48.*"

[feature.test.dependencies]
# Optional dependencies - recommended
holoviews = ">=1.16.0"
Expand All @@ -125,6 +135,7 @@ watchfiles = "*"
# Test dependencies
altair = "*"
anywidget = "*"
bokeh-fastapi = "*"
bokeh_sampledata = "*"
diskcache = "*"
fastapi = "*"
Expand All @@ -137,9 +148,6 @@ reacton = "*"
scipy = "*"
textual = "*"

[feature.test.pypi-dependencies]
bokeh-fastapi = "~=0.1.0a0"

[feature.test-unit-task.tasks] # So it is not showing up in the test-ui environment
test-unit = 'pytest panel/tests -n logical --dist loadgroup'
test-subprocess = 'pytest panel/tests --subprocess'
Expand All @@ -152,7 +160,7 @@ test-example = 'pytest -n logical --dist loadscope --nbval-lax examples'
nbval = "*"

[feature.test-ui]
channels = ["pyviz/label/dev", "bokeh", "microsoft", "conda-forge"]
channels = ["pyviz/label/dev", "bokeh/label/rc", "microsoft", "conda-forge"]

[feature.test-ui.dependencies]
playwright = { version = "*", channel = "microsoft" }
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"hatchling",
"hatch-vcs",
"param >=2.1.0",
"bokeh >=3.5.0,<3.6.0",
"bokeh >=3.5.0,<3.7.0",
"pyviz_comms >=0.7.4",
"requests",
"packaging",
Expand Down Expand Up @@ -48,7 +48,7 @@ classifiers = [
]

dependencies = [
'bokeh >=3.5.0,<3.6.0',
'bokeh >=3.5.0,<3.7.0',
'param >=2.1.0,<3.0',
'pyviz_comms >=2.0.0',
'markdown',
Expand Down
Loading