summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD82
1 files changed, 70 insertions, 12 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 06a4ad9bd3a9..64883e927aba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,84 @@
# Maintainer: Grey Christoforo <first name at last name dot net>
+# Co-Maintainer: Bert Peters <bert@bertptrs.nl>
pkgname=python-plotly
-pkgver=4.5.2
+pkgver=5.21.0
pkgrel=1
pkgdesc="An open-source, interactive graphing library"
-url="https://plot.ly/python/"
-depends=('python' 'python-matplotlib' 'python-numpy' 'python-six' 'python-retrying')
-optdepends=('ipython' 'python-ipywidgets')
-makedepends=('python-setuptools')
-license=('MIT')
arch=('any')
-source=("https://github.com/plotly/plotly.py/archive/v${pkgver}.tar.gz")
-md5sums=('507097b4f9631878deddab646477fd93')
+url="https://github.com/plotly/plotly.py"
+license=('MIT')
+depends=(
+ python
+ python-tenacity
+)
+# optdepends based on optional_requirements.txt
+optdepends=(
+ ipython
+ jupyterlab
+ python-ipywidgets
+ python-numpy
+ python-matplotlib
+ python-pillow
+ python-scipy
+ python-ipykernel
+ python-pandas
+ python-colorcet
+ python-inflect
+ python-psutil
+)
+makedepends=(
+ git
+ npm
+ python-wheel
+ python-build
+ python-installer
+ python-setuptools
+ python-jupyter_core
+ python-tornado
+ jupyterlab
+)
+checkdepends=(
+ python-requests
+ python-pytest
+)
+source=(
+ "${pkgname}::git+https://github.com/plotly/plotly.py#tag=v$pkgver"
+ "js-build.patch"
+)
+sha256sums=('7fee32a41d1f1b9b3646f4d6b746882a3ec89766fa4e2f94d97646315514c50b'
+ '347d8de2ed5c6529a0113086780ecdd0b21c0a167fa60a890ca18bbac0d99392')
+options=(!strip !debug) # strip and debug aren't useful for python files and take forever
+
+prepare() {
+ cd python-plotly
+
+ git clean -dfx
+ patch -p1 < ../js-build.patch
+}
build() {
- cd plotly.py-${pkgver}/packages/python/plotly
- python setup.py build
+ cd python-plotly/packages/python/plotly
+
+ # Skip the dependency check as the version bounds on jupyterlab are too tight
+ # and don't allow 4.x, which Arch currently ships.
+ python -m build --wheel --no-isolation --skip-dependency-check
+}
+
+check() {
+ cd python-plotly/packages/python/plotly
+ pytest plotly/tests/test_core
}
package() {
- cd plotly.py-${pkgver}/packages/python/plotly
- python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ cd python-plotly/packages/python/plotly
+ python -m installer --destdir="$pkgdir"/ dist/*.whl
+ mv "${pkgdir}/usr/etc" "${pkgdir}"
+
+ # symlink the path where static assets are installed, otherwise jupyterlab
+ # will not be able to load the extension properly
+ local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ ln -s "$site_packages/jupyterlab_plotly/labextension/static" "$pkgdir/usr/share/jupyter/labextensions/jupyterlab-plotly/"
install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}