git: 8837f442afe3 - main - www/py-bokeh: Update 2.4.3 => 3.10.1

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Mon, 19 Oct 2026 09:32:15 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8837f442afe3d394784472cebde8c41d3902c26e

commit 8837f442afe3d394784472cebde8c41d3902c26e
Author:     Pattems <patrick@crandol.com>
AuthorDate: 2026-10-18 03:10:01 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-19 09:31:50 +0000

    www/py-bokeh: Update 2.4.3 => 3.10.1
    
    bokeh 2.4.3 uses np.bool8, which numpy 2 removed, so
    "import bokeh.plotting" fails with the numpy 2.4 in the tree.  It is
    also too old for its consumers: dask[diagnostics] and the distributed
    dashboard need bokeh>=3.1, arviz-plots needs bokeh>=3.4 and hits needs
    bokeh>=3.2.
    
    - Switch to PEP 517; the sdist ships the prebuilt BokehJS, so no node
      is needed
    - Add RUN_DEPENDS on narwhals and xyzservices; drop python-dateutil,
      six and typing-extensions; tornado>=6.2
    - Patch pyproject.toml for setuptools 63 (requires, PEP 639 license)
      and do not install the stray top-level "typings" stub package
    - Guard the setuptools>=64-only editable_wheel import in setup.py
    - Requires Python 3.12+
    
    Changelog:      https://docs.bokeh.org/en/latest/docs/releases.html
---
 www/py-bokeh/Makefile                   | 26 +++++++++++-----------
 www/py-bokeh/distinfo                   |  6 +++---
 www/py-bokeh/files/patch-pyproject.toml | 33 ++++++++++++++++++++++++++++
 www/py-bokeh/files/patch-setup.py       | 38 +++++++++++++++++++++++++++++++++
 www/py-bokeh/pkg-message                |  3 +++
 5 files changed, 91 insertions(+), 15 deletions(-)

diff --git a/www/py-bokeh/Makefile b/www/py-bokeh/Makefile
index a8f5c8e18075..63ee1014caf6 100644
--- a/www/py-bokeh/Makefile
+++ b/www/py-bokeh/Makefile
@@ -1,29 +1,31 @@
 PORTNAME=	bokeh
-PORTVERSION=	2.4.3
-PORTREVISION=	7
+PORTVERSION=	3.10.1
 CATEGORIES=	www python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	pkubaj@FreeBSD.org
 COMMENT=	Interactive Web Plotting for Python
-WWW=		https://bokeh.pydata.org/
+WWW=		https://bokeh.org/ \
+		https://github.com/bokeh/bokeh
 
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}Jinja2>=2.7:devel/py-Jinja2@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}numpy>=1.16:math/py-numpy@${PY_FLAVOR} \
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools-git-versioning>=0:devel/py-setuptools-git-versioning@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools>=61:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS=	${PY_PILLOW} \
+		${PYTHON_PKGNAMEPREFIX}Jinja2>=2.9:devel/py-Jinja2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}narwhals>=1.13:math/py-narwhals@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1:math/py-numpy@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}packaging>=16.8:devel/py-packaging@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}python-dateutil>=2.1:devel/py-python-dateutil@${PY_FLAVOR} \
-		${PY_PILLOW} \
 		${PYTHON_PKGNAMEPREFIX}pyyaml>=3.10:devel/py-pyyaml@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}six>=1.5.2:devel/py-six@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}tornado>=5:www/py-tornado@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.7.4:devel/py-typing-extensions@${PY_FLAVOR}
+		${PYTHON_PKGNAMEPREFIX}tornado>=6.2:www/py-tornado@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}xyzservices>=2021.09.1:www/py-xyzservices@${PY_FLAVOR}
 
-USES=		python
-USE_PYTHON=	autoplist distutils concurrent
+USES=		python:3.12+
+USE_PYTHON=	autoplist concurrent pep517
 
 NO_ARCH=	yes
 
