summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgoekce2021-04-05 21:51:07 +0200
committergoekce2021-04-05 21:51:07 +0200
commit52d4d58cbeb4556b1649499ac815e9c691b43e3e (patch)
tree9656fc6034db3f68798253a0ac84048cb1ac9ad3
parentba1449e4f02233a5929b07f7fafd675ffdf2043e (diff)
downloadaur-52d4d58cbeb4556b1649499ac815e9c691b43e3e.tar.gz
deploy prebuilt extension directly
This allows ditching the install file. Thanks @mdeff
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD22
-rw-r--r--python-ipycanvas.install21
3 files changed, 20 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e64e620d7083..40d10f2d8472 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = python-ipycanvas-git
pkgdesc = Interactive widgets library exposing the browser's Canvas API
- pkgver = r297.0cc98b4
- pkgrel = 2
+ pkgver = r329.30ccca2
+ pkgrel = 1
url = https://github.com/martinRenou/ipycanvas
- install = python-ipycanvas.install
arch = any
license = BSD
makedepends = git
@@ -11,12 +10,12 @@ pkgbase = python-ipycanvas-git
makedepends = python-jupyter_packaging
depends = python
depends = python-setuptools
- depends = python-ipywidgets
depends = python-pillow
depends = python-numpy
depends = python-orjson
depends = jupyter
depends = jupyterlab
+ depends = jupyterlab-widgets
provides = python-ipycanvas
source = git+https://github.com/martinRenou/ipycanvas
md5sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index ef147462c188..ea1728e06313 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,8 @@
_py=ipycanvas
pkgname=python-$_py-git
provides=("${pkgname%-git}")
-pkgver=r297.0cc98b4
-pkgrel=2
+pkgver=r329.30ccca2
+pkgrel=1
pkgdesc="Interactive widgets library exposing the browser's Canvas API"
arch=(any)
url="https://github.com/martinRenou/ipycanvas"
@@ -11,12 +11,12 @@ license=(BSD)
depends=(
python
python-setuptools
- python-ipywidgets
python-pillow
python-numpy
python-orjson
jupyter
jupyterlab
+ jupyterlab-widgets
)
makedepends=(
git
@@ -35,7 +35,19 @@ build() {
}
package() {
cd $_py
- python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
+ #python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+
+ # install (and enable) extension according to
+ # https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html#distributing-a-prebuilt-extension
+ prebuilt_extension_dir_lab="$pkgdir"/usr/share/jupyter/labextensions
+ mkdir -p $prebuilt_extension_dir_lab
+ ln -s "$pkgdir"/usr/lib/python*/site-packages/ipycanvas/labextension $prebuilt_extension_dir_lab/$_py
+
+ # for classic interface
+ prebuilt_extension_dir_classic="$pkgdir"/usr/share/jupyter/nbextensions
+ mkdir -p $prebuilt_extension_dir_classic
+ ln -s "$pkgdir"/usr/lib/python*/site-packages/ipycanvas/nbextension $prebuilt_extension_dir_classic/$_py
+
install -Dm644 $(find LICENSE*|head -1) "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
-install=${pkgname%-git}.install
diff --git a/python-ipycanvas.install b/python-ipycanvas.install
deleted file mode 100644
index c0db25a7326f..000000000000
--- a/python-ipycanvas.install
+++ /dev/null
@@ -1,21 +0,0 @@
-post_install() {
- echo 'Installing the extension in Jupyterlab:'
- jupyter labextension install @jupyter-widgets/jupyterlab-manager ipycanvas
- echo 'Installing and enabling the extension in Jupyter notebook (tree):'
- jupyter nbextension install --system --py ipycanvas
- jupyter nbextension enable --system --py ipycanvas
- echo 'Please restart the Jupyter servers to load the new extension'
-}
-
-pre_remove() {
- echo 'Uninstalling the extension in Jupyterlab:'
- jupyter labextension uninstall @jupyter-widgets/jupyterlab-manager ipycanvas
- echo 'Uninstalling and disabling the extension in Jupyter notebook (tree):'
- jupyter nbextension disable --system --py ipycanvas
- jupyter nbextension uninstall --system --py ipycanvas
-}
-
-post_upgrade() {
- pre_remove
- post_install
-}