summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBlair Bonnett2020-09-05 17:07:23 +0200
committerBlair Bonnett2020-09-05 17:07:23 +0200
commitfaf33783317829e45d16181f26e0fd043e8f439a (patch)
tree07444edfd7fc8aec5ba50738c734f602016b01f9
parentfae32ebe1a556163c0432b3c33bef5fbb5908ceb (diff)
downloadaur-faf33783317829e45d16181f26e0fd043e8f439a.tar.gz
Run tests in check().
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD41
2 files changed, 41 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3d0a3c5f2426..bae7cd1d4fcf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,18 @@
pkgbase = python-quaternionic
pkgdesc = Interpret NumPy arrays as quaternionic arrays with Numba acceleration
pkgver = 0.1.10
- pkgrel = 1
+ pkgrel = 2
url = https://quaternionic.readthedocs.io
arch = any
license = MIT
- makedepends = python-setuptools
+ checkdepends = python-pytest
+ checkdepends = python-pytest-cov
+ makedepends = python-dephell
depends = python-numba
depends = python-numpy
depends = python-scipy
- source = https://files.pythonhosted.org/packages/source/q/quaternionic/quaternionic-0.1.10.tar.gz
- sha256sums = d567871e0d4566a8f2aa3259c46f524aaf86132c15e0545932b6d93858a64968
+ source = quaternionic-0.1.10.tar.gz::https://github.com/moble/quaternionic/archive/v0.1.10.tar.gz
+ sha256sums = dbc0125a94458e6f2a62b00a79ce61f495f798aaebb44e17c0eba5988cee4080
pkgname = python-quaternionic
diff --git a/PKGBUILD b/PKGBUILD
index c89fb42ecfd8..de8897323ea2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,28 +2,57 @@
pkgname=python-quaternionic
pkgver=0.1.10
-pkgrel=1
+pkgrel=2
pkgdesc="Interpret NumPy arrays as quaternionic arrays with Numba acceleration"
url="https://quaternionic.readthedocs.io"
arch=('any')
license=('MIT')
depends=('python-numba' 'python-numpy' 'python-scipy')
-makedepends=('python-setuptools')
+makedepends=('python-dephell')
+checkdepends=('python-pytest' 'python-pytest-cov')
source=(
- "https://files.pythonhosted.org/packages/source/q/quaternionic/quaternionic-$pkgver.tar.gz"
+ "quaternionic-$pkgver.tar.gz::https://github.com/moble/quaternionic/archive/v$pkgver.tar.gz"
)
sha256sums=(
- 'd567871e0d4566a8f2aa3259c46f524aaf86132c15e0545932b6d93858a64968'
+ 'dbc0125a94458e6f2a62b00a79ce61f495f798aaebb44e17c0eba5988cee4080'
)
+prepare() {
+ cd "quaternionic-$pkgver"
+
+ # The release is tagged as 0.1.10 on PyPI and GitHub but the version number
+ # in pyproject.toml says 0.1.9.
+ sed -i -e 's/^version = "0.1.9"$/version = "0.1.10"/' pyproject.toml
+
+ # The archive from GitHub doesn't include a setup.py (the project uses
+ # python-poetry for development). The source on PyPI does have a setup.py
+ # but does not include the tests. Until they can be included, we'll use the
+ # GitHub archive and generare our own setup.py.
+ dephell deps convert --from pyproject.toml --to setup.py
+}
+
build() {
cd "quaternionic-$pkgver"
python setup.py build
}
+check() {
+ cd "quaternionic-$pkgver"
+
+ # The library uses importlib_metadata to load its version info, so we need
+ # the metadata available before we can run the tests.
+ python setup.py egg_info -e build/lib
+ PYTHONPATH=$PWD/build/lib python -m pytest
+
+ # This metadata is not properly versioned (neither project nor Python
+ # version). Remove it and let the install command create the final version.
+ rm -r build/lib/quaternionic.egg-info
+}
+
+
package() {
cd "quaternionic-$pkgver"
- python setup.py install --root="$pkgdir/" --prefix=/usr --optimize=1 --skip-build
- install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ python setup.py install --root="$pkgdir/" --prefix=/usr --optimize=1 --skip-build
+ install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}