diff --git a/www/py-bokeh/distinfo b/www/py-bokeh/distinfo
index 80d22cf22ee4..8bca7b36db8f 100644
--- a/www/py-bokeh/distinfo
+++ b/www/py-bokeh/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1655449584
-SHA256 (bokeh-2.4.3.tar.gz) = ef33801161af379665ab7a34684f2209861e3aefd5c803a21fbbb99d94874b03
-SIZE (bokeh-2.4.3.tar.gz) = 17722836
+TIMESTAMP = 1792293001
+SHA256 (bokeh-3.10.1.tar.gz) = e1dc21c4fa02f793b7c6acb2b439311924f46912b1d1ae1c7b058f8245b54fe8
+SIZE (bokeh-3.10.1.tar.gz) = 6053211
diff --git a/www/py-bokeh/files/patch-pyproject.toml b/www/py-bokeh/files/patch-pyproject.toml
new file mode 100644
index 000000000000..e06d1d6f57a3
--- /dev/null
+++ b/www/py-bokeh/files/patch-pyproject.toml
@@ -0,0 +1,33 @@
+Description: Relax the setuptools build requirement, use the PEP 621 license
+  table for the ports tree's setuptools 63 and only package bokeh.
+Issue ID: none
+Changeset: none
+TODO: FreeBSD-specific (old setuptools in ports), not for upstream.
+
+--- pyproject.toml.orig	2026-10-12 00:55:10 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools>=77", "setuptools-git-versioning", "colorama"]
++requires = ["setuptools>=61", "setuptools-git-versioning"]
+ build-backend = "setuptools.build_meta"
+ 
+ [project]
+@@ -22,8 +22,7 @@ authors = [
+   {email = "info@bokeh.org"},
+   {name = "Bokeh Team"}
+ ]
+-license = "BSD-3-Clause"
+-license-files = ["LICENSE.txt"]
++license = {text = "BSD-3-Clause"}
+ classifiers = [
+     "Development Status :: 5 - Production/Stable",
+     "Environment :: Console",
+@@ -78,6 +77,7 @@ where = ["src"]
+ 
+ [tool.setuptools.packages.find]
+ where = ["src"]
++include = ["bokeh", "bokeh.*"]
+ 
+ [tool.setuptools-git-versioning]
+ enabled = true
diff --git a/www/py-bokeh/files/patch-setup.py b/www/py-bokeh/files/patch-setup.py
new file mode 100644
index 000000000000..bd6cc739a3d0
--- /dev/null
+++ b/www/py-bokeh/files/patch-setup.py
@@ -0,0 +1,38 @@
+Description: Make the editable_wheel hook optional; the ports tree's
+  setuptools 63 does not have it.
+Issue ID: none
+Changeset: none
+TODO: FreeBSD-specific (old setuptools in ports), not for upstream.
+
+--- setup.py.orig	2026-10-12 00:55:10 UTC
++++ setup.py
+@@ -17,7 +17,10 @@ from setuptools.command.build import build  # type: ig
+ # External imports
+ from setuptools import setup  # type: ignore[import]
+ from setuptools.command.build import build  # type: ignore[import]
+-from setuptools.command.editable_wheel import editable_wheel  # type: ignore[import]
++try:
++    from setuptools.command.editable_wheel import editable_wheel  # type: ignore[import]
++except ImportError:  # setuptools < 64
++    editable_wheel = None
+ from setuptools.command.sdist import sdist  # type: ignore[import]
+ 
+ # --- Helpers ----------------------------------------------------------------
+@@ -162,7 +165,7 @@ class Build(build):  # type: ignore
+         build_or_install_bokehjs(self.distribution.packages)
+         super().run()
+ 
+-class EditableWheel(editable_wheel):  # type: ignore
++class EditableWheel(editable_wheel or object):  # type: ignore
+     def run(self) -> None:
+         check_tags()
+         build_or_install_bokehjs(self.distribution.packages)
+@@ -174,4 +177,7 @@ class Sdist(sdist):  # type: ignore
+         build_or_install_bokehjs(self.distribution.packages)
+         super().run()
+ 
+-setup(cmdclass={"build": Build, "editable_wheel": EditableWheel, "sdist": Sdist})
++cmdclass = {"build": Build, "sdist": Sdist}
++if editable_wheel is not None:
++    cmdclass["editable_wheel"] = EditableWheel
++setup(cmdclass=cmdclass)
diff --git a/www/py-bokeh/pkg-message b/www/py-bokeh/pkg-message
index f28d10a413fa..6af9e67504b1 100644
--- a/www/py-bokeh/pkg-message
+++ b/www/py-bokeh/pkg-message
@@ -3,6 +3,9 @@
   message: <<EOM
 Install the following software to enable extra features:
 
+contourpy
+    Necessary for the contour() glyph method of bokeh.plotting figures.
+
 Jupyter
     Bokeh can display content in classic Jupyter notebooks as well as in
     JupyterLab. Depending on your setup, there may be additional packages or