summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMarcell Meszaros2022-07-11 18:43:09 +0200
committerMarcell Meszaros2022-07-11 18:54:49 +0200
commit8ba060b16c43162a0049c1397408c35fccfc7926 (patch)
tree5bd74222c7cf91bba77f42c1a305c2f3ad0a7fd5 /PKGBUILD
parent1841f2319850d0b1e0cedad83bf84f2cdb50af8b (diff)
downloadaur-python-pymantic.tar.gz
0.3.0-1: update and enable testing
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD49
1 files changed, 36 insertions, 13 deletions
diff --git a/PKGBUILD b/PKGBUILD
index b4a4a99e7a7f..ff837c02f143 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,35 +3,58 @@
pkgname='python-pymantic'
_module="${pkgname#python-}"
-pkgver=0.2.5
-pkgrel=2
+_repo_commit='43125e320076ca86074a41c0f02bce943a760c80' # untagged 0.3.0 release version
+pkgver=0.3.0
+pkgrel=1
pkgdesc='Semantic Web and RDF library for Python'
arch=('any')
url="https://pypi.org/project/${_module}/${pkgver}"
+_repo_owner='norcalrdf' # Need GitHub tarball for tests; PyPI source lacks some test files
+_repo_url_api="https://api.github.com/repos/${_repo_owner}/${_module}"
license=('BSD')
depends=(
'python'
'python-requests'
+ 'python-lark-parser'
'python-lxml'
+ 'python-pyld'
'python-pytz'
'python-rdflib'
- 'python-lark-parser'
- 'python-pyld'
)
makedepends=('python-setuptools')
-_sourcename="${_module}-${pkgver}"
-source=("https://files.pythonhosted.org/packages/source/${_module::1}/${_module}/${_sourcename}.tar.gz"
- "${_sourcename}-LICENSE::https://github.com/norcalrdf/${_module}/raw/${pkgver}/LICENSE")
-sha256sums=('119361a60d811aea6f57faf05f9aebc787e37244e3c8e9c922e9621b2a425dcf'
- 'c5a804cb694b36e4604f1edaf496ad7aaa93690d27666a6a7887354ec3a1a884')
+checkdepends=(
+ 'python-betamax'
+ 'python-nose'
+)
+_tarname="${_repo_owner}-${_module}-${_repo_commit::7}"
+source=("${_tarname}.tar.gz::${_repo_url_api}/tarball/${_repo_commit}")
+b2sums=('ead17a726aa661035c72f4e738a3c338fcf2058803ef0eefbe7d1aad7793e94b8a445dc5eab3961a1e4edefccbaade526476e7946c4b985eeb26559f6346b044')
build() {
- cd "${_sourcename}"
+ cd "${_tarname}"
python setup.py build --executable='/usr/bin/env python'
}
+check() {
+ cd "${_tarname}"
+ (
+ export PYTHONPATH="${PWD}/build/lib:${PYTHONPATH}"
+ nosetests \
+ --detailed-errors \
+ --no-byte-compile \
+ --verbose \
+ --with-id
+ )
+}
+
package() {
- cd "${_sourcename}"
- python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
- install --verbose -Dm 644 "../${_sourcename}-LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ cd "${_tarname}"
+ python setup.py install --force --root="${pkgdir}" --prefix='/usr' --optimize=1 --skip-build
+
+ install --verbose -Dm 644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install --verbose -Dm 644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}"
+
+ echo "Removing tests from package..."
+ local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ rm -rfv "${pkgdir}${_site_packages}/${_module}/tests/"
}