public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: dev-python/panel/, dev-python/panel/files/
@ 2023-01-15 17:25 Horea Christian
  0 siblings, 0 replies; only message in thread
From: Horea Christian @ 2023-01-15 17:25 UTC (permalink / raw
  To: gentoo-commits

commit:     5857ad8b9eb2c589505e2ae90f4492af4907cf56
Author:     Horea Christian <chr <AT> chymera <DOT> eu>
AuthorDate: Sun Jan 15 17:24:02 2023 +0000
Commit:     Horea Christian <horea.christ <AT> gmail <DOT> com>
CommitDate: Sun Jan 15 17:24:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=5857ad8b

dev-python/panel: add 0.14.1, 0.14.2

Also replaced sed with PATCH to respect Python syntax

Signed-off-by: Horea Christian <chr <AT> chymera.eu>

 .../files/panel-0.14.1-disable_lite_build.patch    | 47 ++++++++++++++++++
 dev-python/panel/panel-0.14.1.ebuild               | 55 ++++++++++++++++++++++
 dev-python/panel/panel-0.14.2.ebuild               | 55 ++++++++++++++++++++++
 3 files changed, 157 insertions(+)

diff --git a/dev-python/panel/files/panel-0.14.1-disable_lite_build.patch b/dev-python/panel/files/panel-0.14.1-disable_lite_build.patch
new file mode 100644
index 000000000..387cfb61b
--- /dev/null
+++ b/dev-python/panel/files/panel-0.14.1-disable_lite_build.patch
@@ -0,0 +1,47 @@
+Subject: Prevent Panel from violating network sandboxing.
+
+     * By default, "setup.py" invokes "npm" to rebuild Node.js packages bundled with Panel.
+     * Without this patch we get `error: HTTPSConnectionPool`
+     * A `sed` fix of the `_build_paneljs()` line will break the syntax.
+     * Using the `PANEL_LITE_BUILD` variable might do the trick instead of a patch, but thus far it didn't 
+Author: Horea Christian <gentoo@chymera.eu>
+diff --git a/setup.py b/setup.py
+index d2541dfb..8cfbf933 100644
+--- a/setup.py
++++ b/setup.py
+@@ -54,8 +54,6 @@ class CustomDevelopCommand(develop):
+     """Custom installation for development mode."""
+
+     def run(self):
+-        if not PANEL_LITE_BUILD:
+-            _build_paneljs()
+         develop.run(self)
+
+
+@@ -63,8 +61,6 @@ class CustomInstallCommand(install):
+     """Custom installation for install mode."""
+
+     def run(self):
+-        if not PANEL_LITE_BUILD:
+-            _build_paneljs()
+         install.run(self)
+
+
+@@ -72,8 +68,6 @@ class CustomSdistCommand(sdist):
+     """Custom installation for sdist mode."""
+
+     def run(self):
+-        if not PANEL_LITE_BUILD:
+-            _build_paneljs()
+         sdist.run(self)
+
+
+@@ -92,8 +86,6 @@ try:
+
+         def run(self):
+             """Do nothing so the command intentionally fails."""
+-            if not PANEL_LITE_BUILD:
+-                _build_paneljs()
+             bdist_wheel.run(self)
+
+     _COMMANDS['bdist_wheel'] = CustomBdistWheelCommand

diff --git a/dev-python/panel/panel-0.14.1.ebuild b/dev-python/panel/panel-0.14.1.ebuild
new file mode 100644
index 000000000..aa535f46f
--- /dev/null
+++ b/dev-python/panel/panel-0.14.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..10} )
+
+# Panel imports from "distutils" at runtime.
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="High-level app and dashboarding solution for Python"
+HOMEPAGE="https://panel.holoviz.org"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# "setup.py" imports from Bokeh to rebuild Node.js packages, but we patch that
+# away below. Our patched Panel thus requires Bokeh only at runtime.
+DEPEND="
+	>=dev-python/param-1.10.0[${PYTHON_USEDEP}]
+	>=dev-python/pyct-0.4.4[${PYTHON_USEDEP}]
+"
+RDEPEND="${DEPEND}
+	dev-python/markdown[${PYTHON_USEDEP}]
+	dev-python/requests[${PYTHON_USEDEP}]
+	dev-python/tqdm[${PYTHON_USEDEP}]
+	>=dev-python/bokeh-2.3.0[${PYTHON_USEDEP}]
+	>=dev-python/pyviz_comms-0.7.4[${PYTHON_USEDEP}]
+	>=net-libs/nodejs-15.11.0
+"
+
+PATCHES=( "${FILESDIR}/${P}-disable_lite_build.patch" )
+
+src_prepare() {
+	# Install Jupyter configuration files to "/etc" rather than "/usr/etc".
+	sed -i -e 's~"etc/jupyter~"/etc/jupyter~' setup.py || die
+
+	default_src_prepare
+}
+
+pkg_postinst() {
+	panel_pkg_postinst() {
+		PANEL_DIR="$(${EPYTHON} -c 'import os, panel; print(os.path.dirname(panel.__file__))')"
+		elog "Node.js packages bundled with Panel under ${EPYTHON} may be"
+		elog "desynchronized from Bokeh and require manual rebuilding with:"
+		elog "    sudo ${EPYTHON} -m panel build \"${PANEL_DIR}\""
+		elog
+	}
+
+	python_foreach_impl panel_pkg_postinst
+}

diff --git a/dev-python/panel/panel-0.14.2.ebuild b/dev-python/panel/panel-0.14.2.ebuild
new file mode 100644
index 000000000..ea5e77d3e
--- /dev/null
+++ b/dev-python/panel/panel-0.14.2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..10} )
+
+# Panel imports from "distutils" at runtime.
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="High-level app and dashboarding solution for Python"
+HOMEPAGE="https://panel.holoviz.org"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# "setup.py" imports from Bokeh to rebuild Node.js packages, but we patch that
+# away below. Our patched Panel thus requires Bokeh only at runtime.
+DEPEND="
+	>=dev-python/param-1.10.0[${PYTHON_USEDEP}]
+	>=dev-python/pyct-0.4.4[${PYTHON_USEDEP}]
+"
+RDEPEND="${DEPEND}
+	dev-python/markdown[${PYTHON_USEDEP}]
+	dev-python/requests[${PYTHON_USEDEP}]
+	dev-python/tqdm[${PYTHON_USEDEP}]
+	>=dev-python/bokeh-2.3.0[${PYTHON_USEDEP}]
+	>=dev-python/pyviz_comms-0.7.4[${PYTHON_USEDEP}]
+	>=net-libs/nodejs-15.11.0
+"
+
+PATCHES=( "${FILESDIR}/${PN}-0.14.1-disable_lite_build.patch" )
+
+src_prepare() {
+	# Install Jupyter configuration files to "/etc" rather than "/usr/etc".
+	sed -i -e 's~"etc/jupyter~"/etc/jupyter~' setup.py || die
+
+	default_src_prepare
+}
+
+pkg_postinst() {
+	panel_pkg_postinst() {
+		PANEL_DIR="$(${EPYTHON} -c 'import os, panel; print(os.path.dirname(panel.__file__))')"
+		elog "Node.js packages bundled with Panel under ${EPYTHON} may be"
+		elog "desynchronized from Bokeh and require manual rebuilding with:"
+		elog "    sudo ${EPYTHON} -m panel build \"${PANEL_DIR}\""
+		elog
+	}
+
+	python_foreach_impl panel_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-15 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15 17:25 [gentoo-commits] proj/sci:master commit in: dev-python/panel/, dev-python/panel/files/ Horea Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox