public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Horea Christian" <horea.christ@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: dev-python/panel/, dev-python/panel/files/
Date: Sun, 15 Jan 2023 17:25:18 +0000 (UTC)	[thread overview]
Message-ID: <1673803493.5857ad8b9eb2c589505e2ae90f4492af4907cf56.chymera@gentoo> (raw)

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
+}


                 reply	other threads:[~2023-01-15 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1673803493.5857ad8b9eb2c589505e2ae90f4492af4907cf56.chymera@gentoo \
    --to=horea.christ@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox