summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorCarlos Aznarán Laos2023-06-13 13:36:30 -0500
committerCarlos Aznarán Laos2023-06-13 13:36:30 -0500
commit22b201a006c21b040b346558c02abbf74d7b6e7b (patch)
tree2af8f04fef369dfb1c37923215aa62b724deb3fc /PKGBUILD
parentb8a4e6ecbfb20b46c958a10eb49a9c401e1f5fcf (diff)
downloadaur-python-viscm.tar.gz
Bump version to 0.10
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD51
1 files changed, 22 insertions, 29 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2fd68627e805..8bd2eb927d4a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,42 +3,35 @@
# Contributor: Antony Lee <anntzer dot lee at gmail dot com>
_base=viscm
pkgname=python-${_base}
-pkgdesc="A tool for visualizing and designing colormaps using colorspacious and matplotlib"
-pkgver=0.9
-pkgrel=4
-arch=('any')
+pkgdesc="A colormap tool"
+pkgver=0.10
+pkgrel=1
+arch=(any)
url="https://github.com/matplotlib/${_base}"
license=(MIT)
-depends=(python-matplotlib python-colorspacious pyside2)
-makedepends=(python-setuptools)
-# checkdepends=(python-pytest python-scipy)
-source=(${url}/archive/v${pkgver}.tar.gz)
-sha512sums=('aa352f12c243f9940297dc2799e1ad1e649f8bfc0c3a5bb772f351ec0d3c380619382da847e090c1191840036a3f06ccf552658c59ce2296f576e5213884e334')
-
-prepare() {
- # https://github.com/matplotlib/viscm/issues/55
- sed -i 's/^from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas4/#from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas4/' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i 's/^from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas5/#from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas5/' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i '21 a try:' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i '22 a \ \ \ \ from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas5' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i '23 a except Exception:' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i '24 a \ \ \ \ from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas4' "${_base}-${pkgver}/${_base}/gui.py"
- sed -i 's/^from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas/from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas/' "${_base}-${pkgver}/tests.py"
-}
+depends=(python-matplotlib python-colorspacious python-scipy)
+makedepends=(python-build python-installer python-setuptools-scm python-wheel)
+checkdepends=(python-pytest pyside6) # python-pytest-xvfb
+optdepends=('pyside6: for Qt Python bindings'
+ 'python-pyqt6: for Qt Python bindings')
+source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz)
+sha512sums=('92896eb98fecbf29e919bbdfab7fb6fce29fc21ef0e41d01f72742f5a01a0d8d0493195395c9596f1822f4b33dbf89753d79c9a57a4135c4b18fc20c59ce3c9c')
build() {
- cd "${_base}-${pkgver}"
- python setup.py build
+ cd ${_base}-${pkgver}
+ export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
+ python -m build --wheel --skip-dependency-check --no-isolation
}
-# check() {
-# cd "${_base}-${pkgver}"
-# py.test tests.py -vv # -k 'not editor_loads_native'
-# }
+check() {
+ cd ${_base}-${pkgver}
+ python -m venv --system-site-packages test-env
+ test-env/bin/python -m installer dist/*.whl
+ test-env/bin/python -m pytest --ignore=test/test_gui.py
+}
package() {
- cd "${_base}-${pkgver}"
- export PYTHONHASHSEED=0
- PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
+ cd ${_base}-${pkgver}
+ PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}